From b1ed9eaf16732f3200c348599a2e09c9c1c29950 Mon Sep 17 00:00:00 2001 From: Jesus Manuel Olivas Date: Mon, 10 Jul 2017 08:19:44 -0700 Subject: [PATCH] [develop:contribute] Add new command. (#4) --- .gitignore | 19 + composer.lock | 1230 +++++++++++++++++ console.services.yml | 6 + .../translations/en/develop.contribute.yml | 8 + src/Command/ContributeCommand.php | 150 ++ 5 files changed, 1413 insertions(+) create mode 100644 .gitignore create mode 100644 composer.lock create mode 100644 console/translations/en/develop.contribute.yml create mode 100644 src/Command/ContributeCommand.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7b42e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# deprecation-detector +/.rules + +# Composer +/vendor + +# Binaries +/box.phar +/console.phar +/composer.phar +/drupal.phar +/drupal.phar.version + +# Test +/phpunit.xml + +# Project +extend.config.yml +extend.services.yml diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..0b76370 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1230 @@ +{ + "_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": "fad12641ac758a5fe5efc8ceabcf0b84", + "packages": [], + "packages-dev": [ + { + "name": "dflydev/dot-access-configuration", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-configuration.git", + "reference": "9b65c83159c9003e00284ea1144ad96b69d9c8b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-configuration/zipball/9b65c83159c9003e00284ea1144ad96b69d9c8b9", + "reference": "9b65c83159c9003e00284ea1144ad96b69d9c8b9", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "1.*", + "dflydev/placeholder-resolver": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "symfony/yaml": "~2.1" + }, + "suggest": { + "symfony/yaml": "Required for using the YAML Configuration Builders" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessConfiguration": "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" + } + ], + "description": "Given a deep data structure representing a configuration, access configuration by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-configuration", + "keywords": [ + "config", + "configuration" + ], + "time": "2014-11-14T03:26:12+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": "dflydev/placeholder-resolver", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-placeholder-resolver.git", + "reference": "c498d0cae91b1bb36cc7d60906dab8e62bb7c356" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-placeholder-resolver/zipball/c498d0cae91b1bb36cc7d60906dab8e62bb7c356", + "reference": "c498d0cae91b1bb36cc7d60906dab8e62bb7c356", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\PlaceholderResolver": "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" + } + ], + "description": "Given a data source representing key => value pairs, resolve placeholders like ${foo.bar} to the value associated with the 'foo.bar' key in the data source.", + "homepage": "https://github.com/dflydev/dflydev-placeholder-resolver", + "keywords": [ + "placeholder", + "resolver" + ], + "time": "2012-10-28T21:08:28+00:00" + }, + { + "name": "drupal/console-core", + "version": "1.0.0-rc23", + "source": { + "type": "git", + "url": "https://github.com/hechoendrupal/drupal-console-core.git", + "reference": "b1f3680ae19a4d00f8b701b060521bab2cccd6b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hechoendrupal/drupal-console-core/zipball/b1f3680ae19a4d00f8b701b060521bab2cccd6b1", + "reference": "b1f3680ae19a4d00f8b701b060521bab2cccd6b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-configuration": "1.0.1", + "drupal/console-en": "1.0.0-rc23", + "php": "^5.5.9 || ^7.0", + "stecman/symfony-console-completion": "~0.7", + "symfony/config": "~2.8", + "symfony/console": "~2.8", + "symfony/debug": "~2.8", + "symfony/dependency-injection": "~2.8", + "symfony/event-dispatcher": "~2.8", + "symfony/filesystem": "~2.8", + "symfony/finder": "~2.8", + "symfony/process": "~2.8", + "symfony/translation": "~2.8", + "symfony/yaml": "~2.8", + "twig/twig": "^1.23.1", + "webflo/drupal-finder": "^0.3.0", + "webmozart/path-util": "^2.3" + }, + "type": "project", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Drupal\\Console\\Core\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "David Flores", + "email": "dmousex@gmail.com", + "homepage": "http://dmouse.net" + }, + { + "name": "Jesus Manuel Olivas", + "email": "jesus.olivas@gmail.com", + "homepage": "http://jmolivas.com" + }, + { + "name": "Drupal Console Contributors", + "homepage": "https://github.com/hechoendrupal/DrupalConsole/graphs/contributors" + }, + { + "name": "Eduardo Garcia", + "email": "enzo@enzolutions.com", + "homepage": "http://enzolutions.com/" + }, + { + "name": "Omar Aguirre", + "email": "omersguchigu@gmail.com" + } + ], + "description": "Drupal Console Core", + "homepage": "http://drupalconsole.com/", + "keywords": [ + "console", + "development", + "drupal", + "symfony" + ], + "time": "2017-06-27T09:16:56+00:00" + }, + { + "name": "drupal/console-en", + "version": "1.0.0-rc23", + "source": { + "type": "git", + "url": "https://github.com/hechoendrupal/drupal-console-en.git", + "reference": "e2461a8cf8bb29aacae0cf0f8a0a2c8d36ed4220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hechoendrupal/drupal-console-en/zipball/e2461a8cf8bb29aacae0cf0f8a0a2c8d36ed4220", + "reference": "e2461a8cf8bb29aacae0cf0f8a0a2c8d36ed4220", + "shasum": "" + }, + "type": "drupal-console-language", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "David Flores", + "email": "dmousex@gmail.com", + "homepage": "http://dmouse.net" + }, + { + "name": "Jesus Manuel Olivas", + "email": "jesus.olivas@gmail.com", + "homepage": "http://jmolivas.com" + }, + { + "name": "Drupal Console Contributors", + "homepage": "https://github.com/hechoendrupal/DrupalConsole/graphs/contributors" + }, + { + "name": "Eduardo Garcia", + "email": "enzo@enzolutions.com", + "homepage": "http://enzolutions.com/" + }, + { + "name": "Omar Aguirre", + "email": "omersguchigu@gmail.com" + } + ], + "description": "Drupal Console English Language", + "homepage": "http://drupalconsole.com/", + "keywords": [ + "console", + "development", + "drupal", + "symfony" + ], + "time": "2017-06-22T19:05:23+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": "stecman/symfony-console-completion", + "version": "0.7.0", + "source": { + "type": "git", + "url": "https://github.com/stecman/symfony-console-completion.git", + "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stecman/symfony-console-completion/zipball/5461d43e53092b3d3b9dbd9d999f2054730f4bbb", + "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/console": "~2.3 || ~3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Stecman\\Component\\Symfony\\Console\\BashCompletion\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stephen Holdaway", + "email": "stephen@stecman.co.nz" + } + ], + "description": "Automatic BASH completion for Symfony Console Component based applications.", + "time": "2016-02-24T05:08:54+00:00" + }, + { + "name": "symfony/config", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "0b8541d18507d10204a08384640ff6df3c739ebe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/0b8541d18507d10204a08384640ff6df3c739ebe", + "reference": "0b8541d18507d10204a08384640ff6df3c739ebe", + "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-04-12T14:07:15+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "46e65f8d98c9ab629bbfcc16a4ff023f61c37fb2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/46e65f8d98c9ab629bbfcc16a4ff023f61c37fb2", + "reference": "46e65f8d98c9ab629bbfcc16a4ff023f61c37fb2", + "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-07-03T08:04:30+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "8470d7701177a88edeb0cec59b44d50ef4477e9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/8470d7701177a88edeb0cec59b44d50ef4477e9b", + "reference": "8470d7701177a88edeb0cec59b44d50ef4477e9b", + "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-06-01T20:52:29+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "66d2e252262749e0f3c735c183e4562c72ffb8c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/66d2e252262749e0f3c735c183e4562c72ffb8c8", + "reference": "66d2e252262749e0f3c735c183e4562c72ffb8c8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "conflict": { + "symfony/expression-language": "<2.6" + }, + "require-dev": { + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-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": "2017-06-14T00:55:24+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1377400fd641d7d1935981546aaef780ecd5bf6d", + "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d", + "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-06-02T07:47:27+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b8c9c18eacc525c980d27c7a2c8fd1e09e0ed4c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8c9c18eacc525c980d27c7a2c8fd1e09e0ed4c7", + "reference": "b8c9c18eacc525c980d27c7a2c8fd1e09e0ed4c7", + "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-06-20T23:27:56+00:00" + }, + { + "name": "symfony/finder", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "4f4e84811004e065a3bb5ceeb1d9aa592630f9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/4f4e84811004e065a3bb5ceeb1d9aa592630f9ad", + "reference": "4f4e84811004e065a3bb5ceeb1d9aa592630f9ad", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-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": "2017-06-01T20:52:29+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-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-06-09T14:24:12+00:00" + }, + { + "name": "symfony/process", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8", + "reference": "57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-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": "2017-07-03T08:04:30+00:00" + }, + { + "name": "symfony/translation", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "a89af885b8c6d0142c79a02ca9cc059ed25d40d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/a89af885b8c6d0142c79a02ca9cc059ed25d40d8", + "reference": "a89af885b8c6d0142c79a02ca9cc059ed25d40d8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/yaml": "~2.2|~3.0.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-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": "2017-06-24T16:44:49+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "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-06-01T20:52:29+00:00" + }, + { + "name": "twig/twig", + "version": "v1.34.4", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "f878bab48edb66ad9c6ed626bf817f60c6c096ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/f878bab48edb66ad9c6ed626bf817f60c6c096ee", + "reference": "f878bab48edb66ad9c6ed626bf817f60c6c096ee", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "~2.7", + "symfony/phpunit-bridge": "~3.3@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.34-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": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "time": "2017-07-04T13:19:31+00:00" + }, + { + "name": "webflo/drupal-finder", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-finder.git", + "reference": "6ef150707aad1755d91f9b0d2108bcc16661e76b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/6ef150707aad1755d91f9b0d2108bcc16661e76b", + "reference": "6ef150707aad1755d91f9b0d2108bcc16661e76b", + "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-05-04T08:54:02+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" + }, + { + "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" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/console.services.yml b/console.services.yml index 3873b58..fb7f7dd 100644 --- a/console.services.yml +++ b/console.services.yml @@ -55,3 +55,9 @@ services: tags: - { name: drupal.command } lazy: true + console.develop_contribute: + class: \Drupal\Console\Develop\Command\ContributeCommand + arguments: ['@console.root', '@console.configuration_manager'] + tags: + - { name: drupal.command } + lazy: true diff --git a/console/translations/en/develop.contribute.yml b/console/translations/en/develop.contribute.yml new file mode 100644 index 0000000..62201eb --- /dev/null +++ b/console/translations/en/develop.contribute.yml @@ -0,0 +1,8 @@ +description: 'Create symlinks between Drupal site and cloned repositories.' +options: + code-directory: 'The path where the projects where cloned' +questions: + code-directory: 'Enter the path where the projects where cloned' +messages: + symlink: 'Creating symlinks between directories.' + copy: 'Autoload file "%s" copied as "%s".' diff --git a/src/Command/ContributeCommand.php b/src/Command/ContributeCommand.php new file mode 100644 index 0000000..06a1547 --- /dev/null +++ b/src/Command/ContributeCommand.php @@ -0,0 +1,150 @@ +consoleRoot = $consoleRoot; + $this->configurationManager = $configurationManager; + parent::__construct(); + } + + protected function configure() + { + $this->setName('develop:contribute') + ->addOption( + 'code-directory', + null, + InputOption::VALUE_OPTIONAL, + $this->trans('commands.develop.contribute.options.code-directory') + ); + } + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) + { + $io = new DrupalStyle($input, $output); + $codeDirectory = $input->getOption('code-directory'); + if (!$codeDirectory) { + $codeDirectory = $io->ask( + $this->trans('commands.develop.contribute.questions.code-directory') + ); + $input->setOption('code-directory', $codeDirectory); + } + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $io = new DrupalStyle($input, $output); + $codeDirectory = $input->getOption('code-directory'); + $fileSystem = new Filesystem(); + + foreach ($this->packages as $package) { + $projectPath = $codeDirectory . '/' . $package; + $packagePath = $this->consoleRoot . '/vendor/drupal/' . substr($package, 7, strlen($package)); + if ($fileSystem->exists([$projectPath,$packagePath])) { + $fileSystem->remove($packagePath); + $fileSystem->symlink( + $projectPath, + $packagePath + ); + $io->writeln($this->trans('commands.develop.contribute.messages.symlink')); + $io->info( + $fileSystem->makePathRelative( + $packagePath, + $this->consoleRoot + ) . ' => ', + false + ); + $io->comment( + $fileSystem->makePathRelative( + $projectPath, + $this->consoleRoot + ) + ); + } + } + $autoloadDistOriginal = $codeDirectory.'/'.$this->packages[0].'/autoload.local.php.dist'; + $autoloadDistLocal = $codeDirectory.'/'.$this->packages[0].'/autoload.local.php'; + if ($fileSystem->exists($autoloadDistOriginal) && !$fileSystem->exists($autoloadDistLocal)) { + $io->writeln( + sprintf( + $this->trans('commands.develop.contribute.messages.copy'), + $fileSystem->makePathRelative( + $autoloadDistOriginal, + $this->consoleRoot + ), + $fileSystem->makePathRelative( + $autoloadDistLocal, + $this->consoleRoot + ) + ) + ); + $fileSystem->copy( + $autoloadDistOriginal, + $autoloadDistLocal + ); + } + } +}