diff --git a/composer.json b/composer.json index 2a1d0a3..88983d3 100644 --- a/composer.json +++ b/composer.json @@ -6,11 +6,7 @@ "require": { "php": ">=5.4.5", "composer-plugin-api": "^1.0.0", - "guzzlehttp/guzzle": "~6.1", - "codegyre/robo": "^0.7.1", - "pear/archive_tar": "~1.0", - "ext-curl": "*", - "ext-zlib": "*" + "guzzlehttp/guzzle": "~6.1" }, "autoload": { "psr-4": { @@ -20,7 +16,7 @@ "extra": { "class": "DrupalComposer\\DrupalScaffold\\Plugin", "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "require-dev": { diff --git a/composer.lock b/composer.lock index d70198b..80db296 100644 --- a/composer.lock +++ b/composer.lock @@ -4,709 +4,46 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "5fa4ce82e2fa344ea05f4192b2fd2f01", - "content-hash": "b30b5e8de7801ac5a707add2b1bdb03e", + "hash": "ca500d5d7e41cbc7b78b3fcda1ddfc93", + "content-hash": "842478848a548792415b558cd21f89d0", "packages": [ { - "name": "codegyre/robo", - "version": "0.7.1", - "source": { - "type": "git", - "url": "https://github.com/Codegyre/Robo.git", - "reference": "1f4e0621fdc37521e2eaca67f33d1c4e240dc7d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codegyre/Robo/zipball/1f4e0621fdc37521e2eaca67f33d1c4e240dc7d8", - "reference": "1f4e0621fdc37521e2eaca67f33d1c4e240dc7d8", - "shasum": "" - }, - "require": { - "henrikbjorn/lurker": "~1.0", - "php": ">=5.4.0", - "symfony/console": "~2.5|~3.0", - "symfony/filesystem": "~2.5|~3.0", - "symfony/finder": "~2.5|~3.0", - "symfony/process": "~2.5|~3.0" - }, - "require-dev": { - "codeception/aspect-mock": "0.5.4", - "codeception/base": "~2.1.5", - "codeception/verify": "0.2.*", - "natxet/cssmin": "~3.0", - "patchwork/jsqueeze": "~1.0", - "pear/archive_tar": "~1.0" - }, - "suggest": { - "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." - }, - "bin": [ - "robo" - ], - "type": "library", - "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": "2016-02-25 19:28:51" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.1.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c", - "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.1-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": "2015-11-23 00:47:50" - }, - { - "name": "guzzlehttp/promises", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", - "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-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": "2015-10-15 22:28:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.2.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b", - "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b", - "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.0-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" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "time": "2016-02-18 21:54:00" - }, - { - "name": "henrikbjorn/lurker", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/flint/Lurker.git", - "reference": "ab45f9cefe600065cc3137a238217598d3a1d062" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/flint/Lurker/zipball/ab45f9cefe600065cc3137a238217598d3a1d062", - "reference": "ab45f9cefe600065cc3137a238217598d3a1d062", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/config": "~2.2", - "symfony/event-dispatcher": "~2.2" - }, - "suggest": { - "ext-inotify": ">=0.1.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Lurker": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Yaroslav Kiliba", - "email": "om.dattaya@gmail.com" - }, - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com" - }, - { - "name": "Henrik Bjrnskov", - "email": "henrik@bjrnskov.dk" - } - ], - "description": "Resource Watcher.", - "keywords": [ - "filesystem", - "resource", - "watching" - ], - "time": "2015-10-27 09:19:19" - }, - { - "name": "pear/archive_tar", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/pear/Archive_Tar.git", - "reference": "fc2937c0e5a2a1c62a378d16394893172f970064" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/fc2937c0e5a2a1c62a378d16394893172f970064", - "reference": "fc2937c0e5a2a1c62a378d16394893172f970064", - "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", - "homepage": "https://github.com/pear/Archive_Tar", - "keywords": [ - "archive", - "tar" - ], - "time": "2015-08-05 12:31:03" - }, - { - "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-20 20:28:12" - }, - { - "name": "pear/pear-core-minimal", - "version": "v1.10.1", - "source": { - "type": "git", - "url": "https://github.com/pear/pear-core-minimal.git", - "reference": "cae0f1ce0cb5bddb611b0a652d322905a65a5896" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/cae0f1ce0cb5bddb611b0a652d322905a65a5896", - "reference": "cae0f1ce0cb5bddb611b0a652d322905a65a5896", - "shasum": "" - }, - "require": { - "pear/console_getopt": "~1.3", - "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": "2015-10-17 11:41:19" - }, - { - "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-10 20:07:52" - }, - { - "name": "psr/http-message", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "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", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2015-05-04 20:22:00" - }, - { - "name": "symfony/config", - "version": "v2.8.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19", - "reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~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": "2016-02-22 16:12:45" - }, - { - "name": "symfony/console", - "version": "v3.0.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2ed5e2706ce92313d120b8fe50d1063bcfd12e04", - "reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.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": "2016-02-28 16:24:34" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.8.3", + "name": "guzzlehttp/guzzle", + "version": "6.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "d094e337976dff9d8e2424e8485872194e768662" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/78c468665c9568c3faaa9c416a7134308f2d85c3", - "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", + "reference": "d094e337976dff9d8e2424e8485872194e768662", "shasum": "" }, "require": { - "php": ">=5.3.9" + "guzzlehttp/promises": "~1.0", + "guzzlehttp/psr7": "~1.1", + "php": ">=5.5.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=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": "" + "ext-curl": "*", + "phpunit/phpunit": "~4.0", + "psr/log": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "6.2-dev" } }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -714,47 +51,56 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" } ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2016-01-27 05:14:19" + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2016-03-21 20:02:09" }, { - "name": "symfony/filesystem", - "version": "v3.0.3", + "name": "guzzlehttp/promises", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "23ae8f9648d0a7fe94a47c8e20e5bf37c489a451" + "url": "https://github.com/guzzle/promises.git", + "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/23ae8f9648d0a7fe94a47c8e20e5bf37c489a451", - "reference": "23ae8f9648d0a7fe94a47c8e20e5bf37c489a451", + "url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579", + "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Filesystem\\": "" + "GuzzleHttp\\Promise\\": "src/" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -763,47 +109,53 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" } ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2016-02-23 15:16:06" + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-05-18 16:56:05" }, { - "name": "symfony/finder", - "version": "v3.0.3", + "name": "guzzlehttp/psr7", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "623bda0abd9aa29e529c8e9c08b3b84171914723" + "url": "https://github.com/guzzle/psr7.git", + "reference": "31382fef2889136415751badebbd1cb022a4ed72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/623bda0abd9aa29e529c8e9c08b3b84171914723", - "reference": "623bda0abd9aa29e529c8e9c08b3b84171914723", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/31382fef2889136415751badebbd1cb022a4ed72", + "reference": "31382fef2889136415751badebbd1cb022a4ed72", "shasum": "" }, "require": { - "php": ">=5.5.9" + "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": "3.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "GuzzleHttp\\Psr7\\": "src/" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -812,51 +164,47 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" } ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2016-01-27 05:14:46" + "description": "PSR-7 message implementation", + "keywords": [ + "http", + "message", + "stream", + "uri" + ], + "time": "2016-04-13 19:56:01" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.1.0", + "name": "psr/http-message", + "version": "1.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "1289d16209491b584839022f29257ad859b8532d" + "url": "https://github.com/php-fig/http-message.git", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", - "reference": "1289d16209491b584839022f29257ad859b8532d", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] + "Psr\\Http\\Message\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -864,55 +212,56 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", + "description": "Common interface for HTTP messages", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" ], - "time": "2016-01-20 09:13:37" - }, + "time": "2015-05-04 20:22:00" + } + ], + "packages-dev": [ { - "name": "symfony/process", - "version": "v3.0.3", + "name": "composer/ca-bundle", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "dfecef47506179db2501430e732adbf3793099c8" + "url": "https://github.com/composer/ca-bundle.git", + "reference": "a2995e5fe351055f2c7630166af12ce8fd03edfc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/dfecef47506179db2501430e732adbf3793099c8", - "reference": "dfecef47506179db2501430e732adbf3793099c8", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/a2995e5fe351055f2c7630166af12ce8fd03edfc", + "reference": "a2995e5fe351055f2c7630166af12ce8fd03edfc", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "symfony/process": "^2.5 || ^3.0" + }, + "suggest": { + "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Composer\\CaBundle\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -920,39 +269,42 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2016-02-02 13:44:19" - } - ], - "packages-dev": [ + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2016-04-13 10:13:24" + }, { "name": "composer/composer", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "f2d606ae0c705907d8bfa1c6f884bced1255b827" + "reference": "d401f6e95cca835d165c61648327fc1fa062ba31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/f2d606ae0c705907d8bfa1c6f884bced1255b827", - "reference": "f2d606ae0c705907d8bfa1c6f884bced1255b827", + "url": "https://api.github.com/repos/composer/composer/zipball/d401f6e95cca835d165c61648327fc1fa062ba31", + "reference": "d401f6e95cca835d165c61648327fc1fa062ba31", "shasum": "" }, "require": { + "composer/ca-bundle": "^1.0", "composer/semver": "^1.0", "composer/spdx-licenses": "^1.0", "justinrainbow/json-schema": "^1.6", "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0", "seld/cli-prompt": "^1.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", @@ -976,7 +328,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -1007,20 +359,20 @@ "dependency", "package" ], - "time": "2016-03-03 12:44:49" + "time": "2016-05-19 18:44:43" }, { "name": "composer/semver", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "df4463baa9f44fe6cf0a6da4fde2934d4c0a2747" + "reference": "84c47f3d8901440403217afc120683c7385aecb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/df4463baa9f44fe6cf0a6da4fde2934d4c0a2747", - "reference": "df4463baa9f44fe6cf0a6da4fde2934d4c0a2747", + "url": "https://api.github.com/repos/composer/semver/zipball/84c47f3d8901440403217afc120683c7385aecb8", + "reference": "84c47f3d8901440403217afc120683c7385aecb8", "shasum": "" }, "require": { @@ -1069,28 +421,28 @@ "validation", "versioning" ], - "time": "2016-02-25 22:23:39" + "time": "2016-03-30 13:16:03" }, { "name": "composer/spdx-licenses", - "version": "1.1.2", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "9e1c3926bb0842812967213d7c92827bc5883671" + "reference": "88c26372b1afac36d8db601cdf04ad8716f53d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/9e1c3926bb0842812967213d7c92827bc5883671", - "reference": "9e1c3926bb0842812967213d7c92827bc5883671", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/88c26372b1afac36d8db601cdf04ad8716f53d88", + "reference": "88c26372b1afac36d8db601cdf04ad8716f53d88", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "~2.3" + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" }, "type": "library", "extra": { @@ -1130,7 +482,7 @@ "spdx", "validator" ], - "time": "2015-10-05 11:27:42" + "time": "2016-05-04 12:27:30" }, { "name": "doctrine/instantiator", @@ -1515,21 +867,24 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "type": "library", "autoload": { "classmap": [ @@ -1552,7 +907,7 @@ "keywords": [ "timer" ], - "time": "2015-06-21 08:01:12" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", @@ -1605,16 +960,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.23", + "version": "4.8.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483" + "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e351261f9cd33daf205a131a1ba61c6d33bd483", - "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74", + "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74", "shasum": "" }, "require": { @@ -1628,7 +983,7 @@ "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/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", @@ -1673,7 +1028,7 @@ "testing", "xunit" ], - "time": "2016-02-11 14:56:33" + "time": "2016-05-17 03:09:28" }, { "name": "phpunit/phpunit-mock-objects", @@ -1714,22 +1069,60 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-10-02 06:51:40" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Common interface for logging libraries", "keywords": [ - "mock", - "xunit" + "log", + "psr", + "psr-3" ], - "time": "2015-10-02 06:51:40" + "time": "2012-12-21 11:40:51" }, { "name": "sebastian/comparator", @@ -1849,16 +1242,16 @@ }, { "name": "sebastian/environment", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { @@ -1895,7 +1288,7 @@ "environment", "hhvm" ], - "time": "2016-02-26 18:40:46" + "time": "2016-05-17 03:18:57" }, { "name": "sebastian/exporter", @@ -2104,16 +1497,16 @@ }, { "name": "seld/cli-prompt", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/Seldaek/cli-prompt.git", - "reference": "b27db1514f7d7bb7a366ad95d4eb2b17140a0691" + "reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/b27db1514f7d7bb7a366ad95d4eb2b17140a0691", - "reference": "b27db1514f7d7bb7a366ad95d4eb2b17140a0691", + "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4", + "reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4", "shasum": "" }, "require": { @@ -2148,7 +1541,7 @@ "input", "prompt" ], - "time": "2016-01-09 17:55:27" + "time": "2016-04-18 09:31:41" }, { "name": "seld/jsonlint", @@ -2240,18 +1633,284 @@ ], "time": "2015-10-13 18:44:15" }, + { + "name": "symfony/console", + "version": "v3.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "34a214710e0714b6efcf40ba3cd1e31373a97820" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/34a214710e0714b6efcf40ba3cd1e31373a97820", + "reference": "34a214710e0714b6efcf40ba3cd1e31373a97820", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "2016-04-28 09:48:42" + }, + { + "name": "symfony/filesystem", + "version": "v3.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "74fec3511b62cb934b64bce1d96f06fffa4beafd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/74fec3511b62cb934b64bce1d96f06fffa4beafd", + "reference": "74fec3511b62cb934b64bce1d96f06fffa4beafd", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "2016-04-12 18:09:53" + }, + { + "name": "symfony/finder", + "version": "v3.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "c54e407b35bc098916704e9fd090da21da4c4f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/c54e407b35bc098916704e9fd090da21da4c4f52", + "reference": "c54e407b35bc098916704e9fd090da21da4c4f52", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-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": "2016-03-10 11:13:05" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "dff51f72b0706335131b00a7f49606168c582594" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-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": "2016-05-18 14:26:46" + }, + { + "name": "symfony/process", + "version": "v3.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb", + "reference": "53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-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": "2016-04-14 15:30:28" + }, { "name": "symfony/yaml", - "version": "v3.0.3", + "version": "v3.0.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c" + "reference": "0047c8366744a16de7516622c5b7355336afae96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b5ba64cd67ecd6887f63868fa781ca094bd1377c", - "reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", + "reference": "0047c8366744a16de7516622c5b7355336afae96", "shasum": "" }, "require": { @@ -2287,7 +1946,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-02-23 15:16:06" + "time": "2016-03-04 07:55:57" } ], "aliases": [], @@ -2298,8 +1957,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.4.5", - "ext-curl": "*" + "php": ">=5.4.5" }, "platform-dev": [] } diff --git a/src/FileFetcher.php b/src/FileFetcher.php new file mode 100644 index 0000000..78c0e4f --- /dev/null +++ b/src/FileFetcher.php @@ -0,0 +1,56 @@ +client = $client; + $this->source = $source; + $this->filenames = $filenames; + $this->fs = new Filesystem(); + } + + public function fetch($version, $destination) { + array_walk($this->filenames, function ($filename) use ($version, $destination) { + $url = $this->getUri($filename, $version); + $this->fs->ensureDirectoryExists($destination . '/' . dirname($filename)); + $this->client->copy($url, $url, $destination . '/' . $filename); + }); + /* + $promises = array_map(function ($filename) use ($version) { + return $this->client->getAsync($this->getUri($filename, $version)); + }, array_combine($this->filenames, $this->filenames)); + + $results = Promise\unwrap($promises); + array_walk($results, function (ResponseInterface $response, $filename) use ($destination) { + $this->fs->ensureDirectoryExists($destination . '/' . dirname($filename)); + file_put_contents($filename, $response->getBody()->getContents()); + }); + */ + } + + protected function getUri($filename, $version) { + $map = [ + '{path}' => $filename, + '{version}' => $version + ]; + return str_replace(array_keys($map), array_values($map), $this->source); + } + +} diff --git a/src/Handler.php b/src/Handler.php index 05d184e..a8bbd7a 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -13,8 +13,9 @@ use Composer\IO\IOInterface; use Composer\Package\PackageInterface; use Composer\EventDispatcher\EventDispatcher; - use Composer\Util\Filesystem; +use Composer\Util\RemoteFilesystem; +use GuzzleHttp\Client; use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem; class Handler { @@ -99,7 +100,7 @@ public function onPostCmdEvent(\Composer\Script\Event $event) { */ public function downloadScaffold() { $drupalCorePackage = $this->getDrupalCorePackage(); - $webroot = $this->getWebRoot(); + $webroot = realpath($this->getWebRoot()); // Collect options, excludes and settings files. $options = $this->getOptions(); @@ -110,23 +111,8 @@ public function downloadScaffold() { $dispatcher = new EventDispatcher($this->composer, $this->io); $dispatcher->dispatch(self::PRE_DRUPAL_SCAFFOLD_CMD); - // Run Robo - $robo = new RoboRunner(); - $robo->execute( - [ - 'robo', - 'drupal_scaffold:download', - $drupalCorePackage->getPrettyVersion(), - '--source', - $options['source'], - '--webroot', - realpath($webroot), - '--excludes', - static::array_to_csv($excludes), - '--includes', - static::array_to_csv($includes), - ] - ); + $fetcher = new FileFetcher(new RemoteFilesystem($this->io), $options['source'], $includes); + $fetcher->fetch($drupalCorePackage->getPrettyVersion(), $webroot); // Call post-scaffold scripts. $dispatcher->dispatch(self::POST_DRUPAL_SCAFFOLD_CMD); @@ -140,20 +126,6 @@ public static function execute($args) { passthru($command); } - /** - * Convert an array into a comma-separated-value string. - * Items remain unchanged unless they need to be escaped. - * - * Compliment of str_getcsv(). - */ - public static function array_to_csv($data, $delimiter = ',', $enclosure = '"', $escape = '\\') { - return implode(',', array_map(function ($item) use($delimiter, $enclosure, $escape) { - $has_delimiter = (strpos($item, $delimiter) !== FALSE); - $escaped_item = str_replace([$enclosure, $escape], ["{$escape}{$enclosure}", "{$escape}{$escape}"], $item); - return ($has_delimiter || ($item == $escaped_item)) ? $item : "{$escape}{$escaped_item}{$escape}"; - }, $data)); - } - /** * Generate the autoload file at the project root. Include the * autoload file that Composer generated. @@ -276,7 +248,6 @@ protected function getPackage($name) { protected function getExcludes() { return $this->getNamedOptionList('excludes', 'getExcludesDefault'); } - /** * Retrieve list of additional settings files from optional "extra" configuration. * @@ -315,7 +286,8 @@ protected function getOptions() { 'omit-defaults' => FALSE, 'excludes' => [], 'includes' => [], - 'source' => 'https://ftp.drupal.org/files/projects/drupal-{version}.tar.gz', + 'source' => 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version}', + // Github: https://raw.githubusercontent.com/drupal/drupal/{version}/{path} ]; return $options; } @@ -324,23 +296,7 @@ protected function getOptions() { * Holds default excludes. */ protected function getExcludesDefault() { - return [ - '.gitkeep', - 'autoload.php', - 'composer.json', - 'composer.lock', - 'core', - 'drush', - 'example.gitignore', - 'LICENSE.txt', - 'README.txt', - 'vendor', - 'themes', - 'profiles', - 'modules', - 'sites/*', - 'sites/default/*' - ]; + return []; } /** @@ -348,13 +304,21 @@ protected function getExcludesDefault() { */ protected function getIncludesDefault() { return [ - 'sites', - 'sites/default', + '.csslintrc', + '.editorconfig', + '.eslintignore', + '.eslintrc', + '.gitattributes', + '.htaccess', + 'robots.txt', 'sites/default/default.settings.php', 'sites/default/default.services.yml', 'sites/development.services.yml', 'sites/example.settings.local.php', - 'sites/example.sites.php' + 'sites/example.sites.php', + 'update.php', + 'web.config' ]; } + } diff --git a/src/RoboFile.php b/src/RoboFile.php deleted file mode 100644 index 63acdaa..0000000 --- a/src/RoboFile.php +++ /dev/null @@ -1,132 +0,0 @@ - 'https://ftp.drupal.org/files/projects/drupal-{version}.tar.gz', - 'webroot' => 'web', - 'excludes' => '', - 'includes' => '', - )) { - - $source = str_replace('{version}', $version, $options['source']); - $webroot = $options['webroot']; - $confDir = $webroot . '/sites/default'; - $excludes = array_filter(str_getcsv($options['excludes'])); - $includes = array_filter(str_getcsv($options['includes'])); - $tmpDir = $this->getTmpDir(); - $archiveName = basename($source); - $archivePath = "$tmpDir/$archiveName"; - $fetchDirName = $this->getFetchDirName(); - - $this->stopOnFail(); - - $fs = $this->taskFilesystemStack() - ->mkdir($tmpDir); - - if (file_exists($confDir)) { - $confDirOriginalPerms = fileperms($confDir); - } - else { - $confDirOriginalPerms = 0755; - $fs->mkdir($confDir); - } - - $fs->chmod($confDir, 0755) - ->run(); - - // Make sure we have an empty temp dir. - $this->taskCleanDir([$tmpDir]) - ->run(); - - // Downloads the source and extract - $this->downloadFile($source, $archivePath); - $extract = $this->taskExtract($archivePath)->to("$tmpDir/$fetchDirName")->run(); - - // Place scaffold files where they belong in the destination - $this->taskRsync() - ->fromPath("$tmpDir/$fetchDirName/") - ->toPath($webroot) - ->args('-a', '-v', '-z', '--no-group', '--no-owner') - ->includeFilter($includes) - ->exclude($excludes) - ->run(); - - // Clean up - $this->taskDeleteDir($tmpDir) - ->run(); - if ($confDirOriginalPerms) { - $this->taskFilesystemStack() - ->chmod($confDir, $confDirOriginalPerms) - ->run(); - } - } - - /** - * Download file from a source to a target. - * - * @param string $source - * @param string $target - */ - protected function downloadFile($source, $target) { - $this->say("Attempt to download $source to $target"); - $fp = fopen($target, 'w+'); - if (!$fp) { - $this->yell('Could not open target file ' . $target); - return false; - } - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $source); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 100); - curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($ch, CURLOPT_FILE, $fp); - $result = curl_exec($ch); - fclose($fp); - $details = curl_getinfo($ch); - curl_close($ch); - - if (!array_key_exists('http_code', $details) || ($details['http_code'] != '200')) { - $this->yell('Could not download ' . $source); - return false; - } - return true; - } - -} diff --git a/src/RoboRunner.php b/src/RoboRunner.php deleted file mode 100644 index ce925a3..0000000 --- a/src/RoboRunner.php +++ /dev/null @@ -1,24 +0,0 @@ -roboClass = '\DrupalComposer\DrupalScaffold\RoboFile'; - return true; - } - -} diff --git a/tests/FetcherTest.php b/tests/FetcherTest.php new file mode 100644 index 0000000..dfd5fee --- /dev/null +++ b/tests/FetcherTest.php @@ -0,0 +1,67 @@ +rootDir = realpath(realpath(__DIR__ . '/..')); + + // Prepare temp directory. + $this->fs = new Filesystem(); + $this->tmpDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'drupal-scaffold'; + $this->ensureDirectoryExistsAndClear($this->tmpDir); + + chdir($this->tmpDir); + } + + /** + * Makes sure the given directory exists and has no content. + * + * @param string $directory + */ + protected function ensureDirectoryExistsAndClear($directory) { + if (is_dir($directory)) { + $this->fs->removeDirectory($directory); + } + mkdir($directory, 0777, true); + } + + public function testFetch() { + $fetcher = new FileFetcher(new Client(), 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version}', ['.htaccess', 'sites/default/default.settings.php']); + $fetcher->fetch('8.1.1', $this->tmpDir); + } + +}