Created
June 2, 2018 04:25
-
-
Save ilovezfs/2095a51cd8a552840aaed34bd0a074e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 95742ee77e150cf59d3cd0b712d64f0ac583618c Mon Sep 17 00:00:00 2001 | |
From: ilovezfs <[email protected]> | |
Date: Fri, 1 Jun 2018 21:24:27 -0700 | |
Subject: [PATCH] May 31 | |
--- | |
COMPOSER_VERSIONS | 48 +++--- | |
php/WP_CLI/Formatter.php | 1 + | |
php/WP_CLI/Runner.php | 10 +- | |
php/commands/src/CLI_Command.php | 3 +- | |
php/config-spec.php | 8 +- | |
php/utils.php | 34 +++- | |
vendor/autoload.php | 2 +- | |
vendor/autoload_commands.php | 2 +- | |
vendor/autoload_framework.php | 2 +- | |
vendor/composer/autoload_commands_real.php | 6 +- | |
vendor/composer/autoload_framework_classmap.php | 1 + | |
vendor/composer/autoload_framework_real.php | 6 +- | |
vendor/composer/autoload_real.php | 14 +- | |
vendor/composer/autoload_static.php | 12 +- | |
vendor/composer/composer/res/composer-schema.json | 21 ++- | |
.../src/Composer/Autoload/AutoloadGenerator.php | 4 +- | |
.../composer/src/Composer/Autoload/ClassLoader.php | 4 +- | |
.../Composer/Command/CheckPlatformReqsCommand.php | 149 +++++++++++++++++ | |
.../src/Composer/Command/ConfigCommand.php | 3 + | |
.../src/Composer/Command/CreateProjectCommand.php | 32 ++-- | |
.../src/Composer/Command/DiagnoseCommand.php | 8 + | |
.../src/Composer/Command/DumpAutoloadCommand.php | 4 +- | |
.../composer/src/Composer/Command/HomeCommand.php | 10 +- | |
.../composer/src/Composer/Command/InitCommand.php | 113 +++++++++++-- | |
.../src/Composer/Command/RemoveCommand.php | 2 +- | |
.../src/Composer/Command/RequireCommand.php | 11 +- | |
.../src/Composer/Command/RunScriptCommand.php | 21 ++- | |
.../src/Composer/Command/ScriptAliasCommand.php | 6 +- | |
.../src/Composer/Command/SelfUpdateCommand.php | 14 +- | |
.../composer/src/Composer/Command/ShowCommand.php | 41 +++-- | |
.../src/Composer/Command/SuggestsCommand.php | 2 +- | |
.../src/Composer/Command/UpdateCommand.php | 9 +- | |
.../src/Composer/Command/ValidateCommand.php | 4 +- | |
vendor/composer/composer/src/Composer/Compiler.php | 2 +- | |
vendor/composer/composer/src/Composer/Composer.php | 4 +- | |
.../composer/src/Composer/Console/Application.php | 9 +- | |
.../src/Composer/DependencyResolver/Problem.php | 16 +- | |
.../DependencyResolver/RuleSetGenerator.php | 2 +- | |
.../DependencyResolver/RuleSetIterator.php | 6 +- | |
.../Composer/DependencyResolver/RuleWatchNode.php | 4 +- | |
.../Composer/DependencyResolver/Transaction.php | 6 +- | |
.../src/Composer/Downloader/ArchiveDownloader.php | 26 --- | |
.../src/Composer/Downloader/DownloadManager.php | 4 +- | |
.../src/Composer/Downloader/FileDownloader.php | 5 + | |
.../src/Composer/Downloader/GitDownloader.php | 33 ++-- | |
.../src/Composer/Downloader/PerforceDownloader.php | 4 +- | |
.../src/Composer/Downloader/SvnDownloader.php | 43 ++++- | |
vendor/composer/composer/src/Composer/Factory.php | 6 +- | |
.../composer/src/Composer/IO/ConsoleIO.php | 23 ++- | |
.../composer/composer/src/Composer/Installer.php | 52 ++++-- | |
.../src/Composer/Installer/BinaryInstaller.php | 19 +-- | |
.../composer/src/Composer/Json/JsonFile.php | 4 +- | |
.../composer/src/Composer/Json/JsonManipulator.php | 2 +- | |
.../Composer/Package/Archiver/HgExcludeFilter.php | 4 +- | |
.../src/Composer/Package/Loader/ArrayLoader.php | 7 +- | |
.../Package/Loader/ValidatingArrayLoader.php | 75 ++++++++- | |
.../composer/src/Composer/Package/Locker.php | 2 +- | |
.../Composer/Package/Version/VersionGuesser.php | 5 +- | |
.../src/Composer/Package/Version/VersionParser.php | 2 +- | |
.../Composer/Plugin/Capability/CommandProvider.php | 2 +- | |
.../src/Composer/Repository/BaseRepository.php | 2 +- | |
.../src/Composer/Repository/ComposerRepository.php | 2 +- | |
.../Composer/Repository/FilesystemRepository.php | 4 + | |
.../Repository/Pear/ChannelRest10Reader.php | 3 +- | |
.../src/Composer/Repository/PlatformRepository.php | 2 +- | |
.../src/Composer/Repository/RepositoryFactory.php | 2 + | |
.../src/Composer/Repository/Vcs/FossilDriver.php | 93 +++++++---- | |
.../src/Composer/Repository/Vcs/GitDriver.php | 5 +- | |
.../src/Composer/Repository/Vcs/GitHubDriver.php | 8 +- | |
.../src/Composer/Repository/Vcs/GitLabDriver.php | 2 +- | |
.../src/Composer/Repository/Vcs/PerforceDriver.php | 8 +- | |
.../composer/src/Composer/Util/ConfigValidator.php | 27 +-- | |
.../composer/src/Composer/Util/Filesystem.php | 24 ++- | |
vendor/composer/composer/src/Composer/Util/Git.php | 15 ++ | |
.../composer/src/Composer/Util/Perforce.php | 60 +++---- | |
.../composer/src/Composer/Util/ProcessExecutor.php | 58 ++++++- | |
.../src/Composer/Util/RemoteFilesystem.php | 35 +--- | |
.../composer/src/Composer/Util/Silencer.php | 2 +- | |
.../src/Composer/Util/StreamContextFactory.php | 6 +- | |
vendor/composer/composer/src/Composer/Util/Svn.php | 36 +++- | |
vendor/composer/composer/src/Composer/Util/Url.php | 56 +++++++ | |
.../composer/src/Composer/XdebugHandler.php | 2 +- | |
vendor/composer/spdx-licenses/src/SpdxLicenses.php | 104 ++++++++---- | |
.../spdx-licenses/src/SpdxLicensesUpdater.php | 51 ++---- | |
.../src/JsonSchema/Constraints/Constraint.php | 3 - | |
.../src/JsonSchema/Constraints/Factory.php | 2 - | |
.../JsonSchema/Constraints/SchemaConstraint.php | 1 - | |
.../JsonSchema/Constraints/UndefinedConstraint.php | 2 + | |
.../json-schema/src/JsonSchema/Validator.php | 2 - | |
vendor/symfony/console/Application.php | 13 +- | |
vendor/symfony/console/Command/Command.php | 4 +- | |
.../console/Descriptor/DescriptorInterface.php | 2 +- | |
vendor/symfony/console/Helper/DialogHelper.php | 2 +- | |
vendor/symfony/console/Helper/HelperSet.php | 6 +- | |
vendor/symfony/console/Helper/ProgressBar.php | 4 +- | |
vendor/symfony/console/Helper/ProgressHelper.php | 2 +- | |
vendor/symfony/console/Helper/QuestionHelper.php | 6 + | |
vendor/symfony/console/Helper/Table.php | 6 +- | |
vendor/symfony/console/Helper/TableHelper.php | 2 +- | |
vendor/symfony/console/Input/ArgvInput.php | 27 ++- | |
vendor/symfony/console/Input/ArrayInput.php | 2 +- | |
vendor/symfony/console/Input/InputDefinition.php | 4 +- | |
vendor/symfony/console/Input/InputInterface.php | 6 +- | |
vendor/symfony/console/Input/StringInput.php | 2 +- | |
vendor/symfony/console/Output/StreamOutput.php | 14 +- | |
vendor/symfony/console/Style/StyleInterface.php | 6 +- | |
vendor/symfony/console/Style/SymfonyStyle.php | 2 +- | |
vendor/symfony/filesystem/Filesystem.php | 13 +- | |
vendor/symfony/finder/Adapter/AbstractAdapter.php | 2 +- | |
.../symfony/finder/Adapter/AbstractFindAdapter.php | 2 +- | |
vendor/symfony/finder/Adapter/BsdFindAdapter.php | 2 +- | |
vendor/symfony/finder/Adapter/GnuFindAdapter.php | 2 +- | |
vendor/symfony/finder/Adapter/PhpAdapter.php | 2 +- | |
.../finder/Exception/AdapterFailureException.php | 2 +- | |
.../Exception/OperationNotPermitedException.php | 2 +- | |
.../Exception/ShellCommandFailureException.php | 2 +- | |
vendor/symfony/finder/Expression/Expression.php | 2 +- | |
vendor/symfony/finder/Expression/Glob.php | 2 +- | |
vendor/symfony/finder/Expression/Regex.php | 2 +- | |
.../symfony/finder/Expression/ValueInterface.php | 2 +- | |
vendor/symfony/finder/Finder.php | 34 +++- | |
.../symfony/finder/Iterator/FilePathsIterator.php | 2 +- | |
vendor/symfony/finder/Shell/Command.php | 2 +- | |
vendor/symfony/finder/Shell/Shell.php | 2 +- | |
vendor/symfony/polyfill-mbstring/Mbstring.php | 143 +++++++++++++++- | |
vendor/symfony/polyfill-mbstring/bootstrap.php | 2 + | |
vendor/symfony/process/PhpExecutableFinder.php | 6 +- | |
vendor/symfony/process/Pipes/AbstractPipes.php | 2 +- | |
vendor/symfony/process/Pipes/UnixPipes.php | 2 +- | |
vendor/symfony/process/Process.php | 6 +- | |
vendor/symfony/process/ProcessUtils.php | 2 +- | |
.../checksum-command/src/Checksum_Base_Command.php | 13 +- | |
.../src/Checksum_Plugin_Command.php | 3 +- | |
.../extension-command/src/Plugin_Command.php | 23 ++- | |
.../wp-cli/package-command/src/Package_Command.php | 18 +- | |
vendor/wp-cli/php-cli-tools/lib/cli/Streams.php | 2 +- | |
.../wp-cli/php-cli-tools/lib/cli/progress/Bar.php | 18 +- | |
.../role-command/src/Capabilities_Command.php | 71 ++------ | |
vendor/wp-cli/role-command/src/Role_Command.php | 3 - | |
.../scaffold-command/src/Scaffold_Command.php | 11 +- | |
.../templates/block-block-js.mustache | 84 ++++++++++ | |
.../scaffold-command/templates/block-php.mustache | 26 +-- | |
.../scaffold-command/templates/install-wp-tests.sh | 2 +- | |
.../scaffold-command/templates/phpunit.xml.dist | 1 - | |
.../templates/plugin-circle.mustache | 181 +++++---------------- | |
.../templates/plugin-distignore.mustache | 3 +- | |
.../templates/plugin-gitlab.mustache | 8 - | |
.../templates/plugin-readme.mustache | 2 +- | |
.../templates/plugin-test-sample.mustache | 2 +- | |
.../templates/plugin-travis.mustache | 2 - | |
.../templates/theme-bootstrap.mustache | 9 +- | |
.../templates/theme-test-sample.mustache | 2 +- | |
.../src/Search_Replace_Command.php | 3 + | |
.../src/WP_CLI/SearchReplacer.php | 53 +----- | |
154 files changed, 1548 insertions(+), 933 deletions(-) | |
create mode 100644 vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php | |
create mode 100644 vendor/composer/composer/src/Composer/Util/Url.php | |
create mode 100644 vendor/wp-cli/scaffold-command/templates/block-block-js.mustache | |
diff --git a/COMPOSER_VERSIONS b/COMPOSER_VERSIONS | |
index ae48e79..484280d 100644 | |
--- a/COMPOSER_VERSIONS | |
+++ b/COMPOSER_VERSIONS | |
@@ -1,31 +1,31 @@ | |
-wp-cli/wp-cli 1.5.1 2018-04-21T09:34:42+00:00 | |
-composer/ca-bundle 1.1.0 943b2c4fcad1ef178d16a713c2468bf7e579c288 | |
-composer/composer 1.5.6 4f7f9c12753ec43f1e4629e2a71cabe81f2a4eab | |
+wp-cli/wp-cli 1.5.1 2018-05-31T14:27:15+00:00 | |
+composer/ca-bundle 1.1.1 d2c0a83b7533d6912e8d516756ebd34f893e9169 | |
+composer/composer 1.6.3 88a69fda0f2187ad8714cedffd7a8872dceaa4c2 | |
composer/semver 1.4.2 c7cb9a2095a074d131b65a8a0cd294479d785573 | |
-composer/spdx-licenses 1.1.6 2603a0d7ddc00a015deb576fa5297ca43dee6b1c | |
-justinrainbow/json-schema 5.2.6 d283e11b6e14c6f4664cf080415c4341293e5bbd | |
+composer/spdx-licenses 1.3.0 7e111c50db92fa2ced140f5ba23b4e261bc77a30 | |
+justinrainbow/json-schema 5.2.7 8560d4314577199ba51bf2032f02cd1315587c23 | |
mustache/mustache v2.12.0 fe8fe72e9d580591854de404cc59a1b83ca4d19e | |
nb/oxymel v0.1.0 cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c | |
psr/log 1.0.2 4ebe3a8bf773a19edfe0a84b6585ba3d401b724d | |
ramsey/array_column 1.1.3 f8e52eb28e67eb50e613b451dd916abcf783c1db | |
rmccue/requests v1.7.0 87932f52ffad70504d93f04f15690cf16a089546 | |
seld/cli-prompt 1.0.3 a19a7376a4689d4d94cab66ab4f3c816019ba8dd | |
-seld/jsonlint 1.6.2 7a30649c67ee0d19faacfd9fa2cfb6cc032d9b19 | |
+seld/jsonlint 1.7.1 d15f59a67ff805a44c50ea0516d2341740f81a38 | |
seld/phar-utils 1.0.1 7009b5139491975ef6486545a39f3e6dad5ac30a | |
-symfony/config v2.8.32 f4f3f1d7090c464434bbbc3e8aa2b41149c59196 | |
-symfony/console v2.8.32 46270f1ca44f08ebc134ce120fd2c2baf5fd63de | |
-symfony/debug v2.8.32 e72a0340dc2e273b3c4398d8eef9157ba51d8b95 | |
-symfony/dependency-injection v2.8.32 d3e81e5402c38500770eb5595d78a6d85ea9e412 | |
-symfony/event-dispatcher v2.8.32 b59aacf238fadda50d612c9de73b74751872a903 | |
-symfony/filesystem v2.8.32 15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b | |
-symfony/finder v2.8.32 efeceae6a05a9b2fcb3391333f1d4a828ff44ab8 | |
-symfony/polyfill-mbstring v1.6.0 2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296 | |
-symfony/process v2.8.32 d25449e031f600807949aab7cadbf267712f4eee | |
-symfony/translation v2.8.32 0c63d56516c4c4c323228ca6348eadb7c91b1daf | |
-symfony/yaml v2.8.32 968ef42161e4bc04200119da473077f9e7015128 | |
+symfony/config v2.8.38 ecacddeaf76732231eea1657f6f5b062dade94c9 | |
+symfony/console v2.8.38 7f78892d900c72a40acd1fe793c856ef0c110f26 | |
+symfony/debug v2.8.38 4486d2be5e068b51fece4c8551c14e709f573c8d | |
+symfony/dependency-injection v2.8.38 3d7cbf34cd75ede7f94b9b990f85bd089e15cd55 | |
+symfony/event-dispatcher v2.8.38 9b69aad7d4c086dc94ebade2d5eb9145da5dac8c | |
+symfony/filesystem v2.8.38 125403a59e4cb4e3ebf46d0162fabcde613d2b97 | |
+symfony/finder v2.8.38 423746fc18ccf31f9abec43e4f078bb6e024b2d5 | |
+symfony/polyfill-mbstring v1.7.0 78be803ce01e55d3491c1397cf1c64beb9c1b63b | |
+symfony/process v2.8.38 ee2c91470ff262b1a00aec27875d38594aa87629 | |
+symfony/translation v2.8.38 72235c1121ae282254e897e342c001f3d4bb7e8d | |
+symfony/yaml v2.8.38 be720fcfae4614df204190d57795351059946a77 | |
wp-cli/autoload-splitter v0.1.5 fb4302da26390811d2631c62b42b75976d224bb8 | |
wp-cli/cache-command v1.0.6 d82cba9effa198f17847dce5771c8fb20c443ffa | |
-wp-cli/checksum-command v1.0.9 89a319440651f2867f282339c2223cfe5e9cc3fb | |
+wp-cli/checksum-command v1.0.8 360c0c658242919e9a74ba06917fd8a691484174 | |
wp-cli/config-command v1.1.8 4e44b3fab9e1ddb8f91e3189b27354ff4ae141ad | |
wp-cli/core-command v1.0.9 0e825668d2c060c40ec1d7debbee94bc08eec9b3 | |
wp-cli/cron-command v1.0.5 9da7e36e8f9c14cb171a3c5204cba2865e0ed7ef | |
@@ -34,17 +34,17 @@ wp-cli/embed-command v1.0.0 81319d4243a8dfe096389bf54cdc4fc3dec53497 | |
wp-cli/entity-command v1.2.0 035b74ea16912f5b14db7d28036a6d123eb90547 | |
wp-cli/eval-command v1.0.5 9640d40ab28cd86590396f08f8c382e659f57321 | |
wp-cli/export-command v1.0.6 4ae43d370ed6ed0cffd166dd84cfc6c8c2f3f633 | |
-wp-cli/extension-command v1.1.9 dfacef02b88baed07058c88064afd582f4150a97 | |
+wp-cli/extension-command v1.1.10 3fd9ff469311bb2d6935997bc7d7e9f157fe29e6 | |
wp-cli/import-command v1.0.6 d2c21d590a1bfae6ac4e289a0b57fb1870b5990c | |
wp-cli/language-command v1.0.6 2a3d1ce5a722a4d70809619a065087aa933f6209 | |
wp-cli/media-command v1.1.4 7f8664ba722505446b3ef3dbc6717e8e7f20265c | |
wp-cli/mustangostang-spyc 0.6.3 6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7 | |
-wp-cli/package-command v1.0.13 c912f5bbad216997d7496d46fc5c05af0e16fc5b | |
-wp-cli/php-cli-tools v0.11.9 766653b45f99c817edb2b05dc23f7ee9a893768d | |
+wp-cli/package-command v1.0.12 bb8b02d9ba1cded95564767000738ceaefbc885b | |
+wp-cli/php-cli-tools v0.11.8 363c75349f5dde561e0b416dd00f7aaa76fa2c27 | |
wp-cli/rewrite-command v1.0.5 6b1695887e289ffad14c8f4ea86b5f1d92757408 | |
-wp-cli/role-command v1.1.0 f50134ea9c27c108b1069cf044f7395c8f9bf716 | |
-wp-cli/scaffold-command v1.1.3 659348f05ebb47e70d7286b2e989146893a3c588 | |
-wp-cli/search-replace-command v1.3.0 df1092f65a5953dddace5fc060a9155f430a560e | |
+wp-cli/role-command v1.0.5 be7f8ea91922864d0c75e45953fbe41d44bebb25 | |
+wp-cli/scaffold-command v1.1.2 a7ef51b2abd88a2ecb17ecdf7aaad92da37d1eb7 | |
+wp-cli/search-replace-command v1.2.0 c688e51b35bb87b26a3de308287d6a30cda78e44 | |
wp-cli/server-command v1.0.9 6192e6d7becd07e4c11a8f1560655c73a3b3526a | |
wp-cli/shell-command v1.0.5 507603a8994d984b6c4d5bd26e31ede6d9cce37e | |
wp-cli/super-admin-command v1.0.6 2982d2e6514dbb318561d72d0577746a3a37181e | |
diff --git a/php/WP_CLI/Formatter.php b/php/WP_CLI/Formatter.php | |
index 21707b1..3f75ea5 100644 | |
--- a/php/WP_CLI/Formatter.php | |
+++ b/php/WP_CLI/Formatter.php | |
@@ -156,6 +156,7 @@ class Formatter { | |
if ( 'json' === $this->args['format'] ) { | |
if ( defined( 'JSON_PARTIAL_OUTPUT_ON_ERROR' ) ) { | |
+ // @codingStandardsIgnoreLine | |
echo json_encode( $out, JSON_PARTIAL_OUTPUT_ON_ERROR ); | |
} else { | |
echo json_encode( $out ); | |
diff --git a/php/WP_CLI/Runner.php b/php/WP_CLI/Runner.php | |
index a9618fd..f2c5ec5 100644 | |
--- a/php/WP_CLI/Runner.php | |
+++ b/php/WP_CLI/Runner.php | |
@@ -232,7 +232,14 @@ class Runner { | |
* @param string $path | |
*/ | |
private static function set_wp_root( $path ) { | |
- define( 'ABSPATH', Utils\trailingslashit( $path ) ); | |
+ if ( ! defined( 'ABSPATH' ) ) { | |
+ define( 'ABSPATH', Utils\normalize_path( Utils\trailingslashit( $path ) ) ); | |
+ } elseif ( ! is_null( $path ) ) { | |
+ WP_CLI::error_multi_line( array( | |
+ 'The --path parameter cannot be used when ABSPATH is already defined elsewhere', | |
+ 'ABSPATH is defined as: "' . ABSPATH . '"', | |
+ ) ); | |
+ } | |
WP_CLI::debug( 'ABSPATH defined: ' . ABSPATH, 'bootstrap' ); | |
$_SERVER['DOCUMENT_ROOT'] = realpath( $path ); | |
@@ -1140,6 +1147,7 @@ class Runner { | |
if ( array_key_exists( $key, $wp_cli_original_defined_vars ) || 'wp_cli_original_defined_vars' === $key ) { | |
continue; | |
} | |
+ // @codingStandardsIgnoreLine | |
global ${$key}; | |
${$key} = $var; | |
} | |
diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php | |
index fa2474f..d87cacf 100644 | |
--- a/php/commands/src/CLI_Command.php | |
+++ b/php/commands/src/CLI_Command.php | |
@@ -322,7 +322,7 @@ class CLI_Command extends WP_CLI_Command { | |
$php_binary = Utils\get_php_binary(); | |
$process = WP_CLI\Process::create( "{$php_binary} $temp --info {$allow_root}" ); | |
$result = $process->run(); | |
- if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'WP-CLI version:' ) ) { | |
+ if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'WP-CLI version' ) ) { | |
$multi_line = explode( PHP_EOL, $result->stderr ); | |
WP_CLI::error_multi_line( $multi_line ); | |
WP_CLI::error( 'The downloaded PHAR is broken, try running wp cli update again.' ); | |
@@ -551,6 +551,7 @@ class CLI_Command extends WP_CLI_Command { | |
* options: | |
* - yaml | |
* - json | |
+ * - var_export | |
* --- | |
* | |
* ## EXAMPLES | |
diff --git a/php/config-spec.php b/php/config-spec.php | |
index c61d512..5fff398 100644 | |
--- a/php/config-spec.php | |
+++ b/php/config-spec.php | |
@@ -37,16 +37,16 @@ return array( | |
), | |
'skip-plugins' => array( | |
- 'runtime' => '[=<plugin>]', | |
+ 'runtime' => '[=<plugins>]', | |
'file' => '<list>', | |
- 'desc' => 'Skip loading all or some plugins. Note: mu-plugins are still loaded.', | |
+ 'desc' => 'Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded.', | |
'default' => '', | |
), | |
'skip-themes' => array( | |
- 'runtime' => '[=<theme>]', | |
+ 'runtime' => '[=<themes>]', | |
'file' => '<list>', | |
- 'desc' => 'Skip loading all or some themes.', | |
+ 'desc' => 'Skip loading all themes, or a comma-separated list of themes.', | |
'default' => '', | |
), | |
diff --git a/php/utils.php b/php/utils.php | |
index fb61c1c..8033dcb 100644 | |
--- a/php/utils.php | |
+++ b/php/utils.php | |
@@ -351,19 +351,21 @@ function pick_fields( $item, $fields ) { | |
* @category Input | |
* | |
* @param string $content Some form of text to edit (e.g. post content) | |
+ * @param string $title Title to display in the editor. | |
+ * @param string $ext Extension to use with the temp file. | |
* @return string|bool Edited text, if file is saved from editor; false, if no change to file. | |
*/ | |
-function launch_editor_for_input( $input, $filename = 'WP-CLI' ) { | |
+function launch_editor_for_input( $input, $title = 'WP-CLI', $ext = 'tmp' ) { | |
check_proc_available( 'launch_editor_for_input' ); | |
$tmpdir = get_temp_dir(); | |
do { | |
- $tmpfile = basename( $filename ); | |
+ $tmpfile = basename( $title ); | |
$tmpfile = preg_replace( '|\.[^.]*$|', '', $tmpfile ); | |
$tmpfile .= '-' . substr( md5( mt_rand() ), 0, 6 ); | |
- $tmpfile = $tmpdir . $tmpfile . '.tmp'; | |
+ $tmpfile = $tmpdir . $tmpfile . '.' . $ext; | |
$fp = fopen( $tmpfile, 'xb' ); | |
if ( ! $fp && is_writable( $tmpdir ) && file_exists( $tmpfile ) ) { | |
$tmpfile = ''; | |
@@ -773,6 +775,31 @@ function trailingslashit( $string ) { | |
} | |
/** | |
+ * Normalize a filesystem path. | |
+ * | |
+ * On Windows systems, replaces backslashes with forward slashes | |
+ * and forces upper-case drive letters. | |
+ * Allows for two leading slashes for Windows network shares, but | |
+ * ensures that all other duplicate slashes are reduced to a single one. | |
+ * Ensures upper-case drive letters on Windows systems. | |
+ * | |
+ * @access public | |
+ * @category System | |
+ * | |
+ * @param string $path Path to normalize. | |
+ * @return string Normalized path. | |
+ */ | |
+function normalize_path( $path ) { | |
+ $path = str_replace( '\\', '/', $path ); | |
+ $path = preg_replace( '|(?<=.)/+|', '/', $path ); | |
+ if ( ':' === substr( $path, 1, 1 ) ) { | |
+ $path = ucfirst( $path ); | |
+ } | |
+ return $path; | |
+} | |
+ | |
+ | |
+/** | |
* Convert Windows EOLs to *nix. | |
* | |
* @param string $str String to convert. | |
@@ -1307,6 +1334,7 @@ function get_php_binary() { | |
// Available since PHP 5.4. | |
if ( defined( 'PHP_BINARY' ) ) { | |
+ // @codingStandardsIgnoreLine | |
return PHP_BINARY; | |
} | |
diff --git a/vendor/autoload.php b/vendor/autoload.php | |
index c12ee93..5fe7270 100644 | |
--- a/vendor/autoload.php | |
+++ b/vendor/autoload.php | |
@@ -4,4 +4,4 @@ | |
require_once __DIR__ . '/composer/autoload_real.php'; | |
-return ComposerAutoloaderInitb26282a574ea038c99ab75df583011a9::getLoader(); | |
+return ComposerAutoloaderInitcf31443ea930acdd6515f11ee824c708::getLoader(); | |
diff --git a/vendor/autoload_commands.php b/vendor/autoload_commands.php | |
index a52aef2..236c781 100644 | |
--- a/vendor/autoload_commands.php | |
+++ b/vendor/autoload_commands.php | |
@@ -4,4 +4,4 @@ | |
require_once __DIR__ . '/composer/autoload_commands_real.php'; | |
-return ComposerAutoloaderInit2fbe4b5c10d36e618ad74df5c0fc038c::getLoader(); | |
+return ComposerAutoloaderInit70cde365ee7ad380050872f30404ab90::getLoader(); | |
diff --git a/vendor/autoload_framework.php b/vendor/autoload_framework.php | |
index 5a0f364..9d2f333 100644 | |
--- a/vendor/autoload_framework.php | |
+++ b/vendor/autoload_framework.php | |
@@ -4,4 +4,4 @@ | |
require_once __DIR__ . '/composer/autoload_framework_real.php'; | |
-return ComposerAutoloaderInite075eb8226b4087d2cda24194de4425d::getLoader(); | |
+return ComposerAutoloaderInitef6daf65ad869a782fbfc4450f294c09::getLoader(); | |
diff --git a/vendor/composer/autoload_commands_real.php b/vendor/composer/autoload_commands_real.php | |
index d55d53f..b4d6720 100644 | |
--- a/vendor/composer/autoload_commands_real.php | |
+++ b/vendor/composer/autoload_commands_real.php | |
@@ -2,7 +2,7 @@ | |
// autoload_commands_real.php @generated by Composer | |
-class ComposerAutoloaderInit2fbe4b5c10d36e618ad74df5c0fc038c | |
+class ComposerAutoloaderInit70cde365ee7ad380050872f30404ab90 | |
{ | |
private static $loader; | |
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit2fbe4b5c10d36e618ad74df5c0fc038c | |
return self::$loader; | |
} | |
- spl_autoload_register(array('ComposerAutoloaderInit2fbe4b5c10d36e618ad74df5c0fc038c', 'loadClassLoader'), true, true); | |
+ spl_autoload_register(array('ComposerAutoloaderInit70cde365ee7ad380050872f30404ab90', 'loadClassLoader'), true, true); | |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); | |
- spl_autoload_unregister(array('ComposerAutoloaderInit2fbe4b5c10d36e618ad74df5c0fc038c', 'loadClassLoader')); | |
+ spl_autoload_unregister(array('ComposerAutoloaderInit70cde365ee7ad380050872f30404ab90', 'loadClassLoader')); | |
$classMap = require __DIR__ . '/autoload_commands_classmap.php'; | |
if ($classMap) { | |
diff --git a/vendor/composer/autoload_framework_classmap.php b/vendor/composer/autoload_framework_classmap.php | |
index df8da14..62018c3 100644 | |
--- a/vendor/composer/autoload_framework_classmap.php | |
+++ b/vendor/composer/autoload_framework_classmap.php | |
@@ -202,6 +202,7 @@ return array( | |
'Composer\\Util\\StreamContextFactory' => $vendorDir . '/composer/composer/src/Composer/Util/StreamContextFactory.php', | |
'Composer\\Util\\Svn' => $vendorDir . '/composer/composer/src/Composer/Util/Svn.php', | |
'Composer\\Util\\TlsHelper' => $vendorDir . '/composer/composer/src/Composer/Util/TlsHelper.php', | |
+ 'Composer\\Util\\Url' => $vendorDir . '/composer/composer/src/Composer/Util/Url.php', | |
'Composer\\XdebugHandler' => $vendorDir . '/composer/composer/src/Composer/XdebugHandler.php', | |
'JsonSchema\\Constraints\\BaseConstraint' => $vendorDir . '/justinrainbow/json-schema/src/JsonSchema/Constraints/BaseConstraint.php', | |
'JsonSchema\\Constraints\\CollectionConstraint' => $vendorDir . '/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php', | |
diff --git a/vendor/composer/autoload_framework_real.php b/vendor/composer/autoload_framework_real.php | |
index f6b69b7..b3c3465 100644 | |
--- a/vendor/composer/autoload_framework_real.php | |
+++ b/vendor/composer/autoload_framework_real.php | |
@@ -2,7 +2,7 @@ | |
// autoload_framework_real.php @generated by Composer | |
-class ComposerAutoloaderInite075eb8226b4087d2cda24194de4425d | |
+class ComposerAutoloaderInitef6daf65ad869a782fbfc4450f294c09 | |
{ | |
private static $loader; | |
@@ -19,9 +19,9 @@ class ComposerAutoloaderInite075eb8226b4087d2cda24194de4425d | |
return self::$loader; | |
} | |
- spl_autoload_register(array('ComposerAutoloaderInite075eb8226b4087d2cda24194de4425d', 'loadClassLoader'), true, true); | |
+ spl_autoload_register(array('ComposerAutoloaderInitef6daf65ad869a782fbfc4450f294c09', 'loadClassLoader'), true, true); | |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); | |
- spl_autoload_unregister(array('ComposerAutoloaderInite075eb8226b4087d2cda24194de4425d', 'loadClassLoader')); | |
+ spl_autoload_unregister(array('ComposerAutoloaderInitef6daf65ad869a782fbfc4450f294c09', 'loadClassLoader')); | |
$classMap = require __DIR__ . '/autoload_framework_classmap.php'; | |
if ($classMap) { | |
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php | |
index 90f1d14..bf6049d 100644 | |
--- a/vendor/composer/autoload_real.php | |
+++ b/vendor/composer/autoload_real.php | |
@@ -2,7 +2,7 @@ | |
// autoload_real.php @generated by Composer | |
-class ComposerAutoloaderInitb26282a574ea038c99ab75df583011a9 | |
+class ComposerAutoloaderInitcf31443ea930acdd6515f11ee824c708 | |
{ | |
private static $loader; | |
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitb26282a574ea038c99ab75df583011a9 | |
return self::$loader; | |
} | |
- spl_autoload_register(array('ComposerAutoloaderInitb26282a574ea038c99ab75df583011a9', 'loadClassLoader'), true, true); | |
+ spl_autoload_register(array('ComposerAutoloaderInitcf31443ea930acdd6515f11ee824c708', 'loadClassLoader'), true, true); | |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); | |
- spl_autoload_unregister(array('ComposerAutoloaderInitb26282a574ea038c99ab75df583011a9', 'loadClassLoader')); | |
+ spl_autoload_unregister(array('ComposerAutoloaderInitcf31443ea930acdd6515f11ee824c708', 'loadClassLoader')); | |
$includePaths = require __DIR__ . '/include_paths.php'; | |
$includePaths[] = get_include_path(); | |
@@ -31,7 +31,7 @@ class ComposerAutoloaderInitb26282a574ea038c99ab75df583011a9 | |
if ($useStaticLoader) { | |
require_once __DIR__ . '/autoload_static.php'; | |
- call_user_func(\Composer\Autoload\ComposerStaticInitb26282a574ea038c99ab75df583011a9::getInitializer($loader)); | |
+ call_user_func(\Composer\Autoload\ComposerStaticInitcf31443ea930acdd6515f11ee824c708::getInitializer($loader)); | |
} else { | |
$map = require __DIR__ . '/autoload_namespaces.php'; | |
foreach ($map as $namespace => $path) { | |
@@ -52,19 +52,19 @@ class ComposerAutoloaderInitb26282a574ea038c99ab75df583011a9 | |
$loader->register(true); | |
if ($useStaticLoader) { | |
- $includeFiles = Composer\Autoload\ComposerStaticInitb26282a574ea038c99ab75df583011a9::$files; | |
+ $includeFiles = Composer\Autoload\ComposerStaticInitcf31443ea930acdd6515f11ee824c708::$files; | |
} else { | |
$includeFiles = require __DIR__ . '/autoload_files.php'; | |
} | |
foreach ($includeFiles as $fileIdentifier => $file) { | |
- composerRequireb26282a574ea038c99ab75df583011a9($fileIdentifier, $file); | |
+ composerRequirecf31443ea930acdd6515f11ee824c708($fileIdentifier, $file); | |
} | |
return $loader; | |
} | |
} | |
-function composerRequireb26282a574ea038c99ab75df583011a9($fileIdentifier, $file) | |
+function composerRequirecf31443ea930acdd6515f11ee824c708($fileIdentifier, $file) | |
{ | |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { | |
require $file; | |
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php | |
index d22beb7..1288361 100644 | |
--- a/vendor/composer/autoload_static.php | |
+++ b/vendor/composer/autoload_static.php | |
@@ -4,7 +4,7 @@ | |
namespace Composer\Autoload; | |
-class ComposerStaticInitb26282a574ea038c99ab75df583011a9 | |
+class ComposerStaticInitcf31443ea930acdd6515f11ee824c708 | |
{ | |
public static $files = array ( | |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', | |
@@ -253,11 +253,11 @@ class ComposerStaticInitb26282a574ea038c99ab75df583011a9 | |
public static function getInitializer(ClassLoader $loader) | |
{ | |
return \Closure::bind(function () use ($loader) { | |
- $loader->prefixLengthsPsr4 = ComposerStaticInitb26282a574ea038c99ab75df583011a9::$prefixLengthsPsr4; | |
- $loader->prefixDirsPsr4 = ComposerStaticInitb26282a574ea038c99ab75df583011a9::$prefixDirsPsr4; | |
- $loader->fallbackDirsPsr4 = ComposerStaticInitb26282a574ea038c99ab75df583011a9::$fallbackDirsPsr4; | |
- $loader->prefixesPsr0 = ComposerStaticInitb26282a574ea038c99ab75df583011a9::$prefixesPsr0; | |
- $loader->classMap = ComposerStaticInitb26282a574ea038c99ab75df583011a9::$classMap; | |
+ $loader->prefixLengthsPsr4 = ComposerStaticInitcf31443ea930acdd6515f11ee824c708::$prefixLengthsPsr4; | |
+ $loader->prefixDirsPsr4 = ComposerStaticInitcf31443ea930acdd6515f11ee824c708::$prefixDirsPsr4; | |
+ $loader->fallbackDirsPsr4 = ComposerStaticInitcf31443ea930acdd6515f11ee824c708::$fallbackDirsPsr4; | |
+ $loader->prefixesPsr0 = ComposerStaticInitcf31443ea930acdd6515f11ee824c708::$prefixesPsr0; | |
+ $loader->classMap = ComposerStaticInitcf31443ea930acdd6515f11ee824c708::$classMap; | |
}, null, ClassLoader::class); | |
} | |
diff --git a/vendor/composer/composer/res/composer-schema.json b/vendor/composer/composer/res/composer-schema.json | |
index b983482..8c61a62 100644 | |
--- a/vendor/composer/composer/res/composer-schema.json | |
+++ b/vendor/composer/composer/res/composer-schema.json | |
@@ -278,6 +278,10 @@ | |
"htaccess-protect": { | |
"type": "boolean", | |
"description": "Defaults to true. If set to false, Composer will not create .htaccess files in the composer home, cache, and data directories." | |
+ }, | |
+ "sort-packages": { | |
+ "type": "boolean", | |
+ "description": "Defaults to false. If set to true, Composer will sort packages when adding/updating a new dependency." | |
} | |
} | |
}, | |
@@ -364,8 +368,8 @@ | |
"description": "If set to true, stable packages will be preferred to dev packages when possible, even if the minimum-stability allows unstable packages." | |
}, | |
"bin": { | |
- "type": ["array"], | |
- "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).", | |
+ "type": ["string", "array"], | |
+ "description": "A set of files, or a single file, that should be treated as binaries and symlinked into bin-dir (from config).", | |
"items": { | |
"type": "string" | |
} | |
@@ -379,7 +383,7 @@ | |
}, | |
"scripts": { | |
"type": ["object"], | |
- "description": "Scripts listeners that will be executed before/after some events.", | |
+ "description": "Script listeners that will be executed before/after some events.", | |
"properties": { | |
"pre-install-cmd": { | |
"type": ["array", "string"], | |
@@ -447,6 +451,13 @@ | |
} | |
} | |
}, | |
+ "scripts-descriptions": { | |
+ "type": ["object"], | |
+ "description": "Descriptions for custom commands, shown in console help.", | |
+ "additionalProperties": { | |
+ "type": "string" | |
+ } | |
+ }, | |
"support": { | |
"type": "object", | |
"properties": { | |
@@ -765,8 +776,8 @@ | |
} | |
}, | |
"bin": { | |
- "type": ["array"], | |
- "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).", | |
+ "type": ["string", "array"], | |
+ "description": "A set of files, or a single file, that should be treated as binaries and symlinked into bin-dir (from config).", | |
"items": { | |
"type": "string" | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php b/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php | |
index 519e5be..9b9710d 100644 | |
--- a/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php | |
+++ b/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php | |
@@ -199,7 +199,7 @@ EOF; | |
$targetDirLoader = null; | |
$mainAutoload = $mainPackage->getAutoload(); | |
if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) { | |
- $levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir()))); | |
+ $levels = substr_count($filesystem->normalizePath($mainPackage->getTargetDir()), '/') + 1; | |
$prefixes = implode(', ', array_map(function ($prefix) { | |
return var_export($prefix, true); | |
}, array_keys($mainAutoload['psr-0']))); | |
@@ -601,7 +601,7 @@ HEADER; | |
if ($useIncludePath) { | |
$file .= <<<'INCLUDE_PATH' | |
$includePaths = require __DIR__ . '/include_paths.php'; | |
- array_push($includePaths, get_include_path()); | |
+ $includePaths[] = get_include_path(); | |
set_include_path(implode(PATH_SEPARATOR, $includePaths)); | |
diff --git a/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php b/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php | |
index 2c72175..dc02dfb 100644 | |
--- a/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php | |
+++ b/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php | |
@@ -379,9 +379,9 @@ class ClassLoader | |
$subPath = substr($subPath, 0, $lastPos); | |
$search = $subPath.'\\'; | |
if (isset($this->prefixDirsPsr4[$search])) { | |
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); | |
foreach ($this->prefixDirsPsr4[$search] as $dir) { | |
- $length = $this->prefixLengthsPsr4[$first][$search]; | |
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { | |
+ if (file_exists($file = $dir . $pathEnd)) { | |
return $file; | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php b/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php | |
new file mode 100644 | |
index 0000000..8b59c28 | |
--- /dev/null | |
+++ b/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php | |
@@ -0,0 +1,149 @@ | |
+<?php | |
+ | |
+/* | |
+ * This file is part of Composer. | |
+ * | |
+ * (c) Nils Adermann <[email protected]> | |
+ * Jordi Boggiano <[email protected]> | |
+ * | |
+ * For the full copyright and license information, please view the LICENSE | |
+ * file that was distributed with this source code. | |
+ */ | |
+ | |
+namespace Composer\Command; | |
+ | |
+use Composer\Package\Link; | |
+use Composer\Package\PackageInterface; | |
+use Composer\Semver\Constraint\Constraint; | |
+use Symfony\Component\Console\Helper\Table; | |
+use Symfony\Component\Console\Input\InputInterface; | |
+use Symfony\Component\Console\Output\OutputInterface; | |
+use Composer\Repository\PlatformRepository; | |
+ | |
+class CheckPlatformReqsCommand extends BaseCommand | |
+{ | |
+ protected function configure() | |
+ { | |
+ $this->setName('check-platform-reqs') | |
+ ->setDescription('Check that platform requirements are satisfied.') | |
+ ->setHelp(<<<EOT | |
+Checks that your PHP and extensions versions match the platform requirements of the installed packages. | |
+ | |
+<info>php composer.phar check-platform-reqs</info> | |
+ | |
+EOT | |
+ ); | |
+ } | |
+ | |
+ protected function execute(InputInterface $input, OutputInterface $output) | |
+ { | |
+ $composer = $this->getComposer(); | |
+ | |
+ $repos = $composer->getRepositoryManager()->getLocalRepository(); | |
+ | |
+ $allPackages = array_merge(array($composer->getPackage()), $repos->getPackages()); | |
+ $requires = $composer->getPackage()->getDevRequires(); | |
+ foreach ($requires as $require => $link) { | |
+ $requires[$require] = array($link); | |
+ } | |
+ | |
+ /** | |
+ * @var PackageInterface $package | |
+ */ | |
+ foreach ($allPackages as $package) { | |
+ foreach ($package->getRequires() as $require => $link) { | |
+ $requires[$require][] = $link; | |
+ } | |
+ } | |
+ ksort($requires); | |
+ | |
+ $platformRepo = new PlatformRepository(array(), array()); | |
+ $currentPlatformPackages = $platformRepo->getPackages(); | |
+ $currentPlatformPackageMap = array(); | |
+ | |
+ /** | |
+ * @var PackageInterface $currentPlatformPackage | |
+ */ | |
+ foreach ($currentPlatformPackages as $currentPlatformPackage) { | |
+ $currentPlatformPackageMap[$currentPlatformPackage->getName()] = $currentPlatformPackage; | |
+ } | |
+ | |
+ $results = array(); | |
+ | |
+ $exitCode = 0; | |
+ | |
+ /** | |
+ * @var Link $require | |
+ */ | |
+ foreach ($requires as $require => $links) { | |
+ if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $require)) { | |
+ if (isset($currentPlatformPackageMap[$require])) { | |
+ $pass = true; | |
+ $version = $currentPlatformPackageMap[$require]->getVersion(); | |
+ | |
+ foreach ($links as $link) { | |
+ if (!$link->getConstraint()->matches(new Constraint('=', $version))) { | |
+ $results[] = array( | |
+ $currentPlatformPackageMap[$require]->getPrettyName(), | |
+ $currentPlatformPackageMap[$require]->getPrettyVersion(), | |
+ $link, | |
+ '<error>failed</error>', | |
+ ); | |
+ $pass = false; | |
+ | |
+ $exitCode = max($exitCode, 1); | |
+ } | |
+ } | |
+ | |
+ if ($pass) { | |
+ $results[] = array( | |
+ $currentPlatformPackageMap[$require]->getPrettyName(), | |
+ $currentPlatformPackageMap[$require]->getPrettyVersion(), | |
+ null, | |
+ '<info>success</info>', | |
+ ); | |
+ } | |
+ } else { | |
+ $results[] = array( | |
+ $require, | |
+ 'n/a', | |
+ $links[0], | |
+ '<error>missing</error>', | |
+ ); | |
+ | |
+ $exitCode = max($exitCode, 2); | |
+ } | |
+ } | |
+ } | |
+ | |
+ $this->printTable($output, $results); | |
+ | |
+ return $exitCode; | |
+ } | |
+ | |
+ protected function printTable(OutputInterface $output, $results) | |
+ { | |
+ $table = array(); | |
+ $rows = array(); | |
+ foreach ($results as $result) { | |
+ /** | |
+ * @var Link|null $link | |
+ */ | |
+ list($platformPackage, $version, $link, $status) = $result; | |
+ $rows[] = array( | |
+ $platformPackage, | |
+ $version, | |
+ $link ? sprintf('%s %s %s (%s)', $link->getSource(), $link->getDescription(), $link->getTarget(), $link->getPrettyConstraint()) : '', | |
+ $status, | |
+ ); | |
+ } | |
+ $table = array_merge($rows, $table); | |
+ | |
+ // Render table | |
+ $renderer = new Table($output); | |
+ $renderer->setStyle('compact'); | |
+ $renderer->getStyle()->setVerticalBorderChar(''); | |
+ $renderer->getStyle()->setCellRowContentFormat('%s '); | |
+ $renderer->setRows($table)->render(); | |
+ } | |
+} | |
diff --git a/vendor/composer/composer/src/Composer/Command/ConfigCommand.php b/vendor/composer/composer/src/Composer/Command/ConfigCommand.php | |
index eb7a3ff..6e457dd 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/ConfigCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/ConfigCommand.php | |
@@ -576,6 +576,9 @@ EOT | |
return $this->configSource->addConfigSetting($settingKey, $values[0]); | |
} | |
+ if ($settingKey === 'platform' && $input->getOption('unset')) { | |
+ return $this->configSource->removeConfigSetting($settingKey); | |
+ } | |
// handle auth | |
if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic)\.(.+)/', $settingKey, $matches)) { | |
diff --git a/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php b/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php | |
index 4f58a4a..b1e711f 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php | |
@@ -75,7 +75,8 @@ class CreateProjectCommand extends BaseCommand | |
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Whether to prevent execution of all defined scripts in the root package.'), | |
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), | |
new InputOption('no-secure-http', null, InputOption::VALUE_NONE, 'Disable the secure-http config option temporarily while installing the root package. Use at your own risk. Using this flag is a bad idea.'), | |
- new InputOption('keep-vcs', null, InputOption::VALUE_NONE, 'Whether to prevent deletion vcs folder.'), | |
+ new InputOption('keep-vcs', null, InputOption::VALUE_NONE, 'Whether to prevent deleting the vcs folder.'), | |
+ new InputOption('remove-vcs', null, InputOption::VALUE_NONE, 'Whether to force deletion of the vcs folder without prompting.'), | |
new InputOption('no-install', null, InputOption::VALUE_NONE, 'Whether to skip installation of the package dependencies.'), | |
new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'), | |
)) | |
@@ -140,11 +141,12 @@ EOT | |
$input->getOption('no-progress'), | |
$input->getOption('no-install'), | |
$input->getOption('ignore-platform-reqs'), | |
- !$input->getOption('no-secure-http') | |
+ !$input->getOption('no-secure-http'), | |
+ $input->getOption('remove-vcs') | |
); | |
} | |
- public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repository = null, $disablePlugins = false, $noScripts = false, $keepVcs = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false, $secureHttp = true) | |
+ public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repository = null, $disablePlugins = false, $noScripts = false, $keepVcs = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false, $secureHttp = true, $removeVcs = false) | |
{ | |
$oldCwd = getcwd(); | |
@@ -195,9 +197,12 @@ EOT | |
} | |
$hasVcs = $installedFromVcs; | |
- if (!$keepVcs && $installedFromVcs | |
+ if ( | |
+ !$keepVcs | |
+ && $installedFromVcs | |
&& ( | |
- !$io->isInteractive() | |
+ $removeVcs | |
+ || !$io->isInteractive() | |
|| $io->askConfirmation('<info>Do you want to remove the existing VCS (.git, .svn..) history?</info> [<comment>Y,n</comment>]? ', true) | |
) | |
) { | |
@@ -319,13 +324,16 @@ EOT | |
} | |
// handler Ctrl+C for unix-like systems | |
- if (function_exists('pcntl_signal')) { | |
- declare(ticks=100); | |
- pcntl_signal(SIGINT, function () use ($directory) { | |
- $fs = new Filesystem(); | |
- $fs->removeDirectory($directory); | |
- exit(130); | |
- }); | |
+ if (function_exists('pcntl_async_signals')) { | |
+ @mkdir($directory, 0777, true); | |
+ if ($realDir = realpath($directory)) { | |
+ pcntl_async_signals(true); | |
+ pcntl_signal(SIGINT, function () use ($realDir) { | |
+ $fs = new Filesystem(); | |
+ $fs->removeDirectory($realDir); | |
+ exit(130); | |
+ }); | |
+ } | |
} | |
$io->writeError('<info>Installing ' . $package->getName() . ' (' . $package->getFullPrettyVersion(false) . ')</info>'); | |
diff --git a/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php b/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php | |
index 32b9d71..d897749 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php | |
@@ -150,6 +150,14 @@ EOT | |
$this->outputResult($this->checkVersion($config)); | |
} | |
+ $io->write(sprintf('Composer version: <comment>%s</comment>', Composer::VERSION)); | |
+ | |
+ $io->write(sprintf('PHP version: <comment>%s</comment>', PHP_VERSION)); | |
+ | |
+ if (defined('PHP_BINARY')) { | |
+ $io->write(sprintf('PHP binary path: <comment>%s</comment>', PHP_BINARY)); | |
+ } | |
+ | |
return $this->exitCode; | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php b/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php | |
index 7410138..6c79ef1 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php | |
@@ -59,7 +59,9 @@ EOT | |
$authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative'); | |
$apcu = $input->getOption('apcu') || $config->get('apcu-autoloader'); | |
- if ($optimize || $authoritative) { | |
+ if ($authoritative) { | |
+ $this->getIO()->writeError('<info>Generating optimized autoload files (authoritative)</info>'); | |
+ } elseif ($optimize) { | |
$this->getIO()->writeError('<info>Generating optimized autoload files</info>'); | |
} else { | |
$this->getIO()->writeError('<info>Generating autoload files</info>'); | |
diff --git a/vendor/composer/composer/src/Composer/Command/HomeCommand.php b/vendor/composer/composer/src/Composer/Command/HomeCommand.php | |
index e434fa2..4a550ff 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/HomeCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/HomeCommand.php | |
@@ -38,7 +38,7 @@ class HomeCommand extends BaseCommand | |
->setAliases(array('home')) | |
->setDescription('Opens the package\'s repository URL or homepage in your browser.') | |
->setDefinition(array( | |
- new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'Package(s) to browse to.'), | |
+ new InputArgument('packages', InputArgument::IS_ARRAY, 'Package(s) to browse to.'), | |
new InputOption('homepage', 'H', InputOption::VALUE_NONE, 'Open the homepage instead of the repository URL.'), | |
new InputOption('show', 's', InputOption::VALUE_NONE, 'Only show the homepage or repository URL.'), | |
)) | |
@@ -61,7 +61,13 @@ EOT | |
$io = $this->getIO(); | |
$return = 0; | |
- foreach ($input->getArgument('packages') as $packageName) { | |
+ $packages = $input->getArgument('packages'); | |
+ if (!$packages) { | |
+ $io->writeError('No package specified, opening homepage for the root package'); | |
+ $packages = array($this->getComposer()->getPackage()->getName()); | |
+ } | |
+ | |
+ foreach ($packages as $packageName) { | |
$handled = false; | |
$packageExists = false; | |
foreach ($repos as $repo) { | |
diff --git a/vendor/composer/composer/src/Composer/Command/InitCommand.php b/vendor/composer/composer/src/Composer/Command/InitCommand.php | |
index 67cbba5..a17efe6 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/InitCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/InitCommand.php | |
@@ -13,20 +13,20 @@ | |
namespace Composer\Command; | |
use Composer\DependencyResolver\Pool; | |
-use Composer\Json\JsonFile; | |
use Composer\Factory; | |
-use Composer\Repository\RepositoryFactory; | |
+use Composer\Json\JsonFile; | |
use Composer\Package\BasePackage; | |
use Composer\Package\Version\VersionParser; | |
use Composer\Package\Version\VersionSelector; | |
use Composer\Repository\CompositeRepository; | |
use Composer\Repository\PlatformRepository; | |
+use Composer\Repository\RepositoryFactory; | |
use Composer\Util\ProcessExecutor; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; | |
-use Symfony\Component\Process\Process; | |
use Symfony\Component\Process\ExecutableFinder; | |
+use Symfony\Component\Process\Process; | |
/** | |
* @author Justin Rainbow <[email protected]> | |
@@ -191,7 +191,9 @@ EOT | |
$name = basename($cwd); | |
$name = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $name); | |
$name = strtolower($name); | |
- if (isset($git['github.user'])) { | |
+ if (!empty($_SERVER['COMPOSER_DEFAULT_VENDOR'])) { | |
+ $name = $_SERVER['COMPOSER_DEFAULT_VENDOR'] . '/' . $name; | |
+ } elseif (isset($git['github.user'])) { | |
$name = $git['github.user'] . '/' . $name; | |
} elseif (!empty($_SERVER['USERNAME'])) { | |
$name = $_SERVER['USERNAME'] . '/' . $name; | |
@@ -240,8 +242,20 @@ EOT | |
$input->setOption('description', $description); | |
if (null === $author = $input->getOption('author')) { | |
- if (isset($git['user.name']) && isset($git['user.email'])) { | |
- $author = sprintf('%s <%s>', $git['user.name'], $git['user.email']); | |
+ if (!empty($_SERVER['COMPOSER_DEFAULT_AUTHOR'])) { | |
+ $author_name = $_SERVER['COMPOSER_DEFAULT_AUTHOR']; | |
+ } elseif (isset($git['user.name'])) { | |
+ $author_name = $git['user.name']; | |
+ } | |
+ | |
+ if (!empty($_SERVER['COMPOSER_DEFAULT_EMAIL'])) { | |
+ $author_email = $_SERVER['COMPOSER_DEFAULT_EMAIL']; | |
+ } elseif (isset($git['user.email'])) { | |
+ $author_email = $git['user.email']; | |
+ } | |
+ | |
+ if (isset($author_name) && isset($author_email)) { | |
+ $author = sprintf('%s <%s>', $author_name, $author_email); | |
} | |
} | |
@@ -291,7 +305,12 @@ EOT | |
); | |
$input->setOption('type', $type); | |
- $license = $input->getOption('license') ?: false; | |
+ if (null === $license = $input->getOption('license')) { | |
+ if (!empty($_SERVER['COMPOSER_DEFAULT_LICENSE'])) { | |
+ $license = $_SERVER['COMPOSER_DEFAULT_LICENSE']; | |
+ } | |
+ } | |
+ | |
$license = $io->ask( | |
'License [<comment>'.$license.'</comment>]: ', | |
$license | |
@@ -366,9 +385,12 @@ EOT | |
foreach ($requires as $requirement) { | |
if (!isset($requirement['version'])) { | |
// determine the best version automatically | |
- $version = $this->findBestVersionForPackage($input, $requirement['name'], $phpVersion, $preferredStability); | |
+ list($name, $version) = $this->findBestVersionAndNameForPackage($input, $requirement['name'], $phpVersion, $preferredStability); | |
$requirement['version'] = $version; | |
+ // replace package name from packagist.org | |
+ $requirement['name'] = $name; | |
+ | |
$io->writeError(sprintf( | |
'Using version <info>%s</info> for <info>%s</info>', | |
$requirement['version'], | |
@@ -376,7 +398,10 @@ EOT | |
)); | |
} else { | |
// check that the specified version/constraint exists before we proceed | |
- $this->findBestVersionForPackage($input, $requirement['name'], $phpVersion, $preferredStability, $requirement['version'], 'dev'); | |
+ list($name, $version) = $this->findBestVersionAndNameForPackage($input, $requirement['name'], $phpVersion, $preferredStability, $requirement['version'], 'dev'); | |
+ | |
+ // replace package name from packagist.org | |
+ $requirement['name'] = $name; | |
} | |
$result[] = $requirement['name'] . ' ' . $requirement['version']; | |
@@ -394,7 +419,17 @@ EOT | |
$exactMatch = null; | |
$choices = array(); | |
foreach ($matches as $position => $foundPackage) { | |
- $choices[] = sprintf(' <info>%5s</info> %s', "[$position]", $foundPackage['name']); | |
+ $abandoned = ''; | |
+ if (isset($foundPackage['abandoned'])) { | |
+ if (is_string($foundPackage['abandoned'])) { | |
+ $replacement = sprintf('Use %s instead', $foundPackage['abandoned']); | |
+ } else { | |
+ $replacement = 'No replacement was suggested'; | |
+ } | |
+ $abandoned = sprintf('<warning>Abandoned. %s.</warning>', $replacement); | |
+ } | |
+ | |
+ $choices[] = sprintf(' <info>%5s</info> %s %s', "[$position]", $foundPackage['name'], $abandoned); | |
if ($foundPackage['name'] === $package) { | |
$exactMatch = true; | |
break; | |
@@ -464,7 +499,7 @@ EOT | |
); | |
if (false === $constraint) { | |
- $constraint = $this->findBestVersionForPackage($input, $package, $phpVersion, $preferredStability); | |
+ list($name, $constraint) = $this->findBestVersionAndNameForPackage($input, $package, $phpVersion, $preferredStability); | |
$io->writeError(sprintf( | |
'Using version <info>%s</info> for <info>%s</info>', | |
@@ -631,18 +666,25 @@ EOT | |
* | |
* @param InputInterface $input | |
* @param string $name | |
- * @param string $phpVersion | |
+ * @param string|null $phpVersion | |
* @param string $preferredStability | |
+ * @param string|null $requiredVersion | |
* @param string $minimumStability | |
* @throws \InvalidArgumentException | |
- * @return string | |
+ * @return array name version | |
*/ | |
- private function findBestVersionForPackage(InputInterface $input, $name, $phpVersion, $preferredStability = 'stable', $requiredVersion = null, $minimumStability = null) | |
+ private function findBestVersionAndNameForPackage(InputInterface $input, $name, $phpVersion, $preferredStability = 'stable', $requiredVersion = null, $minimumStability = null) | |
{ | |
// find the latest version allowed in this pool | |
$versionSelector = new VersionSelector($this->getPool($input, $minimumStability)); | |
$package = $versionSelector->findBestCandidate($name, $requiredVersion, $phpVersion, $preferredStability); | |
+ // retry without phpVersion if platform requirements are ignored in case nothing was found | |
+ if ($input->hasOption('ignore-platform-reqs') && $input->getOption('ignore-platform-reqs')) { | |
+ $phpVersion = null; | |
+ $package = $versionSelector->findBestCandidate($name, $requiredVersion, $phpVersion, $preferredStability); | |
+ } | |
+ | |
if (!$package) { | |
// Check whether the PHP version was the problem | |
if ($phpVersion && $versionSelector->findBestCandidate($name, $requiredVersion, null, $preferredStability)) { | |
@@ -662,6 +704,26 @@ EOT | |
'Could not find package %s in any version matching your PHP version (%s)', $name, $phpVersion | |
)); | |
} | |
+ | |
+ // Check for similar names/typos | |
+ $similar = $this->findSimilar($name); | |
+ if ($similar) { | |
+ // Check whether the minimum stability was the problem but the package exists | |
+ if ($requiredVersion === null && in_array($name, $similar, true)) { | |
+ throw new \InvalidArgumentException(sprintf( | |
+ 'Could not find a version of package %s matching your minimum-stability (%s). Require it with an explicit version constraint allowing its desired stability.', | |
+ $name, | |
+ $this->getMinimumStability($input) | |
+ )); | |
+ } | |
+ | |
+ throw new \InvalidArgumentException(sprintf( | |
+ "Could not find package %s.\n\nDid you mean " . (count($similar) > 1 ? 'one of these' : 'this') . "?\n %s", | |
+ $name, | |
+ implode("\n ", $similar) | |
+ )); | |
+ } | |
+ | |
throw new \InvalidArgumentException(sprintf( | |
'Could not find a matching version of package %s. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (%s).', | |
$name, | |
@@ -669,6 +731,27 @@ EOT | |
)); | |
} | |
- return $versionSelector->findRecommendedRequireVersion($package); | |
+ return array( | |
+ $package->getPrettyName(), | |
+ $versionSelector->findRecommendedRequireVersion($package) | |
+ ); | |
+ } | |
+ | |
+ private function findSimilar($package) | |
+ { | |
+ try { | |
+ $results = $this->repos->search($package); | |
+ } catch (\Exception $e) { | |
+ // ignore search errors | |
+ return array(); | |
+ } | |
+ $similarPackages = array(); | |
+ | |
+ foreach ($results as $result) { | |
+ $similarPackages[$result['name']] = levenshtein($package, $result['name']); | |
+ } | |
+ asort($similarPackages); | |
+ | |
+ return array_keys(array_slice($similarPackages, 0, 5)); | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Command/RemoveCommand.php b/vendor/composer/composer/src/Composer/Command/RemoveCommand.php | |
index 2366684..200340e 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/RemoveCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/RemoveCommand.php | |
@@ -131,7 +131,7 @@ EOT | |
->setApcuAutoloader($apcu) | |
->setUpdate(true) | |
->setUpdateWhitelist($packages) | |
- ->setWhitelistDependencies(!$input->getOption('no-update-with-dependencies')) | |
+ ->setWhitelistTransitiveDependencies(!$input->getOption('no-update-with-dependencies')) | |
->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs')) | |
->setRunScripts(!$input->getOption('no-scripts')) | |
; | |
diff --git a/vendor/composer/composer/src/Composer/Command/RequireCommand.php b/vendor/composer/composer/src/Composer/Command/RequireCommand.php | |
index e30143d..37cec85 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/RequireCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/RequireCommand.php | |
@@ -38,7 +38,7 @@ class RequireCommand extends InitCommand | |
->setName('require') | |
->setDescription('Adds required packages to your composer.json and installs them.') | |
->setDefinition(array( | |
- new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Required package name optionally including a version constraint, e.g. foo/bar or foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'), | |
+ new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Optional package name can also include a version constraint, e.g. foo/bar or foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'), | |
new InputOption('dev', null, InputOption::VALUE_NONE, 'Add requirement to require-dev.'), | |
new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'), | |
new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'), | |
@@ -47,7 +47,8 @@ class RequireCommand extends InitCommand | |
new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'), | |
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), | |
new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'), | |
- new InputOption('update-with-dependencies', null, InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated with explicit dependencies.'), | |
+ new InputOption('update-with-dependencies', null, InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated, except those that are root requirements.'), | |
+ new InputOption('update-with-all-dependencies', null, InputOption::VALUE_NONE, 'Allows all inherited dependencies to be updated, including those that are root requirements.'), | |
new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'), | |
new InputOption('prefer-stable', null, InputOption::VALUE_NONE, 'Prefer stable versions of dependencies.'), | |
new InputOption('prefer-lowest', null, InputOption::VALUE_NONE, 'Prefer lowest versions of dependencies.'), | |
@@ -59,6 +60,9 @@ class RequireCommand extends InitCommand | |
->setHelp(<<<EOT | |
The require command adds required packages to your composer.json and installs them. | |
+If you do not specify a package, composer will prompt you to search for a package, and given results, provide a list of | |
+matches to require. | |
+ | |
If you do not specify a version constraint, composer will choose a suitable one based on the available package versions. | |
If you do not want to install the new dependencies immediately you can call it with --no-update | |
@@ -169,7 +173,8 @@ EOT | |
->setApcuAutoloader($apcu) | |
->setUpdate(true) | |
->setUpdateWhitelist(array_keys($requirements)) | |
- ->setWhitelistDependencies($input->getOption('update-with-dependencies')) | |
+ ->setWhitelistTransitiveDependencies($input->getOption('update-with-dependencies')) | |
+ ->setWhitelistAllDependencies($input->getOption('update-with-all-dependencies')) | |
->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs')) | |
->setPreferStable($input->getOption('prefer-stable')) | |
->setPreferLowest($input->getOption('prefer-lowest')) | |
diff --git a/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php b/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php | |
index 5696dd3..d78662e 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php | |
@@ -19,6 +19,7 @@ use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Output\OutputInterface; | |
+use Symfony\Component\Console\Helper\Table; | |
/** | |
* @author Fabien Potencier <[email protected]> | |
@@ -68,7 +69,7 @@ EOT | |
protected function execute(InputInterface $input, OutputInterface $output) | |
{ | |
if ($input->getOption('list')) { | |
- return $this->listScripts(); | |
+ return $this->listScripts($output); | |
} elseif (!$input->getArgument('script')) { | |
throw new \RuntimeException('Missing required argument "script"'); | |
} | |
@@ -90,7 +91,7 @@ EOT | |
$args = $input->getArgument('args'); | |
- if (!is_null($timeout = $input->getOption('timeout'))) { | |
+ if (null !== $timeout = $input->getOption('timeout')) { | |
if (!ctype_digit($timeout)) { | |
throw new \RuntimeException('Timeout value must be numeric and positive if defined, or 0 for forever'); | |
} | |
@@ -101,7 +102,7 @@ EOT | |
return $composer->getEventDispatcher()->dispatchScript($script, $devMode, $args); | |
} | |
- protected function listScripts() | |
+ protected function listScripts(OutputInterface $output) | |
{ | |
$scripts = $this->getComposer()->getPackage()->getScripts(); | |
@@ -111,10 +112,22 @@ EOT | |
$io = $this->getIO(); | |
$io->writeError('<info>scripts:</info>'); | |
+ $table = array(); | |
foreach ($scripts as $name => $script) { | |
- $io->write(' ' . $name); | |
+ $cmd = $this->getApplication()->find($name); | |
+ $description = ''; | |
+ if ($cmd instanceof ScriptAliasCommand) { | |
+ $description = $cmd->getDescription(); | |
+ } | |
+ $table[] = array(' '.$name, $description); | |
} | |
+ $renderer = new Table($output); | |
+ $renderer->setStyle('compact'); | |
+ $renderer->getStyle()->setVerticalBorderChar(''); | |
+ $renderer->getStyle()->setCellRowContentFormat('%s '); | |
+ $renderer->setRows($table)->render(); | |
+ | |
return 0; | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php b/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php | |
index 50d0d77..81f1454 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php | |
@@ -23,10 +23,12 @@ use Symfony\Component\Console\Output\OutputInterface; | |
class ScriptAliasCommand extends BaseCommand | |
{ | |
private $script; | |
+ private $description; | |
- public function __construct($script) | |
+ public function __construct($script, $description) | |
{ | |
$this->script = $script; | |
+ $this->description = empty($description) ? 'Runs the '.$script.' script as defined in composer.json.' : $description; | |
parent::__construct(); | |
} | |
@@ -35,7 +37,7 @@ class ScriptAliasCommand extends BaseCommand | |
{ | |
$this | |
->setName($this->script) | |
- ->setDescription('Runs the '.$this->script.' script as defined in composer.json.') | |
+ ->setDescription($this->description) | |
->setDefinition(array( | |
new InputOption('dev', null, InputOption::VALUE_NONE, 'Sets the dev mode.'), | |
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables the dev mode.'), | |
diff --git a/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php b/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php | |
index 77cc9d6..52f7b87 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php | |
@@ -107,6 +107,15 @@ EOT | |
throw new FilesystemException('Composer update failed: the "'.$tmpDir.'" directory used to download the temp file could not be written'); | |
} | |
+ // check if composer is running as the same user that owns the directory root, only if POSIX is defined and callable | |
+ if (function_exists('posix_getpwuid') && function_exists('posix_geteuid')) { | |
+ $composeUser = posix_getpwuid(posix_geteuid()); | |
+ $homeOwner = posix_getpwuid(fileowner($home)); | |
+ if (isset($composeUser['name']) && isset($homeOwner['name']) && $composeUser['name'] !== $homeOwner['name']) { | |
+ $io->writeError('<warning>You are running composer as "'.$composeUser['name'].'", while "'.$home.'" is owned by "'.$homeOwner['name'].'"</warning>'); | |
+ } | |
+ } | |
+ | |
if ($input->getOption('rollback')) { | |
return $this->rollback($output, $rollbackDir, $localFilename); | |
} | |
@@ -231,7 +240,10 @@ TAGSPUBKEY | |
} | |
if (file_exists($backupFile)) { | |
- $io->writeError('Use <info>composer self-update --rollback</info> to return to version '.Composer::VERSION); | |
+ $io->writeError(sprintf( | |
+ 'Use <info>composer self-update --rollback</info> to return to version <comment>%s</comment>', | |
+ Composer::VERSION | |
+ )); | |
} else { | |
$io->writeError('<warning>A backup of the current version could not be written to '.$backupFile.', no rollback possible</warning>'); | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Command/ShowCommand.php b/vendor/composer/composer/src/Composer/Command/ShowCommand.php | |
index b90d5c3..ae2307e 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/ShowCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/ShowCommand.php | |
@@ -12,32 +12,33 @@ | |
namespace Composer\Command; | |
-use Composer\DependencyResolver\Pool; | |
+use Composer\Composer; | |
use Composer\DependencyResolver\DefaultPolicy; | |
+use Composer\DependencyResolver\Pool; | |
use Composer\Json\JsonFile; | |
+use Composer\Package\BasePackage; | |
use Composer\Package\CompletePackageInterface; | |
+use Composer\Package\PackageInterface; | |
use Composer\Package\Version\VersionParser; | |
-use Composer\Package\BasePackage; | |
use Composer\Package\Version\VersionSelector; | |
use Composer\Plugin\CommandEvent; | |
use Composer\Plugin\PluginEvents; | |
-use Composer\Package\PackageInterface; | |
+use Composer\Repository\ArrayRepository; | |
+use Composer\Repository\ComposerRepository; | |
+use Composer\Repository\CompositeRepository; | |
+use Composer\Repository\PlatformRepository; | |
+use Composer\Repository\RepositoryFactory; | |
+use Composer\Repository\RepositoryInterface; | |
use Composer\Semver\Constraint\ConstraintInterface; | |
+use Composer\Semver\Semver; | |
+use Composer\Spdx\SpdxLicenses; | |
use Composer\Util\Platform; | |
use Symfony\Component\Console\Formatter\OutputFormatterStyle; | |
-use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputArgument; | |
+use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; | |
-use Composer\Repository\ArrayRepository; | |
-use Composer\Repository\CompositeRepository; | |
-use Composer\Repository\ComposerRepository; | |
-use Composer\Repository\PlatformRepository; | |
-use Composer\Repository\RepositoryInterface; | |
-use Composer\Repository\RepositoryFactory; | |
-use Composer\Spdx\SpdxLicenses; | |
-use Composer\Composer; | |
-use Composer\Semver\Semver; | |
+use Symfony\Component\Console\Terminal; | |
/** | |
* @author Robert Schönthal <[email protected]> | |
@@ -231,7 +232,9 @@ EOT | |
$io->writeError('Format "json" is only supported for package listings, falling back to format "text"'); | |
} | |
$rootRequires = $this->getRootRequires(); | |
- foreach ($installedRepo->getPackages() as $package) { | |
+ $packages = $installedRepo->getPackages(); | |
+ usort($packages, 'strcmp'); | |
+ foreach ($packages as $package) { | |
if (in_array($package->getName(), $rootRequires, true)) { | |
$this->displayPackageTree($package, $installedRepo, $repos); | |
} | |
@@ -257,7 +260,13 @@ EOT | |
$packageListFilter = $this->getRootRequires(); | |
} | |
- list($width) = $this->getApplication()->getTerminalDimensions(); | |
+ if (class_exists('Symfony\Component\Console\Terminal')) { | |
+ $terminal = new Terminal(); | |
+ $width = $terminal->getWidth(); | |
+ } else { | |
+ // For versions of Symfony console before 3.2 | |
+ list($width) = $this->getApplication()->getTerminalDimensions(); | |
+ } | |
if (null === $width) { | |
// In case the width is not detected, we're probably running the command | |
// outside of a real terminal, use space without a limit | |
@@ -712,6 +721,7 @@ EOT | |
if (is_object($package)) { | |
$requires = $package->getRequires(); | |
+ ksort($requires); | |
$treeBar = '├'; | |
$j = 0; | |
$total = count($requires); | |
@@ -753,6 +763,7 @@ EOT | |
list($package, $versions) = $this->getPackage($installedRepo, $distantRepos, $name, $package->getPrettyConstraint() === 'self.version' ? $package->getConstraint() : $package->getPrettyConstraint()); | |
if (is_object($package)) { | |
$requires = $package->getRequires(); | |
+ ksort($requires); | |
$treeBar = $previousTreeBar . ' ├'; | |
$i = 0; | |
$total = count($requires); | |
diff --git a/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php b/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php | |
index f3466c6..8461fe7 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php | |
@@ -88,7 +88,7 @@ EOT | |
continue; | |
} | |
foreach ($package['suggest'] as $suggestion => $reason) { | |
- if (false === strpos('/', $suggestion) && !is_null($platform->findPackage($suggestion, '*'))) { | |
+ if (false === strpos('/', $suggestion) && null !== $platform->findPackage($suggestion, '*')) { | |
continue; | |
} | |
if (!isset($installed[$suggestion])) { | |
diff --git a/vendor/composer/composer/src/Composer/Command/UpdateCommand.php b/vendor/composer/composer/src/Composer/Command/UpdateCommand.php | |
index 3c456ad..1610d28 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/UpdateCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/UpdateCommand.php | |
@@ -49,7 +49,8 @@ class UpdateCommand extends BaseCommand | |
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), | |
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), | |
new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'Do not show package suggestions.'), | |
- new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist.'), | |
+ new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also dependencies of whitelisted packages to the whitelist, except those defined in root package.'), | |
+ new InputOption('with-all-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist, including those defined in root package.'), | |
new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'), | |
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump.'), | |
new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'), | |
@@ -146,7 +147,8 @@ EOT | |
->setApcuAutoloader($apcu) | |
->setUpdate(true) | |
->setUpdateWhitelist($input->getOption('lock') ? array('lock') : $packages) | |
- ->setWhitelistDependencies($input->getOption('with-dependencies')) | |
+ ->setWhitelistTransitiveDependencies($input->getOption('with-dependencies')) | |
+ ->setWhitelistAllDependencies($input->getOption('with-all-dependencies')) | |
->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs')) | |
->setPreferStable($input->getOption('prefer-stable')) | |
->setPreferLowest($input->getOption('prefer-lowest')) | |
@@ -171,7 +173,8 @@ EOT | |
); | |
$autocompleterValues = array(); | |
foreach ($requires as $require) { | |
- $autocompleterValues[strtolower($require->getTarget())] = $require->getTarget(); | |
+ $target = $require->getTarget(); | |
+ $autocompleterValues[strtolower($target)] = $target; | |
} | |
$installedPackages = $composer->getRepositoryManager()->getLocalRepository()->getPackages(); | |
diff --git a/vendor/composer/composer/src/Composer/Command/ValidateCommand.php b/vendor/composer/composer/src/Composer/Command/ValidateCommand.php | |
index c72fdf6..c4f78d2 100644 | |
--- a/vendor/composer/composer/src/Composer/Command/ValidateCommand.php | |
+++ b/vendor/composer/composer/src/Composer/Command/ValidateCommand.php | |
@@ -44,7 +44,7 @@ class ValidateCommand extends BaseCommand | |
new InputOption('no-check-publish', null, InputOption::VALUE_NONE, 'Do not check for publish errors'), | |
new InputOption('with-dependencies', 'A', InputOption::VALUE_NONE, 'Also validate the composer.json of all installed dependencies'), | |
new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code for warnings as well as errors'), | |
- new InputArgument('file', InputArgument::OPTIONAL, 'path to composer.json file', './composer.json'), | |
+ new InputArgument('file', InputArgument::OPTIONAL, 'path to composer.json file'), | |
)) | |
->setHelp(<<<EOT | |
The validate command validates a given composer.json and composer.lock | |
@@ -66,7 +66,7 @@ EOT | |
*/ | |
protected function execute(InputInterface $input, OutputInterface $output) | |
{ | |
- $file = $input->getArgument('file'); | |
+ $file = $input->getArgument('file') ?: Factory::getComposerFile(); | |
$io = $this->getIO(); | |
if (!file_exists($file)) { | |
diff --git a/vendor/composer/composer/src/Composer/Compiler.php b/vendor/composer/composer/src/Composer/Compiler.php | |
index 6fccb8e..34eca8b 100644 | |
--- a/vendor/composer/composer/src/Composer/Compiler.php | |
+++ b/vendor/composer/composer/src/Composer/Compiler.php | |
@@ -165,7 +165,7 @@ class Compiler | |
} | |
/** | |
- * @param \SplFileInfo $file | |
+ * @param \SplFileInfo $file | |
* @return string | |
*/ | |
private function getRelativeFilePath($file) | |
diff --git a/vendor/composer/composer/src/Composer/Composer.php b/vendor/composer/composer/src/Composer/Composer.php | |
index dae7ff7..15e23c6 100644 | |
--- a/vendor/composer/composer/src/Composer/Composer.php | |
+++ b/vendor/composer/composer/src/Composer/Composer.php | |
@@ -29,9 +29,9 @@ use Composer\Package\Archiver\ArchiveManager; | |
*/ | |
class Composer | |
{ | |
- const VERSION = '1.5.6'; | |
+ const VERSION = '1.6.3'; | |
const BRANCH_ALIAS_VERSION = ''; | |
- const RELEASE_DATE = '2017-12-18 12:09:18'; | |
+ const RELEASE_DATE = '2018-01-31 16:28:17'; | |
/** | |
* @var Package\RootPackageInterface | |
diff --git a/vendor/composer/composer/src/Composer/Console/Application.php b/vendor/composer/composer/src/Composer/Console/Application.php | |
index 1cff924..655b059 100644 | |
--- a/vendor/composer/composer/src/Composer/Console/Application.php | |
+++ b/vendor/composer/composer/src/Composer/Console/Application.php | |
@@ -228,7 +228,13 @@ class Application extends BaseApplication | |
if ($this->has($script)) { | |
$io->writeError('<warning>A script named '.$script.' would override a Composer command and has been skipped</warning>'); | |
} else { | |
- $this->add(new Command\ScriptAliasCommand($script)); | |
+ $description = null; | |
+ | |
+ if (isset($composer['scripts-descriptions'][$script])) { | |
+ $description = $composer['scripts-descriptions'][$script]; | |
+ } | |
+ | |
+ $this->add(new Command\ScriptAliasCommand($script, $description)); | |
} | |
} | |
} | |
@@ -397,6 +403,7 @@ class Application extends BaseApplication | |
new Command\HomeCommand(), | |
new Command\ExecCommand(), | |
new Command\OutdatedCommand(), | |
+ new Command\CheckPlatformReqsCommand(), | |
)); | |
if ('phar:' === substr(__FILE__, 0, 5)) { | |
diff --git a/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php b/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php | |
index 15815be..debc867 100644 | |
--- a/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php | |
+++ b/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php | |
@@ -11,6 +11,7 @@ | |
*/ | |
namespace Composer\DependencyResolver; | |
+use Composer\Package\CompletePackageInterface; | |
/** | |
* Represents a problem detected while solving dependencies | |
@@ -90,8 +91,17 @@ class Problem | |
// handle php/hhvm | |
if ($job['packageName'] === 'php' || $job['packageName'] === 'php-64bit' || $job['packageName'] === 'hhvm') { | |
+ $version = phpversion(); | |
$available = $this->pool->whatProvides($job['packageName']); | |
- $version = count($available) ? $available[0]->getPrettyVersion() : phpversion(); | |
+ | |
+ if (count($available)) { | |
+ $firstAvailable = reset($available); | |
+ $version = $firstAvailable->getPrettyVersion(); | |
+ $extra = $firstAvailable->getExtra(); | |
+ if ($firstAvailable instanceof CompletePackageInterface && isset($extra['config.platform']) && $extra['config.platform'] === true) { | |
+ $version .= '; ' . $firstAvailable->getDescription(); | |
+ } | |
+ } | |
$msg = "\n - This package requires ".$job['packageName'].$this->constraintToText($job['constraint']).' but '; | |
@@ -108,6 +118,10 @@ class Problem | |
// handle php extensions | |
if (0 === stripos($job['packageName'], 'ext-')) { | |
+ if (false !== strpos($job['packageName'], ' ')) { | |
+ return "\n - The requested PHP extension ".$job['packageName'].' should be required as '.str_replace(' ', '-', $job['packageName']).'.'; | |
+ } | |
+ | |
$ext = substr($job['packageName'], 4); | |
$error = extension_loaded($ext) ? 'has the wrong version ('.(phpversion($ext) ?: '0').') installed' : 'is missing from your system'; | |
diff --git a/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php b/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php | |
index 867aa81..2cf150a 100644 | |
--- a/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php | |
+++ b/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php | |
@@ -283,7 +283,7 @@ class RuleSetGenerator | |
switch ($job['cmd']) { | |
case 'install': | |
if (!$job['fixed'] && $ignorePlatformReqs && preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $job['packageName'])) { | |
- continue; | |
+ break; | |
} | |
$packages = $this->pool->whatProvides($job['packageName'], $job['constraint']); | |
diff --git a/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php b/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php | |
index 63563ae..8c04862 100644 | |
--- a/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php | |
+++ b/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php | |
@@ -51,7 +51,7 @@ class RuleSetIterator implements \Iterator | |
return; | |
} | |
- if ($this->currentOffset >= sizeof($this->rules[$this->currentType])) { | |
+ if ($this->currentOffset >= count($this->rules[$this->currentType])) { | |
$this->currentOffset = 0; | |
do { | |
@@ -63,7 +63,7 @@ class RuleSetIterator implements \Iterator | |
} | |
$this->currentType = $this->types[$this->currentTypeOffset]; | |
- } while (isset($this->types[$this->currentTypeOffset]) && !sizeof($this->rules[$this->currentType])); | |
+ } while (isset($this->types[$this->currentTypeOffset]) && !count($this->rules[$this->currentType])); | |
} | |
} | |
@@ -83,7 +83,7 @@ class RuleSetIterator implements \Iterator | |
} | |
$this->currentType = $this->types[$this->currentTypeOffset]; | |
- } while (isset($this->types[$this->currentTypeOffset]) && !sizeof($this->rules[$this->currentType])); | |
+ } while (isset($this->types[$this->currentTypeOffset]) && !count($this->rules[$this->currentType])); | |
} | |
public function valid() | |
diff --git a/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php b/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php | |
index eb3dd86..3d31a38 100644 | |
--- a/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php | |
+++ b/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php | |
@@ -90,9 +90,9 @@ class RuleWatchNode | |
{ | |
if ($this->watch1 == $literal) { | |
return $this->watch2; | |
- } else { | |
- return $this->watch1; | |
} | |
+ | |
+ return $this->watch1; | |
} | |
/** | |
diff --git a/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php b/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php | |
index bb60dcc..3674a19 100644 | |
--- a/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php | |
+++ b/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php | |
@@ -111,16 +111,16 @@ class Transaction | |
$packageId = $package->id; | |
if (!isset($visited[$packageId])) { | |
- array_push($queue, $package); | |
+ $queue[] = $package; | |
if ($package instanceof AliasPackage) { | |
- array_push($queue, $package->getAliasOf()); | |
+ $queue[] = $package->getAliasOf(); | |
} else { | |
foreach ($package->getRequires() as $link) { | |
$possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint()); | |
foreach ($possibleRequires as $require) { | |
- array_push($queue, $require); | |
+ $queue[] = $require; | |
} | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php b/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php | |
index 1b93724..24256c8 100644 | |
--- a/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php | |
+++ b/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php | |
@@ -102,32 +102,6 @@ abstract class ArchiveDownloader extends FileDownloader | |
} | |
/** | |
- * {@inheritdoc} | |
- */ | |
- protected function processUrl(PackageInterface $package, $url) | |
- { | |
- if ($package->getDistReference() && strpos($url, 'github.com')) { | |
- if (preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/(zip|tar)ball/(.+)$}i', $url, $match)) { | |
- // update legacy github archives to API calls with the proper reference | |
- $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $package->getDistReference(); | |
- } elseif ($package->getDistReference() && preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/archive/.+\.(zip|tar)(?:\.gz)?$}i', $url, $match)) { | |
- // update current github web archives to API calls with the proper reference | |
- $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $package->getDistReference(); | |
- } elseif ($package->getDistReference() && preg_match('{^https?://api\.github\.com/repos/([^/]+)/([^/]+)/(zip|tar)ball(?:/.+)?$}i', $url, $match)) { | |
- // update api archives to the proper reference | |
- $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $package->getDistReference(); | |
- } | |
- } elseif ($package->getDistReference() && strpos($url, 'bitbucket.org')) { | |
- if (preg_match('{^https?://(?:www\.)?bitbucket\.org/([^/]+)/([^/]+)/get/(.+)\.(zip|tar\.gz|tar\.bz2)$}i', $url, $match)) { | |
- // update Bitbucket archives to the proper reference | |
- $url = 'https://bitbucket.org/' . $match[1] . '/'. $match[2] . '/get/' . $package->getDistReference() . '.' . $match[4]; | |
- } | |
- } | |
- | |
- return parent::processUrl($package, $url); | |
- } | |
- | |
- /** | |
* Extract file to directory | |
* | |
* @param string $file Extracted file | |
diff --git a/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php b/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php | |
index 77b41c5..0b1affc 100644 | |
--- a/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php | |
+++ b/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php | |
@@ -160,8 +160,8 @@ class DownloadManager | |
if ($installationSource !== $downloader->getInstallationSource()) { | |
throw new \LogicException(sprintf( | |
- 'Downloader "%s" is a %s type downloader and can not be used to download %s', | |
- get_class($downloader), $downloader->getInstallationSource(), $installationSource | |
+ 'Downloader "%s" is a %s type downloader and can not be used to download %s for package %s', | |
+ get_class($downloader), $downloader->getInstallationSource(), $installationSource, $package | |
)); | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php b/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php | |
index 8bdf0a5..0cc5317 100644 | |
--- a/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php | |
+++ b/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php | |
@@ -22,6 +22,7 @@ use Composer\Plugin\PreFileDownloadEvent; | |
use Composer\EventDispatcher\EventDispatcher; | |
use Composer\Util\Filesystem; | |
use Composer\Util\RemoteFilesystem; | |
+use Composer\Util\Url as UrlUtil; | |
/** | |
* Base downloader for files | |
@@ -260,6 +261,10 @@ class FileDownloader implements DownloaderInterface | |
throw new \RuntimeException('You must enable the openssl extension to download files via https'); | |
} | |
+ if ($package->getDistReference()) { | |
+ $url = UrlUtil::updateDistReference($this->config, $url, $package->getDistReference()); | |
+ } | |
+ | |
return $url; | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php b/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php | |
index 5cd69d5..6266768 100644 | |
--- a/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php | |
+++ b/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php | |
@@ -12,13 +12,13 @@ | |
namespace Composer\Downloader; | |
+use Composer\Config; | |
+use Composer\IO\IOInterface; | |
use Composer\Package\PackageInterface; | |
+use Composer\Util\Filesystem; | |
use Composer\Util\Git as GitUtil; | |
use Composer\Util\Platform; | |
use Composer\Util\ProcessExecutor; | |
-use Composer\IO\IOInterface; | |
-use Composer\Util\Filesystem; | |
-use Composer\Config; | |
/** | |
* @author Jordi Boggiano <[email protected]> | |
@@ -43,30 +43,41 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface | |
GitUtil::cleanEnv(); | |
$path = $this->normalizePath($path); | |
$cachePath = $this->config->get('cache-vcs-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $url).'/'; | |
- $cacheOptions = ''; | |
$ref = $package->getSourceReference(); | |
$flag = Platform::isWindows() ? '/D ' : ''; | |
// --dissociate option is only available since git 2.3.0-rc0 | |
$gitVersion = $this->gitUtil->getVersion(); | |
$msg = "Cloning ".$this->getShortHash($ref); | |
+ | |
+ $command = 'git clone --no-checkout %url% %path% && cd '.$flag.'%path% && git remote add composer %url% && git fetch composer'; | |
if ($gitVersion && version_compare($gitVersion, '2.3.0-rc0', '>=')) { | |
$this->io->writeError('', true, IOInterface::DEBUG); | |
$this->io->writeError(sprintf(' Cloning to cache at %s', ProcessExecutor::escape($cachePath)), true, IOInterface::DEBUG); | |
try { | |
- $this->gitUtil->syncMirror($url, $cachePath); | |
+ $this->gitUtil->fetchRefOrSyncMirror($url, $cachePath, $ref); | |
if (is_dir($cachePath)) { | |
- $cacheOptions = sprintf('--dissociate --reference %s ', ProcessExecutor::escape($cachePath)); | |
+ $command = | |
+ 'git clone --no-checkout %cachePath% %path% --dissociate --reference %cachePath% ' | |
+ . '&& cd '.$flag.'%path% ' | |
+ . '&& git remote set-url origin %url% && git remote add composer %url%'; | |
$msg = "Cloning ".$this->getShortHash($ref).' from cache'; | |
} | |
} catch (\RuntimeException $e) { | |
} | |
} | |
- $command = 'git clone --no-checkout %s %s '.$cacheOptions.'&& cd '.$flag.'%2$s && git remote add composer %1$s && git fetch composer'; | |
$this->io->writeError($msg); | |
- $commandCallable = function ($url) use ($ref, $path, $command) { | |
- return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($path), ProcessExecutor::escape($ref)); | |
+ $commandCallable = function ($url) use ($path, $command, $cachePath) { | |
+ return str_replace( | |
+ array('%url%', '%path%', '%cachePath%'), | |
+ array( | |
+ ProcessExecutor::escape($url), | |
+ ProcessExecutor::escape($path), | |
+ ProcessExecutor::escape($cachePath), | |
+ ), | |
+ $command | |
+ ); | |
}; | |
$this->gitUtil->runCommand($commandCallable, $url, $path, true); | |
@@ -107,10 +118,10 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface | |
$ref = $target->getSourceReference(); | |
$this->io->writeError(" Checking out ".$this->getShortHash($ref)); | |
- $command = 'git remote set-url composer %s && git rev-parse --quiet --verify %s^{commit} || (git fetch composer && git fetch --tags composer)'; | |
+ $command = 'git remote set-url composer %s && git rev-parse --quiet --verify %s || (git fetch composer && git fetch --tags composer)'; | |
$commandCallable = function ($url) use ($command, $ref) { | |
- return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($ref)); | |
+ return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($ref.'^{commit}')); | |
}; | |
$this->gitUtil->runCommand($commandCallable, $url, $path); | |
diff --git a/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php b/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php | |
index 09980e8..a472b84 100644 | |
--- a/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php | |
+++ b/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php | |
@@ -96,9 +96,7 @@ class PerforceDownloader extends VcsDownloader | |
*/ | |
protected function getCommitLogs($fromReference, $toReference, $path) | |
{ | |
- $commitLogs = $this->perforce->getCommitLogs($fromReference, $toReference); | |
- | |
- return $commitLogs; | |
+ return $this->perforce->getCommitLogs($fromReference, $toReference); | |
} | |
public function setPerforce($perforce) | |
diff --git a/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php b/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php | |
index b3c8c33..54d9718 100644 | |
--- a/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php | |
+++ b/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php | |
@@ -15,6 +15,7 @@ namespace Composer\Downloader; | |
use Composer\Package\PackageInterface; | |
use Composer\Util\Svn as SvnUtil; | |
use Composer\Repository\VcsRepository; | |
+use Composer\Util\ProcessExecutor; | |
/** | |
* @author Ben Bieker <[email protected]> | |
@@ -126,10 +127,17 @@ class SvnDownloader extends VcsDownloader | |
$changes = array_map(function ($elem) { | |
return ' '.$elem; | |
}, preg_split('{\s*\r?\n\s*}', $changes)); | |
- $this->io->writeError(' <error>The package has modified files:</error>'); | |
+ $countChanges = count($changes); | |
+ $this->io->writeError(sprintf(' <error>The package has modified file%s:</error>', $countChanges === 1 ? '' : 's')); | |
$this->io->writeError(array_slice($changes, 0, 10)); | |
- if (count($changes) > 10) { | |
- $this->io->writeError(' <info>'.count($changes) - 10 . ' more files modified, choose "v" to view the full list</info>'); | |
+ if ($countChanges > 10) { | |
+ $remaingChanges = $countChanges - 10; | |
+ $this->io->writeError( | |
+ sprintf( | |
+ ' <info>'.$remaingChanges.' more file%s modified, choose "v" to view the full list</info>', | |
+ $remaingChanges === 1 ? '' : 's' | |
+ ) | |
+ ); | |
} | |
while (true) { | |
@@ -164,22 +172,41 @@ class SvnDownloader extends VcsDownloader | |
protected function getCommitLogs($fromReference, $toReference, $path) | |
{ | |
if (preg_match('{.*@(\d+)$}', $fromReference) && preg_match('{.*@(\d+)$}', $toReference)) { | |
+ // retrieve the svn base url from the checkout folder | |
+ $command = sprintf('svn info --non-interactive --xml %s', ProcessExecutor::escape($path)); | |
+ if (0 !== $this->process->execute($command, $output, $path)) { | |
+ throw new \RuntimeException( | |
+ 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput() | |
+ ); | |
+ } | |
+ | |
+ $urlPattern = '#<url>(.*)</url>#'; | |
+ if (preg_match($urlPattern, $output, $matches)) { | |
+ $baseUrl = $matches[1]; | |
+ } else { | |
+ throw new \RuntimeException( | |
+ 'Unable to determine svn url for path '. $path | |
+ ); | |
+ } | |
+ | |
// strip paths from references and only keep the actual revision | |
$fromRevision = preg_replace('{.*@(\d+)$}', '$1', $fromReference); | |
$toRevision = preg_replace('{.*@(\d+)$}', '$1', $toReference); | |
$command = sprintf('svn log -r%s:%s --incremental', $fromRevision, $toRevision); | |
- if (0 !== $this->process->execute($command, $output, $path)) { | |
+ $util = new SvnUtil($baseUrl, $this->io, $this->config); | |
+ $util->setCacheCredentials($this->cacheCredentials); | |
+ try { | |
+ return $util->executeLocal($command, $path, null, $this->io->isVerbose()); | |
+ } catch (\RuntimeException $e) { | |
throw new \RuntimeException( | |
- 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput() | |
+ 'Failed to execute ' . $command . "\n\n".$e->getMessage() | |
); | |
} | |
- } else { | |
- $output = "Could not retrieve changes between $fromReference and $toReference due to missing revision information"; | |
} | |
- return $output; | |
+ return "Could not retrieve changes between $fromReference and $toReference due to missing revision information"; | |
} | |
protected function discardChanges($path) | |
diff --git a/vendor/composer/composer/src/Composer/Factory.php b/vendor/composer/composer/src/Composer/Factory.php | |
index 42be783..a68586f 100644 | |
--- a/vendor/composer/composer/src/Composer/Factory.php | |
+++ b/vendor/composer/composer/src/Composer/Factory.php | |
@@ -204,7 +204,7 @@ class Factory | |
if ($composerAuthEnv = getenv('COMPOSER_AUTH')) { | |
$authData = json_decode($composerAuthEnv, true); | |
- if (is_null($authData)) { | |
+ if (null === $authData) { | |
throw new \UnexpectedValueException('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object'); | |
} | |
@@ -238,7 +238,7 @@ class Factory | |
public static function createOutput() | |
{ | |
$styles = self::createAdditionalStyles(); | |
- $formatter = new OutputFormatter(null, $styles); | |
+ $formatter = new OutputFormatter(false, $styles); | |
return new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, null, $formatter); | |
} | |
@@ -437,7 +437,7 @@ class Factory | |
{ | |
$composer = null; | |
try { | |
- $composer = self::createComposer($io, $config->get('home') . '/composer.json', $disablePlugins, $config->get('home'), $fullLoad); | |
+ $composer = $this->createComposer($io, $config->get('home') . '/composer.json', $disablePlugins, $config->get('home'), $fullLoad); | |
} catch (\Exception $e) { | |
$io->writeError('Failed to initialize global composer: '.$e->getMessage(), true, IOInterface::DEBUG); | |
} | |
diff --git a/vendor/composer/composer/src/Composer/IO/ConsoleIO.php b/vendor/composer/composer/src/Composer/IO/ConsoleIO.php | |
index acb8a85..bef7cea 100644 | |
--- a/vendor/composer/composer/src/Composer/IO/ConsoleIO.php | |
+++ b/vendor/composer/composer/src/Composer/IO/ConsoleIO.php | |
@@ -12,11 +12,12 @@ | |
namespace Composer\IO; | |
+use Composer\Question\StrictConfirmationQuestion; | |
+use Symfony\Component\Console\Helper\HelperSet; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\ConsoleOutputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
-use Symfony\Component\Console\Helper\HelperSet; | |
-use Composer\Question\StrictConfirmationQuestion; | |
+use Symfony\Component\Console\Question\ChoiceQuestion; | |
use Symfony\Component\Console\Question\Question; | |
/** | |
@@ -281,11 +282,23 @@ class ConsoleIO extends BaseIO | |
*/ | |
public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false) | |
{ | |
- if ($this->isInteractive()) { | |
- return $this->helperSet->get('dialog')->select($this->getErrorOutput(), $question, $choices, $default, $attempts, $errorMessage, $multiselect); | |
+ /** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */ | |
+ $helper = $this->helperSet->get('question'); | |
+ $question = new ChoiceQuestion($question, $choices, $default); | |
+ $question->setMaxAttempts($attempts ?: null); // IOInterface requires false, and Question requires null or int | |
+ $question->setErrorMessage($errorMessage); | |
+ $question->setMultiselect($multiselect); | |
+ | |
+ $result = $helper->ask($this->input, $this->getErrorOutput(), $question); | |
+ | |
+ $results = array(); | |
+ foreach ($choices as $index => $choice) { | |
+ if (in_array($choice, $result, true)) { | |
+ $results[] = (string) $index; | |
+ } | |
} | |
- return $default; | |
+ return $results; | |
} | |
/** | |
diff --git a/vendor/composer/composer/src/Composer/Installer.php b/vendor/composer/composer/src/Composer/Installer.php | |
index f86cfcf..dbdcb04 100644 | |
--- a/vendor/composer/composer/src/Composer/Installer.php | |
+++ b/vendor/composer/composer/src/Composer/Installer.php | |
@@ -125,7 +125,8 @@ class Installer | |
* @var array|null | |
*/ | |
protected $updateWhitelist = null; | |
- protected $whitelistDependencies = false; | |
+ protected $whitelistDependencies = false; // TODO 2.0 rename to whitelistTransitiveDependencies | |
+ protected $whitelistAllDependencies = false; | |
/** | |
* @var SuggestedPackagesReporter | |
@@ -766,7 +767,7 @@ class Installer | |
// is this a plugin or a dependency of a plugin? | |
if ($isPlugin || count(array_intersect($package->getNames(), $pluginRequires))) { | |
// get the package's requires, but filter out any platform requirements or 'composer-plugin-api' | |
- $requires = array_filter(array_keys($package->getRequires()), function($req) { | |
+ $requires = array_filter(array_keys($package->getRequires()), function ($req) { | |
return $req !== 'composer-plugin-api' && !preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $req); | |
}); | |
@@ -1206,7 +1207,7 @@ class Installer | |
if (preg_match('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com)/}i', $package->getDistUrl())) { | |
$package->setDistReference($reference); | |
$package->setDistUrl(preg_replace('{(?<=/)[a-f0-9]{40}(?=/|$)}i', $reference, $package->getDistUrl())); | |
- } else if ($package->getDistReference()) { // update the dist reference if there was one, but if none was provided ignore it | |
+ } elseif ($package->getDistReference()) { // update the dist reference if there was one, but if none was provided ignore it | |
$package->setDistReference($reference); | |
} | |
} | |
@@ -1283,7 +1284,7 @@ class Installer | |
* | |
* Packages which are listed as requirements in the root package will be | |
* skipped including their dependencies, unless they are listed in the | |
- * update whitelist themselves. | |
+ * update whitelist themselves or $whitelistAllDependencies is true. | |
* | |
* @param RepositoryInterface $localOrLockRepo Use the locked repo if available, otherwise installed repo will do | |
* As we want the most accurate package list to work with, and installed | |
@@ -1305,8 +1306,10 @@ class Installer | |
} | |
$skipPackages = array(); | |
- foreach ($rootRequires as $require) { | |
- $skipPackages[$require->getTarget()] = true; | |
+ if (!$this->whitelistAllDependencies) { | |
+ foreach ($rootRequires as $require) { | |
+ $skipPackages[$require->getTarget()] = true; | |
+ } | |
} | |
$pool = new Pool('dev'); | |
@@ -1351,7 +1354,7 @@ class Installer | |
$seen[$package->getId()] = true; | |
$this->updateWhitelist[$package->getName()] = true; | |
- if (!$this->whitelistDependencies) { | |
+ if (!$this->whitelistDependencies && !$this->whitelistAllDependencies) { | |
continue; | |
} | |
@@ -1652,14 +1655,41 @@ class Installer | |
} | |
/** | |
- * Should dependencies of whitelisted packages be updated recursively? | |
+ * @deprecated use setWhitelistTransitiveDependencies instead | |
+ */ | |
+ public function setWhitelistDependencies($updateDependencies = true) | |
+ { | |
+ return $this->setWhitelistTransitiveDependencies($updateDependencies); | |
+ } | |
+ | |
+ /** | |
+ * Should dependencies of whitelisted packages (but not direct dependencies) be updated? | |
* | |
- * @param bool $updateDependencies | |
+ * This will NOT whitelist any dependencies that are also directly defined | |
+ * in the root package. | |
+ * | |
+ * @param bool $updateTransitiveDependencies | |
* @return Installer | |
*/ | |
- public function setWhitelistDependencies($updateDependencies = true) | |
+ public function setWhitelistTransitiveDependencies($updateTransitiveDependencies = true) | |
+ { | |
+ $this->whitelistDependencies = (bool) $updateTransitiveDependencies; | |
+ | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Should all dependencies of whitelisted packages be updated recursively? | |
+ * | |
+ * This will whitelist any dependencies of the whitelisted packages, including | |
+ * those defined in the root package. | |
+ * | |
+ * @param bool $updateAllDependencies | |
+ * @return Installer | |
+ */ | |
+ public function setWhitelistAllDependencies($updateAllDependencies = true) | |
{ | |
- $this->whitelistDependencies = (bool) $updateDependencies; | |
+ $this->whitelistAllDependencies = (bool) $updateAllDependencies; | |
return $this; | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php b/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php | |
index 266360d..a61ea86 100644 | |
--- a/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php | |
+++ b/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php | |
@@ -194,21 +194,14 @@ class BinaryInstaller | |
$proxyCode = <<<PROXY | |
#!/usr/bin/env sh | |
-dir=$(d=\${0%[/\\\\]*}; cd "\$d" > /dev/null; cd $binDir && pwd) | |
- | |
-# See if we are running in Cygwin by checking for cygpath program | |
-if command -v 'cygpath' >/dev/null 2>&1; then | |
- # Cygwin paths start with /cygdrive/ which will break windows PHP, | |
- # so we need to translate the dir path to windows format. However | |
- # we could be using cygwin PHP which does not require this, so we | |
- # test if the path to PHP starts with /cygdrive/ rather than /usr/bin | |
- if [[ $(which php) == /cygdrive/* ]]; then | |
- dir=$(cygpath -m "\$dir"); | |
- fi | |
+dir=\$(cd "\${0%[/\\\\]*}" > /dev/null; cd $binDir && pwd) | |
+ | |
+if [ -d /proc/cygdrive ] && [[ \$(which php) == \$(readlink -n /proc/cygdrive)/* ]]; then | |
+ # We are in Cgywin using Windows php, so the path must be translated | |
+ dir=\$(cygpath -m "\$dir"); | |
fi | |
-dir=$(echo \$dir | sed 's/ /\ /g') | |
-"\${dir}/$binFile" "$@" | |
+"\${dir}/$binFile" "\$@" | |
PROXY; | |
diff --git a/vendor/composer/composer/src/Composer/Json/JsonFile.php b/vendor/composer/composer/src/Composer/Json/JsonFile.php | |
index 1a33992..0557847 100644 | |
--- a/vendor/composer/composer/src/Composer/Json/JsonFile.php | |
+++ b/vendor/composer/composer/src/Composer/Json/JsonFile.php | |
@@ -223,9 +223,7 @@ class JsonFile | |
return $json; | |
} | |
- $result = JsonFormatter::format($json, $unescapeUnicode, $unescapeSlashes); | |
- | |
- return $result; | |
+ return JsonFormatter::format($json, $unescapeUnicode, $unescapeSlashes); | |
} | |
/** | |
diff --git a/vendor/composer/composer/src/Composer/Json/JsonManipulator.php b/vendor/composer/composer/src/Composer/Json/JsonManipulator.php | |
index f929732..cdd22c8 100644 | |
--- a/vendor/composer/composer/src/Composer/Json/JsonManipulator.php | |
+++ b/vendor/composer/composer/src/Composer/Json/JsonManipulator.php | |
@@ -417,7 +417,7 @@ class JsonManipulator | |
{ | |
$decoded = JsonFile::parseJson($this->contents); | |
- if (!isset($decoded[$key])) { | |
+ if (!array_key_exists($key, $decoded)) { | |
return true; | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php b/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php | |
index b9c81cd..3e2b25d 100644 | |
--- a/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php | |
+++ b/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php | |
@@ -70,9 +70,9 @@ class HgExcludeFilter extends BaseExcludeFilter | |
if ($this->patternMode == self::HG_IGNORE_GLOB) { | |
return $this->patternFromGlob($line); | |
- } else { | |
- return $this->patternFromRegex($line); | |
} | |
+ | |
+ return $this->patternFromRegex($line); | |
} | |
/** | |
diff --git a/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php b/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php | |
index f7e6070..303cc3c 100644 | |
--- a/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php | |
+++ b/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php | |
@@ -65,13 +65,10 @@ class ArrayLoader implements LoaderInterface | |
} | |
if (isset($config['bin'])) { | |
- if (!is_array($config['bin'])) { | |
- throw new \UnexpectedValueException('Package '.$config['name'].'\'s bin key should be an array, '.gettype($config['bin']).' given.'); | |
- } | |
- foreach ($config['bin'] as $key => $bin) { | |
+ foreach ((array) $config['bin'] as $key => $bin) { | |
$config['bin'][$key] = ltrim($bin, '/'); | |
} | |
- $package->setBinaries($config['bin']); | |
+ $package->setBinaries((array) $config['bin']); | |
} | |
if (isset($config['installation-source'])) { | |
diff --git a/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php b/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php | |
index b0c2543..83b27aa 100644 | |
--- a/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php | |
+++ b/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php | |
@@ -17,6 +17,7 @@ use Composer\Package\BasePackage; | |
use Composer\Semver\Constraint\Constraint; | |
use Composer\Package\Version\VersionParser; | |
use Composer\Repository\PlatformRepository; | |
+use Composer\Spdx\SpdxLicenses; | |
/** | |
* @author Jordi Boggiano <[email protected]> | |
@@ -77,27 +78,83 @@ class ValidatingArrayLoader implements LoaderInterface | |
$this->validateRegex('type', '[A-Za-z0-9-]+'); | |
$this->validateString('target-dir'); | |
$this->validateArray('extra'); | |
- $this->validateFlatArray('bin'); | |
+ | |
+ if (isset($this->config['bin'])) { | |
+ if (is_string($this->config['bin'])) { | |
+ $this->validateString('bin'); | |
+ } else { | |
+ $this->validateFlatArray('bin'); | |
+ } | |
+ } | |
+ | |
$this->validateArray('scripts'); // TODO validate event names & listener syntax | |
$this->validateString('description'); | |
$this->validateUrl('homepage'); | |
$this->validateFlatArray('keywords', '[\p{N}\p{L} ._-]+'); | |
+ $releaseDate = null; | |
+ $this->validateString('time'); | |
+ if (!empty($this->config['time'])) { | |
+ try { | |
+ $releaseDate = new \DateTime($this->config['time'], new \DateTimeZone('UTC')); | |
+ } catch (\Exception $e) { | |
+ $this->errors[] = 'time : invalid value ('.$this->config['time'].'): '.$e->getMessage(); | |
+ unset($this->config['time']); | |
+ } | |
+ } | |
+ | |
if (isset($this->config['license'])) { | |
if (is_string($this->config['license'])) { | |
$this->validateRegex('license', '[A-Za-z0-9+. ()-]+'); | |
} else { | |
$this->validateFlatArray('license', '[A-Za-z0-9+. ()-]+'); | |
} | |
- } | |
- $this->validateString('time'); | |
- if (!empty($this->config['time'])) { | |
- try { | |
- $date = new \DateTime($this->config['time'], new \DateTimeZone('UTC')); | |
- } catch (\Exception $e) { | |
- $this->errors[] = 'time : invalid value ('.$this->config['time'].'): '.$e->getMessage(); | |
- unset($this->config['time']); | |
+ if (is_array($this->config['license']) || is_string($this->config['license'])) { | |
+ $licenses = (array) $this->config['license']; | |
+ | |
+ // strip proprietary since it's not a valid SPDX identifier, but is accepted by composer | |
+ foreach ($licenses as $key => $license) { | |
+ if ('proprietary' === $license) { | |
+ unset($licenses[$key]); | |
+ } | |
+ } | |
+ | |
+ $licenseValidator = new SpdxLicenses(); | |
+ if (count($licenses) === 1 && !$licenseValidator->validate($licenses) && $licenseValidator->validate(trim($licenses[0]))) { | |
+ $this->warnings[] = sprintf( | |
+ 'License %s must not contain extra spaces, make sure to trim it.', | |
+ json_encode($this->config['license']) | |
+ ); | |
+ } elseif (array() !== $licenses && !$licenseValidator->validate($licenses)) { | |
+ $this->warnings[] = sprintf( | |
+ 'License %s is not a valid SPDX license identifier, see https://spdx.org/licenses/ if you use an open license.' . PHP_EOL . | |
+ 'If the software is closed-source, you may use "proprietary" as license.', | |
+ json_encode($this->config['license']) | |
+ ); | |
+ } else if (!$releaseDate || $releaseDate->format('Y-m-d H:i:s') >= '2018-01-20 00:00:00') { // only warn for deprecations for releases/branches that follow the introduction of deprecated licenses | |
+ foreach ($licenses as $license) { | |
+ $spdxLicense = $licenseValidator->getLicenseByIdentifier($license); | |
+ if ($spdxLicense && $spdxLicense[3]) { | |
+ if (preg_match('{^[AL]?GPL-[123](\.[01])?\+$}i', $license)) { | |
+ $this->warnings[] = sprintf( | |
+ 'License "%s" is a deprecated SPDX license identifier, use "'.str_replace('+', '', $license).'-or-later" instead', | |
+ $license | |
+ ); | |
+ } elseif (preg_match('{^[AL]?GPL-[123](\.[01])?$}i', $license)) { | |
+ $this->warnings[] = sprintf( | |
+ 'License "%s" is a deprecated SPDX license identifier, use "'.$license.'-only" or "'.$license.'-or-later" instead', | |
+ $license | |
+ ); | |
+ } else { | |
+ $this->warnings[] = sprintf( | |
+ 'License "%s" is a deprecated SPDX license identifier, see https://spdx.org/licenses/', | |
+ $license | |
+ ); | |
+ } | |
+ } | |
+ } | |
+ } | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Package/Locker.php b/vendor/composer/composer/src/Composer/Package/Locker.php | |
index 93e5ca6..fe2616c 100644 | |
--- a/vendor/composer/composer/src/Composer/Package/Locker.php | |
+++ b/vendor/composer/composer/src/Composer/Package/Locker.php | |
@@ -102,7 +102,7 @@ class Locker | |
} | |
/** | |
- * Checks whether locker were been locked (lockfile found). | |
+ * Checks whether locker has been locked (lockfile found). | |
* | |
* @return bool | |
*/ | |
diff --git a/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php b/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php | |
index 060bf26..02297a1 100644 | |
--- a/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php | |
+++ b/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php | |
@@ -88,7 +88,7 @@ class VersionGuesser | |
private function postprocess(array $versionData) | |
{ | |
- if ('-dev' === substr($versionData['version'], -4)) { | |
+ if ('-dev' === substr($versionData['version'], -4) && preg_match('{\.9{7}}', $versionData['version'])) { | |
$versionData['pretty_version'] = preg_replace('{(\.9{7})+}', '.x', $versionData['version']); | |
} | |
@@ -120,9 +120,6 @@ class VersionGuesser | |
$version = $this->versionParser->normalizeBranch($match[1]); | |
$prettyVersion = 'dev-' . $match[1]; | |
$isFeatureBranch = 0 === strpos($version, 'dev-'); | |
- if ('9999999-dev' === $version) { | |
- $version = $prettyVersion; | |
- } | |
} | |
if ($match[2]) { | |
diff --git a/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php b/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php | |
index 54d7f09..22b6dad 100644 | |
--- a/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php | |
+++ b/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php | |
@@ -54,7 +54,7 @@ class VersionParser extends SemverVersionParser | |
} | |
if (strpos($pair, ' ')) { | |
- list($name, $version) = explode(" ", $pair, 2); | |
+ list($name, $version) = explode(' ', $pair, 2); | |
$result[] = array('name' => $name, 'version' => $version); | |
} else { | |
$result[] = array('name' => $pair); | |
diff --git a/vendor/composer/composer/src/Composer/Plugin/Capability/CommandProvider.php b/vendor/composer/composer/src/Composer/Plugin/Capability/CommandProvider.php | |
index 0debd20..0f94bf3 100644 | |
--- a/vendor/composer/composer/src/Composer/Plugin/Capability/CommandProvider.php | |
+++ b/vendor/composer/composer/src/Composer/Plugin/Capability/CommandProvider.php | |
@@ -25,7 +25,7 @@ namespace Composer\Plugin\Capability; | |
interface CommandProvider extends Capability | |
{ | |
/** | |
- * Retreives an array of commands | |
+ * Retrieves an array of commands | |
* | |
* @return \Composer\Command\BaseCommand[] | |
*/ | |
diff --git a/vendor/composer/composer/src/Composer/Repository/BaseRepository.php b/vendor/composer/composer/src/Composer/Repository/BaseRepository.php | |
index 37321c7..f5233e1 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/BaseRepository.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/BaseRepository.php | |
@@ -78,7 +78,7 @@ abstract class BaseRepository implements RepositoryInterface | |
foreach ($links as $link) { | |
foreach ($needles as $needle) { | |
if ($link->getTarget() === $needle) { | |
- if (is_null($constraint) || (($link->getConstraint()->matches($constraint) === !$invert))) { | |
+ if ($constraint === null || ($link->getConstraint()->matches($constraint) === !$invert)) { | |
// already displayed this node's dependencies, cutting short | |
if (in_array($link->getSource(), $packagesInTree)) { | |
$results[$link->getSource()] = array($package, $link, false); | |
diff --git a/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php b/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php | |
index 2f0d19d..60ab0df 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php | |
@@ -677,7 +677,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito | |
} | |
// TODO use scarier wording once we know for sure it doesn't do false positives anymore | |
- throw new RepositorySecurityException('The contents of '.$filename.' do not match its signature. This could indicate a man-in-the-middle attack. Try running composer again and report this if you think it is a mistake.'); | |
+ throw new RepositorySecurityException('The contents of '.$filename.' do not match its signature. This could indicate a man-in-the-middle attack or e.g. antivirus software corrupting files. Try running composer again and report this if you think it is a mistake.'); | |
} | |
$data = JsonFile::parseJson($json, $filename); | |
diff --git a/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php b/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php | |
index 112e3da..bde55aa 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php | |
@@ -83,6 +83,10 @@ class FilesystemRepository extends WritableArrayRepository | |
$data[] = $dumper->dump($package); | |
} | |
+ usort($data, function ($a, $b) { | |
+ return strcmp($a['name'], $b['name']); | |
+ }); | |
+ | |
$this->file->write($data); | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Repository/Pear/ChannelRest10Reader.php b/vendor/composer/composer/src/Composer/Repository/Pear/ChannelRest10Reader.php | |
index 5b5fd78..92498da 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/Pear/ChannelRest10Reader.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/Pear/ChannelRest10Reader.php | |
@@ -158,8 +158,7 @@ class ChannelRest10Reader extends BaseChannelReader | |
$depthPath = '/r/' . strtolower($packageName) . '/deps.' . $version . '.txt'; | |
$content = $this->requestContent($baseUrl, $depthPath); | |
$dependencyArray = unserialize($content); | |
- $result = $dependencyReader->buildDependencyInfo($dependencyArray); | |
- return $result; | |
+ return $dependencyReader->buildDependencyInfo($dependencyArray); | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php b/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php | |
index 02d40e9..da5c9ab 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php | |
@@ -24,7 +24,7 @@ use Composer\Util\Silencer; | |
*/ | |
class PlatformRepository extends ArrayRepository | |
{ | |
- const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[^/]+)$}i'; | |
+ const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[^/ ]+)$}i'; | |
private $versionParser; | |
diff --git a/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php b/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php | |
index 5e38f96..ca479a7 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php | |
@@ -119,12 +119,14 @@ class RepositoryFactory | |
$rm->setRepositoryClass('package', 'Composer\Repository\PackageRepository'); | |
$rm->setRepositoryClass('pear', 'Composer\Repository\PearRepository'); | |
$rm->setRepositoryClass('git', 'Composer\Repository\VcsRepository'); | |
+ $rm->setRepositoryClass('git-bitbucket', 'Composer\Repository\VcsRepository'); | |
$rm->setRepositoryClass('github', 'Composer\Repository\VcsRepository'); | |
$rm->setRepositoryClass('gitlab', 'Composer\Repository\VcsRepository'); | |
$rm->setRepositoryClass('svn', 'Composer\Repository\VcsRepository'); | |
$rm->setRepositoryClass('fossil', 'Composer\Repository\VcsRepository'); | |
$rm->setRepositoryClass('perforce', 'Composer\Repository\VcsRepository'); | |
$rm->setRepositoryClass('hg', 'Composer\Repository\VcsRepository'); | |
+ $rm->setRepositoryClass('hg-bitbucket', 'Composer\Repository\VcsRepository'); | |
$rm->setRepositoryClass('artifact', 'Composer\Repository\ArtifactRepository'); | |
$rm->setRepositoryClass('path', 'Composer\Repository\PathRepository'); | |
diff --git a/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php b/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php | |
index e0abd10..7af97ad 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php | |
@@ -34,54 +34,74 @@ class FossilDriver extends VcsDriver | |
*/ | |
public function initialize() | |
{ | |
- if (Filesystem::isLocalPath($this->url)) { | |
+ // Make sure fossil is installed and reachable. | |
+ $this->checkFossil(); | |
+ | |
+ // Ensure we are allowed to use this URL by config. | |
+ $this->config->prohibitUrlByConfig($this->url, $this->io); | |
+ | |
+ // Only if url points to a locally accessible directory, assume it's the checkout directory. | |
+ // Otherwise, it should be something fossil can clone from. | |
+ if (Filesystem::isLocalPath($this->url) && is_dir($this->url)) { | |
$this->checkoutDir = $this->url; | |
} else { | |
- $this->repoFile = $this->config->get('cache-repo-dir') . '/' . preg_replace('{[^a-z0-9]}i', '-', $this->url) . '.fossil'; | |
- $this->checkoutDir = $this->config->get('cache-vcs-dir') . '/' . preg_replace('{[^a-z0-9]}i', '-', $this->url) . '/'; | |
+ $localName = preg_replace('{[^a-z0-9]}i', '-', $this->url); | |
+ $this->repoFile = $this->config->get('cache-repo-dir') . '/' . $localName . '.fossil'; | |
+ $this->checkoutDir = $this->config->get('cache-vcs-dir') . '/' . $localName . '/'; | |
- $fs = new Filesystem(); | |
- $fs->ensureDirectoryExists($this->checkoutDir); | |
+ $this->updateLocalRepo(); | |
+ } | |
- if (!is_writable(dirname($this->checkoutDir))) { | |
- throw new \RuntimeException('Can not clone '.$this->url.' to access package information. The "'.$this->checkoutDir.'" directory is not writable by the current user.'); | |
- } | |
+ $this->getTags(); | |
+ $this->getBranches(); | |
+ } | |
- // Ensure we are allowed to use this URL by config | |
- $this->config->prohibitUrlByConfig($this->url, $this->io); | |
+ /** | |
+ * Check that fossil can be invoked via command line. | |
+ */ | |
+ protected function checkFossil() | |
+ { | |
+ if (0 !== $this->process->execute('fossil version', $ignoredOutput)) { | |
+ throw new \RuntimeException("fossil was not found, check that it is installed and in your PATH env.\n\n" . $this->process->getErrorOutput()); | |
+ } | |
+ } | |
- // update the repo if it is a valid fossil repository | |
- if (is_file($this->repoFile) && is_dir($this->checkoutDir) && 0 === $this->process->execute('fossil info', $output, $this->checkoutDir)) { | |
- if (0 !== $this->process->execute('fossil pull', $output, $this->checkoutDir)) { | |
- $this->io->writeError('<error>Failed to update '.$this->url.', package information from this repository may be outdated ('.$this->process->getErrorOutput().')</error>'); | |
- } | |
- } else { | |
- // clean up directory and do a fresh clone into it | |
- $fs->removeDirectory($this->checkoutDir); | |
- $fs->remove($this->repoFile); | |
+ /** | |
+ * Clone or update existing local fossil repository. | |
+ */ | |
+ protected function updateLocalRepo() | |
+ { | |
+ $fs = new Filesystem(); | |
+ $fs->ensureDirectoryExists($this->checkoutDir); | |
- $fs->ensureDirectoryExists($this->checkoutDir); | |
+ if (!is_writable(dirname($this->checkoutDir))) { | |
+ throw new \RuntimeException('Can not clone '.$this->url.' to access package information. The "'.$this->checkoutDir.'" directory is not writable by the current user.'); | |
+ } | |
+ | |
+ // update the repo if it is a valid fossil repository | |
+ if (is_file($this->repoFile) && is_dir($this->checkoutDir) && 0 === $this->process->execute('fossil info', $output, $this->checkoutDir)) { | |
+ if (0 !== $this->process->execute('fossil pull', $output, $this->checkoutDir)) { | |
+ $this->io->writeError('<error>Failed to update '.$this->url.', package information from this repository may be outdated ('.$this->process->getErrorOutput().')</error>'); | |
+ } | |
+ } else { | |
+ // clean up directory and do a fresh clone into it | |
+ $fs->removeDirectory($this->checkoutDir); | |
+ $fs->remove($this->repoFile); | |
- if (0 !== $this->process->execute(sprintf('fossil clone %s %s', ProcessExecutor::escape($this->url), ProcessExecutor::escape($this->repoFile)), $output)) { | |
- $output = $this->process->getErrorOutput(); | |
+ $fs->ensureDirectoryExists($this->checkoutDir); | |
- if (0 !== $this->process->execute('fossil version', $ignoredOutput)) { | |
- throw new \RuntimeException('Failed to clone '.$this->url.', fossil was not found, check that it is installed and in your PATH env.' . "\n\n" . $this->process->getErrorOutput()); | |
- } | |
+ if (0 !== $this->process->execute(sprintf('fossil clone %s %s', ProcessExecutor::escape($this->url), ProcessExecutor::escape($this->repoFile)), $output)) { | |
+ $output = $this->process->getErrorOutput(); | |
- throw new \RuntimeException('Failed to clone '.$this->url.' to repository ' . $this->repoFile . "\n\n" .$output); | |
- } | |
+ throw new \RuntimeException('Failed to clone '.$this->url.' to repository ' . $this->repoFile . "\n\n" .$output); | |
+ } | |
- if (0 !== $this->process->execute(sprintf('fossil open %s', ProcessExecutor::escape($this->repoFile)), $output, $this->checkoutDir)) { | |
- $output = $this->process->getErrorOutput(); | |
+ if (0 !== $this->process->execute(sprintf('fossil open %s', ProcessExecutor::escape($this->repoFile)), $output, $this->checkoutDir)) { | |
+ $output = $this->process->getErrorOutput(); | |
- throw new \RuntimeException('Failed to open repository '.$this->repoFile.' in ' . $this->checkoutDir . "\n\n" .$output); | |
- } | |
+ throw new \RuntimeException('Failed to open repository '.$this->repoFile.' in ' . $this->checkoutDir . "\n\n" .$output); | |
} | |
} | |
- | |
- $this->getTags(); | |
- $this->getBranches(); | |
} | |
/** | |
@@ -140,9 +160,10 @@ class FossilDriver extends VcsDriver | |
*/ | |
public function getChangeDate($identifier) | |
{ | |
- $this->process->execute(sprintf('fossil finfo composer.json | head -n 2 | tail -n 1 | awk \'{print $1}\''), $output, $this->checkoutDir); | |
+ $this->process->execute('fossil finfo -b -n 1 composer.json', $output, $this->checkoutDir); | |
+ list($ckout, $date, $message) = explode(' ', trim($output), 3); | |
- return new \DateTime(trim($output), new \DateTimeZone('UTC')); | |
+ return new \DateTime($date, new \DateTimeZone('UTC')); | |
} | |
/** | |
diff --git a/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php b/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php | |
index 0f2c957..0269f47 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php | |
@@ -216,10 +216,7 @@ class GitDriver extends VcsDriver | |
} | |
$process = new ProcessExecutor($io); | |
- if ($process->execute('git ls-remote --heads ' . ProcessExecutor::escape($url), $output) === 0) { | |
- return true; | |
- } | |
- return false; | |
+ return $process->execute('git ls-remote --heads ' . ProcessExecutor::escape($url), $output) === 0; | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php b/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php | |
index d1d6705..5c5c08c 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php | |
@@ -361,7 +361,9 @@ class GitHubDriver extends VcsDriver | |
} | |
} | |
$scopesFailed = array_diff($scopesNeeded, $scopesIssued); | |
- if (!$headers || count($scopesFailed)) { | |
+ // non-authenticated requests get no scopesNeeded, so ask for credentials | |
+ // authenticated requests which failed some scopes should ask for new credentials too | |
+ if (!$headers || !count($scopesNeeded) || count($scopesFailed)) { | |
$gitHubUtil->authorizeOAuthInteractively($this->originUrl, 'Your GitHub credentials are required to fetch private repository metadata (<info>'.$this->url.'</info>)'); | |
} | |
@@ -512,8 +514,8 @@ class GitHubDriver extends VcsDriver | |
{ | |
$headers = $this->remoteFilesystem->getLastHeaders(); | |
foreach ($headers as $header) { | |
- if (substr($header, 0, 5) === 'Link:') { | |
- $links = explode(',', substr($header, 5)); | |
+ if (preg_match('{^link:\s*(.+?)\s*$}i', $header, $match)) { | |
+ $links = explode(',', $match[1]); | |
foreach ($links as $link) { | |
if (preg_match('{<(.+?)>; *rel="next"}', $link, $match)) { | |
return $match[1]; | |
diff --git a/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php b/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php | |
index fb2b743..dcaf646 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php | |
@@ -261,6 +261,7 @@ class GitLabDriver extends VcsDriver | |
{ | |
$domainName = $this->originUrl; | |
$portNumber = (true === is_numeric($this->portNumber)) ? sprintf(':%s', $this->portNumber) : ''; | |
+ | |
return $this->scheme.'://'.$domainName.$portNumber.'/api/v4/projects/'.$this->urlEncodeAll($this->namespace).'%2F'.$this->urlEncodeAll($this->repository); | |
} | |
@@ -449,7 +450,6 @@ class GitLabDriver extends VcsDriver | |
*/ | |
public static function supports(IOInterface $io, Config $config, $url, $deep = false) | |
{ | |
- | |
if (!preg_match(self::URL_REGEX, $url, $match)) { | |
return false; | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php b/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php | |
index f9c6937..667f914 100644 | |
--- a/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php | |
+++ b/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php | |
@@ -87,9 +87,7 @@ class PerforceDriver extends VcsDriver | |
*/ | |
public function getBranches() | |
{ | |
- $branches = $this->perforce->getBranches(); | |
- | |
- return $branches; | |
+ return $this->perforce->getBranches(); | |
} | |
/** | |
@@ -97,9 +95,7 @@ class PerforceDriver extends VcsDriver | |
*/ | |
public function getTags() | |
{ | |
- $tags = $this->perforce->getTags(); | |
- | |
- return $tags; | |
+ return $this->perforce->getTags(); | |
} | |
/** | |
diff --git a/vendor/composer/composer/src/Composer/Util/ConfigValidator.php b/vendor/composer/composer/src/Composer/Util/ConfigValidator.php | |
index 9953e92..e5f64ec 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/ConfigValidator.php | |
+++ b/vendor/composer/composer/src/Composer/Util/ConfigValidator.php | |
@@ -18,7 +18,6 @@ use Composer\Package\Loader\InvalidPackageException; | |
use Composer\Json\JsonValidationException; | |
use Composer\IO\IOInterface; | |
use Composer\Json\JsonFile; | |
-use Composer\Spdx\SpdxLicenses; | |
/** | |
* Validates a composer configuration. | |
@@ -73,31 +72,7 @@ class ConfigValidator | |
} | |
// validate actual data | |
- if (!empty($manifest['license'])) { | |
- // strip proprietary since it's not a valid SPDX identifier, but is accepted by composer | |
- if (is_array($manifest['license'])) { | |
- foreach ($manifest['license'] as $key => $license) { | |
- if ('proprietary' === $license) { | |
- unset($manifest['license'][$key]); | |
- } | |
- } | |
- } | |
- | |
- $licenseValidator = new SpdxLicenses(); | |
- if ('proprietary' !== $manifest['license'] && array() !== $manifest['license'] && !$licenseValidator->validate($manifest['license']) && $licenseValidator->validate(trim($manifest['license']))) { | |
- $warnings[] = sprintf( | |
- 'License %s must not contain extra spaces, make sure to trim it.', | |
- json_encode($manifest['license']) | |
- ); | |
- } elseif ('proprietary' !== $manifest['license'] && array() !== $manifest['license'] && !$licenseValidator->validate($manifest['license'])) { | |
- $warnings[] = sprintf( | |
- 'License %s is not a valid SPDX license identifier, see https://spdx.org/licenses/ if you use an open license.' | |
- . PHP_EOL . | |
- 'If the software is closed-source, you may use "proprietary" as license.', | |
- json_encode($manifest['license']) | |
- ); | |
- } | |
- } else { | |
+ if (empty($manifest['license'])) { | |
$warnings[] = 'No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.'; | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Util/Filesystem.php b/vendor/composer/composer/src/Composer/Util/Filesystem.php | |
index 899e342..9e0e372 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/Filesystem.php | |
+++ b/vendor/composer/composer/src/Composer/Util/Filesystem.php | |
@@ -247,27 +247,44 @@ class Filesystem | |
*/ | |
public function copyThenRemove($source, $target) | |
{ | |
+ $this->copy($source, $target); | |
if (!is_dir($source)) { | |
- copy($source, $target); | |
$this->unlink($source); | |
return; | |
} | |
+ $this->removeDirectoryPhp($source); | |
+ } | |
+ | |
+ /** | |
+ * Copies a file or directory from $source to $target. | |
+ * | |
+ * @param $source | |
+ * @param $target | |
+ * @return bool | |
+ */ | |
+ public function copy($source, $target) | |
+ { | |
+ if (!is_dir($source)) { | |
+ return copy($source, $target); | |
+ } | |
+ | |
$it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS); | |
$ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST); | |
$this->ensureDirectoryExists($target); | |
+ $result = true; | |
foreach ($ri as $file) { | |
$targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName(); | |
if ($file->isDir()) { | |
$this->ensureDirectoryExists($targetPath); | |
} else { | |
- copy($file->getPathname(), $targetPath); | |
+ $result = $result && copy($file->getPathname(), $targetPath); | |
} | |
} | |
- $this->removeDirectoryPhp($source); | |
+ return $result; | |
} | |
public function rename($source, $target) | |
@@ -648,6 +665,7 @@ class Filesystem | |
* Stat cache should be cleared before to avoid accidentally reading wrong information from previous installs. | |
*/ | |
clearstatcache(true, $junction); | |
+ clearstatcache(false); | |
$stat = lstat($junction); | |
return !($stat['mode'] & 0xC000); | |
diff --git a/vendor/composer/composer/src/Composer/Util/Git.php b/vendor/composer/composer/src/Composer/Util/Git.php | |
index a6e199b..e4d6bd8 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/Git.php | |
+++ b/vendor/composer/composer/src/Composer/Util/Git.php | |
@@ -228,6 +228,21 @@ class Git | |
return true; | |
} | |
+ public function fetchRefOrSyncMirror($url, $dir, $ref) | |
+ { | |
+ if (is_dir($dir) && 0 === $this->process->execute('git rev-parse --git-dir', $output, $dir) && trim($output) === '.') { | |
+ $escapedRef = ProcessExecutor::escape($ref.'^{commit}'); | |
+ $exitCode = $this->process->execute(sprintf('git rev-parse --quiet --verify %s', $escapedRef), $output, $dir); | |
+ if ($exitCode === 0) { | |
+ return true; | |
+ } | |
+ } | |
+ | |
+ $this->syncMirror($url, $dir); | |
+ | |
+ return false; | |
+ } | |
+ | |
private function isAuthenticationFailure($url, &$match) | |
{ | |
if (!preg_match('{(https?://)([^/]+)(.*)$}i', $url, $match)) { | |
diff --git a/vendor/composer/composer/src/Composer/Util/Perforce.php b/vendor/composer/composer/src/Composer/Util/Perforce.php | |
index 364f239..fbd73b2 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/Perforce.php | |
+++ b/vendor/composer/composer/src/Composer/Util/Perforce.php | |
@@ -116,16 +116,15 @@ class Perforce | |
protected function executeCommand($command) | |
{ | |
- $this->commandResult = ""; | |
- $exit_code = $this->process->execute($command, $this->commandResult); | |
+ $this->commandResult = ''; | |
- return $exit_code; | |
+ return $this->process->execute($command, $this->commandResult); | |
} | |
public function getClient() | |
{ | |
if (!isset($this->p4Client)) { | |
- $cleanStreamName = str_replace('@', '', str_replace('/', '_', str_replace('//', '', $this->getStream()))); | |
+ $cleanStreamName = str_replace(array('//', '/', '@'), array('', '_', ''), $this->getStream()); | |
$this->p4Client = 'composer_perforce_' . $this->uniquePerforceClientName . '_' . $cleanStreamName; | |
} | |
@@ -189,9 +188,7 @@ class Perforce | |
public function getP4ClientSpec() | |
{ | |
- $p4clientSpec = $this->path . '/' . $this->getClient() . '.p4.spec'; | |
- | |
- return $p4clientSpec; | |
+ return $this->path . '/' . $this->getClient() . '.p4.spec'; | |
} | |
public function getUser() | |
@@ -246,13 +243,13 @@ class Perforce | |
} | |
return null; | |
- } else { | |
- $command = 'echo $' . $name; | |
- $this->executeCommand($command); | |
- $result = trim($this->commandResult); | |
- | |
- return $result; | |
} | |
+ | |
+ $command = 'echo $' . $name; | |
+ $this->executeCommand($command); | |
+ $result = trim($this->commandResult); | |
+ | |
+ return $result; | |
} | |
public function queryP4Password() | |
@@ -276,8 +273,7 @@ class Perforce | |
if ($useClient) { | |
$p4Command = $p4Command . '-c ' . $this->getClient() . ' '; | |
} | |
- $p4Command = $p4Command . '-p ' . $this->getPort() . ' '; | |
- $p4Command = $p4Command . $command; | |
+ $p4Command = $p4Command . '-p ' . $this->getPort() . ' ' . $command; | |
return $p4Command; | |
} | |
@@ -430,20 +426,20 @@ class Perforce | |
$path = $identifier. '/' . $file; | |
return $path; | |
- } else { | |
- $path = substr($identifier, 0, $index) . '/' . $file . substr($identifier, $index); | |
- $command = $this->generateP4Command(' files ' . $path, false); | |
- $this->executeCommand($command); | |
- $result = $this->commandResult; | |
- $index2 = strpos($result, 'no such file(s).'); | |
- if ($index2 === false) { | |
- $index3 = strpos($result, 'change'); | |
- if ($index3 !== false) { | |
- $phrase = trim(substr($result, $index3)); | |
- $fields = explode(' ', $phrase); | |
- | |
- return substr($identifier, 0, $index) . '/' . $file . '@' . $fields[1]; | |
- } | |
+ } | |
+ | |
+ $path = substr($identifier, 0, $index) . '/' . $file . substr($identifier, $index); | |
+ $command = $this->generateP4Command(' files ' . $path, false); | |
+ $this->executeCommand($command); | |
+ $result = $this->commandResult; | |
+ $index2 = strpos($result, 'no such file(s).'); | |
+ if ($index2 === false) { | |
+ $index3 = strpos($result, 'change'); | |
+ if ($index3 !== false) { | |
+ $phrase = trim(substr($result, $index3)); | |
+ $fields = explode(' ', $phrase); | |
+ | |
+ return substr($identifier, 0, $index) . '/' . $file . '@' . $fields[1]; | |
} | |
} | |
@@ -538,9 +534,8 @@ class Perforce | |
return null; | |
} | |
$fields = explode(' ', $changes); | |
- $changeList = $fields[1]; | |
- return $changeList; | |
+ return $fields[1]; | |
} | |
/** | |
@@ -562,9 +557,8 @@ class Perforce | |
$main = substr($fromReference, 0, $index) . '/...'; | |
$command = $this->generateP4Command('filelog ' . $main . '@' . $fromChangeList. ',' . $toChangeList); | |
$this->executeCommand($command); | |
- $result = $this->commandResult; | |
- return $result; | |
+ return $this->commandResult; | |
} | |
public function getFilesystem() | |
diff --git a/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php b/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php | |
index 1074b2f..5e40470 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php | |
+++ b/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php | |
@@ -12,9 +12,9 @@ | |
namespace Composer\Util; | |
+use Composer\IO\IOInterface; | |
use Symfony\Component\Process\Process; | |
use Symfony\Component\Process\ProcessUtils; | |
-use Composer\IO\IOInterface; | |
/** | |
* @author Robert Schönthal <[email protected]> | |
@@ -131,6 +131,60 @@ class ProcessExecutor | |
*/ | |
public static function escape($argument) | |
{ | |
- return ProcessUtils::escapeArgument($argument); | |
+ if (method_exists('Symfony\Component\Process\ProcessUtils', 'escapeArgument')) { | |
+ return ProcessUtils::escapeArgument($argument); | |
+ } | |
+ | |
+ return self::escapeArgument($argument); | |
+ } | |
+ | |
+ /** | |
+ * Copy of ProcessUtils::escapeArgument() that is removed in Symfony 4. | |
+ * | |
+ * @param string $argument | |
+ * | |
+ * @return string | |
+ */ | |
+ private static function escapeArgument($argument) | |
+ { | |
+ //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/composer/composer/src/Composer/Util/RemoteFilesystem.php b/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php | |
index f107599..6bc1505 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php | |
+++ b/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php | |
@@ -897,17 +897,7 @@ class RemoteFilesystem | |
if (!isset($defaults['ssl']['cafile']) && !isset($defaults['ssl']['capath'])) { | |
$result = CaBundle::getSystemCaRootBundlePath($caBundleLogger); | |
- if (preg_match('{^phar://}', $result)) { | |
- $hash = hash_file('sha256', $result); | |
- $targetPath = rtrim(sys_get_temp_dir(), '\\/') . '/composer-cacert-' . $hash . '.pem'; | |
- | |
- if (!file_exists($targetPath) || $hash !== hash_file('sha256', $targetPath)) { | |
- $this->streamCopy($result, $targetPath); | |
- chmod($targetPath, 0666); | |
- } | |
- | |
- $defaults['ssl']['cafile'] = $targetPath; | |
- } elseif (is_dir($result)) { | |
+ if (is_dir($result)) { | |
$defaults['ssl']['capath'] = $result; | |
} else { | |
$defaults['ssl']['cafile'] = $result; | |
@@ -933,24 +923,6 @@ class RemoteFilesystem | |
} | |
/** | |
- * Uses stream_copy_to_stream instead of copy to work around https://bugs.php.net/bug.php?id=64634 | |
- * | |
- * @param string $source | |
- * @param string $target | |
- */ | |
- private function streamCopy($source, $target) | |
- { | |
- $source = fopen($source, 'r'); | |
- $target = fopen($target, 'w+'); | |
- | |
- stream_copy_to_stream($source, $target); | |
- fclose($source); | |
- fclose($target); | |
- | |
- unset($source, $target); | |
- } | |
- | |
- /** | |
* Fetch certificate common name and fingerprint for validation of SAN. | |
* | |
* @todo Remove when PHP 5.6 is minimum supported version. | |
@@ -1041,10 +1013,7 @@ class RemoteFilesystem | |
// Path for a public download follows this pattern /{user}/{repo}/downloads/{whatever} | |
// {@link https://blog.bitbucket.org/2009/04/12/new-feature-downloads/} | |
$pathParts = explode('/', $path); | |
- if (count($pathParts) >= 4 && $pathParts[3] == 'downloads') { | |
- return true; | |
- } | |
- return false; | |
+ return count($pathParts) >= 4 && $pathParts[3] == 'downloads'; | |
} | |
} | |
diff --git a/vendor/composer/composer/src/Composer/Util/Silencer.php b/vendor/composer/composer/src/Composer/Util/Silencer.php | |
index 69a065d..dcb362b 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/Silencer.php | |
+++ b/vendor/composer/composer/src/Composer/Util/Silencer.php | |
@@ -36,7 +36,7 @@ class Silencer | |
$mask = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT; | |
} | |
$old = error_reporting(); | |
- array_push(self::$stack, $old); | |
+ self::$stack[] = $old; | |
error_reporting($old & ~$mask); | |
return $old; | |
diff --git a/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php b/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php | |
index 0a67644..b829008 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php | |
+++ b/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php | |
@@ -55,8 +55,8 @@ final class StreamContextFactory | |
} | |
// Remove proxy if URL matches no_proxy directive | |
- if (!empty($_SERVER['no_proxy']) && parse_url($url, PHP_URL_HOST)) { | |
- $pattern = new NoProxyPattern($_SERVER['no_proxy']); | |
+ if (!empty($_SERVER['NO_PROXY']) || !empty($_SERVER['no_proxy']) && parse_url($url, PHP_URL_HOST)) { | |
+ $pattern = new NoProxyPattern(!empty($_SERVER['no_proxy']) ? $_SERVER['no_proxy'] : $_SERVER['NO_PROXY']); | |
if ($pattern->test($url)) { | |
unset($proxy); | |
} | |
@@ -139,7 +139,7 @@ final class StreamContextFactory | |
$phpVersion = 'PHP ' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION; | |
} | |
- if (!isset($options['http']['header']) || false === strpos(strtolower(implode('', $options['http']['header'])), 'user-agent')) { | |
+ if (!isset($options['http']['header']) || false === stripos(implode('', $options['http']['header']), 'user-agent')) { | |
$options['http']['header'][] = sprintf( | |
'User-Agent: Composer/%s (%s; %s; %s%s)', | |
Composer::VERSION === '@package_version@' ? 'source' : Composer::VERSION, | |
diff --git a/vendor/composer/composer/src/Composer/Util/Svn.php b/vendor/composer/composer/src/Composer/Util/Svn.php | |
index 80f70fa..082ece6 100644 | |
--- a/vendor/composer/composer/src/Composer/Util/Svn.php | |
+++ b/vendor/composer/composer/src/Composer/Util/Svn.php | |
@@ -85,7 +85,7 @@ class Svn | |
} | |
/** | |
- * Execute an SVN command and try to fix up the process with credentials | |
+ * Execute an SVN remote command and try to fix up the process with credentials | |
* if necessary. | |
* | |
* @param string $command SVN command to run | |
@@ -103,6 +103,36 @@ class Svn | |
$this->config->prohibitUrlByConfig($url, $this->io); | |
$svnCommand = $this->getCommand($command, $url, $path); | |
+ | |
+ return $this->executeWithAuthRetry($svnCommand, $cwd, $path, $verbose); | |
+ } | |
+ | |
+ /** | |
+ * Execute an SVN local command and try to fix up the process with credentials | |
+ * if necessary. | |
+ * | |
+ * @param string $command SVN command to run | |
+ * @param string $path Path argument passed thru to the command | |
+ * @param string $cwd Working directory | |
+ * @param bool $verbose Output all output to the user | |
+ * | |
+ * @throws \RuntimeException | |
+ * @return string | |
+ */ | |
+ public function executeLocal($command, $path, $cwd = null, $verbose = false) | |
+ { | |
+ $svnCommand = sprintf('%s %s%s %s', | |
+ $command, | |
+ '--non-interactive ', | |
+ $this->getCredentialString(), | |
+ ProcessExecutor::escape($path) | |
+ ); | |
+ | |
+ return $this->executeWithAuthRetry($svnCommand, $cwd, $path, $verbose); | |
+ } | |
+ | |
+ private function executeWithAuthRetry($command, $cwd, $path, $verbose) | |
+ { | |
$output = null; | |
$io = $this->io; | |
$handler = function ($type, $buffer) use (&$output, $io, $verbose) { | |
@@ -117,7 +147,7 @@ class Svn | |
$io->writeError($buffer, false); | |
} | |
}; | |
- $status = $this->process->execute($svnCommand, $handler, $cwd); | |
+ $status = $this->process->execute($command, $handler, $cwd); | |
if (0 === $status) { | |
return $output; | |
} | |
@@ -140,7 +170,7 @@ class Svn | |
// try to authenticate if maximum quantity of tries not reached | |
if ($this->qtyAuthTries++ < self::MAX_QTY_AUTH_TRIES) { | |
// restart the process | |
- return $this->execute($command, $url, $cwd, $path, $verbose); | |
+ return $this->executeWithAuthRetry($command, $cwd, $path, $verbose); | |
} | |
throw new \RuntimeException( | |
diff --git a/vendor/composer/composer/src/Composer/Util/Url.php b/vendor/composer/composer/src/Composer/Util/Url.php | |
new file mode 100644 | |
index 0000000..f8d4b44 | |
--- /dev/null | |
+++ b/vendor/composer/composer/src/Composer/Util/Url.php | |
@@ -0,0 +1,56 @@ | |
+<?php | |
+ | |
+/* | |
+ * This file is part of Composer. | |
+ * | |
+ * (c) Nils Adermann <[email protected]> | |
+ * Jordi Boggiano <[email protected]> | |
+ * | |
+ * For the full copyright and license information, please view the LICENSE | |
+ * file that was distributed with this source code. | |
+ */ | |
+ | |
+namespace Composer\Util; | |
+ | |
+use Composer\Config; | |
+use Composer\IO\IOInterface; | |
+ | |
+/** | |
+ * @author Jordi Boggiano <[email protected]> | |
+ */ | |
+class Url | |
+{ | |
+ public static function updateDistReference(Config $config, $url, $ref) | |
+ { | |
+ $host = parse_url($url, PHP_URL_HOST); | |
+ | |
+ if ($host === 'api.github.com' || $host === 'github.com' || $host === 'www.github.com') { | |
+ if (preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/(zip|tar)ball/(.+)$}i', $url, $match)) { | |
+ // update legacy github archives to API calls with the proper reference | |
+ $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $ref; | |
+ } elseif (preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/archive/.+\.(zip|tar)(?:\.gz)?$}i', $url, $match)) { | |
+ // update current github web archives to API calls with the proper reference | |
+ $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $ref; | |
+ } elseif (preg_match('{^https?://api\.github\.com/repos/([^/]+)/([^/]+)/(zip|tar)ball(?:/.+)?$}i', $url, $match)) { | |
+ // update api archives to the proper reference | |
+ $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $ref; | |
+ } | |
+ } elseif ($host === 'bitbucket.org' || $host === 'www.bitbucket.org') { | |
+ if (preg_match('{^https?://(?:www\.)?bitbucket\.org/([^/]+)/([^/]+)/get/(.+)\.(zip|tar\.gz|tar\.bz2)$}i', $url, $match)) { | |
+ // update Bitbucket archives to the proper reference | |
+ $url = 'https://bitbucket.org/' . $match[1] . '/'. $match[2] . '/get/' . $ref . '.' . $match[4]; | |
+ } | |
+ } elseif ($host === 'gitlab.com' || $host === 'www.gitlab.com') { | |
+ if (preg_match('{^https?://(?:www\.)?gitlab\.com/api/v[34]/projects/([^/]+)/repository/archive\.(zip|tar\.gz|tar\.bz2|tar)\?sha=.+$}i', $url, $match)) { | |
+ // update Gitlab archives to the proper reference | |
+ $url = 'https://gitlab.com/api/v4/projects/' . $match[1] . '/repository/archive.' . $match[2] . '?sha=' . $ref; | |
+ } | |
+ } elseif (in_array($host, $config->get('github-domains'), true)) { | |
+ $url = preg_replace('{(/repos/[^/]+/[^/]+/(zip|tar)ball)(?:/.+)?$}i', '$1/'.$ref, $url); | |
+ } elseif (in_array($host, $config->get('gitlab-domains'), true)) { | |
+ $url = preg_replace('{(/api/v[34]/projects/[^/]+/repository/archive\.(?:zip|tar\.gz|tar\.bz2|tar)\?sha=).+$}i', '${1}'.$ref, $url); | |
+ } | |
+ | |
+ return $url; | |
+ } | |
+} | |
diff --git a/vendor/composer/composer/src/Composer/XdebugHandler.php b/vendor/composer/composer/src/Composer/XdebugHandler.php | |
index e9d719a..7031e6f 100644 | |
--- a/vendor/composer/composer/src/Composer/XdebugHandler.php | |
+++ b/vendor/composer/composer/src/Composer/XdebugHandler.php | |
@@ -203,7 +203,7 @@ class XdebugHandler | |
* Returns true if the restart environment variables were set | |
* | |
* @param bool $additional Whether there were additional inis | |
- * @param array $iniPaths Locations reported by the current process | |
+ * @param array $iniPaths Locations reported by the current process | |
* | |
* @return bool | |
*/ | |
diff --git a/vendor/composer/spdx-licenses/src/SpdxLicenses.php b/vendor/composer/spdx-licenses/src/SpdxLicenses.php | |
index 985b6cb..db6f7ef 100644 | |
--- a/vendor/composer/spdx-licenses/src/SpdxLicenses.php | |
+++ b/vendor/composer/spdx-licenses/src/SpdxLicenses.php | |
@@ -25,8 +25,8 @@ class SpdxLicenses | |
* The array is indexed by license identifiers, which contain | |
* a numerically indexed array with license details. | |
* | |
- * [ license identifier => | |
- * [ 0 => full name (string), 1 => osi certified (bool) ] | |
+ * [ lowercased license identifier => | |
+ * [ 0 => identifier (string), 1 => full name (string), 2 => osi certified (bool), 3 => deprecated (bool) ] | |
* , ... | |
* ] | |
* | |
@@ -45,8 +45,8 @@ class SpdxLicenses | |
* The array is indexed by license exception identifiers, which contain | |
* a numerically indexed array with license exception details. | |
* | |
- * [ exception identifier => | |
- * [ 0 => full name (string) ] | |
+ * [ lowercased exception identifier => | |
+ * [ 0 => exception identifier (string), 1 => full name (string) ] | |
* , ... | |
* ] | |
* | |
@@ -71,7 +71,7 @@ class SpdxLicenses | |
* This function adds a link to the full license text to the license metadata. | |
* The array returned is in the form of: | |
* | |
- * [ 0 => full name (string), 1 => osi certified, 2 => link to license text (string) ] | |
+ * [ 0 => full name (string), 1 => osi certified, 2 => link to license text (string), 3 => deprecation status (bool) ] | |
* | |
* @param string $identifier | |
* | |
@@ -79,14 +79,30 @@ class SpdxLicenses | |
*/ | |
public function getLicenseByIdentifier($identifier) | |
{ | |
- if (!isset($this->licenses[$identifier])) { | |
+ $key = strtolower($identifier); | |
+ | |
+ if (!isset($this->licenses[$key])) { | |
return; | |
} | |
- $license = $this->licenses[$identifier]; | |
- $license[] = 'https://spdx.org/licenses/' . $identifier . '.html#licenseText'; | |
+ list($identifier, $name, $isOsiApproved, $isDeprecatedLicenseId) = $this->licenses[$key]; | |
+ | |
+ return array( | |
+ $name, | |
+ $isOsiApproved, | |
+ 'https://spdx.org/licenses/' . $identifier . '.html#licenseText', | |
+ $isDeprecatedLicenseId, | |
+ ); | |
+ } | |
- return $license; | |
+ /** | |
+ * Returns all licenses information, keyed by the lowercased license identifier. | |
+ * | |
+ * @return array[] Each item is [ 0 => identifier (string), 1 => full name (string), 2 => osi certified (bool), 3 => deprecated (bool) ] | |
+ */ | |
+ public function getLicenses() | |
+ { | |
+ return $this->licenses; | |
} | |
/** | |
@@ -103,14 +119,18 @@ class SpdxLicenses | |
*/ | |
public function getExceptionByIdentifier($identifier) | |
{ | |
- if (!isset($this->exceptions[$identifier])) { | |
+ $key = strtolower($identifier); | |
+ | |
+ if (!isset($this->exceptions[$key])) { | |
return; | |
} | |
- $license = $this->exceptions[$identifier]; | |
- $license[] = 'https://spdx.org/licenses/' . $identifier . '.html#licenseExceptionText'; | |
+ list($identifier, $name) = $this->exceptions[$key]; | |
- return $license; | |
+ return array( | |
+ $name, | |
+ 'https://spdx.org/licenses/' . $identifier . '.html#licenseExceptionText', | |
+ ); | |
} | |
/** | |
@@ -122,15 +142,15 @@ class SpdxLicenses | |
*/ | |
public function getIdentifierByName($name) | |
{ | |
- foreach ($this->licenses as $identifier => $licenseData) { | |
- if ($licenseData[0] === $name) { | |
- return $identifier; | |
+ foreach ($this->licenses as $licenseData) { | |
+ if ($licenseData[1] === $name) { | |
+ return $licenseData[0]; | |
} | |
} | |
- foreach ($this->exceptions as $identifier => $licenseData) { | |
- if ($licenseData[0] === $name) { | |
- return $identifier; | |
+ foreach ($this->exceptions as $licenseData) { | |
+ if ($licenseData[1] === $name) { | |
+ return $licenseData[0]; | |
} | |
} | |
} | |
@@ -144,7 +164,19 @@ class SpdxLicenses | |
*/ | |
public function isOsiApprovedByIdentifier($identifier) | |
{ | |
- return $this->licenses[$identifier][1]; | |
+ return $this->licenses[strtolower($identifier)][2]; | |
+ } | |
+ | |
+ /** | |
+ * Returns the deprecation status for a license by identifier. | |
+ * | |
+ * @param string $identifier | |
+ * | |
+ * @return bool | |
+ */ | |
+ public function isDeprecatedByIdentifier($identifier) | |
+ { | |
+ return $this->licenses[strtolower($identifier)][3]; | |
} | |
/** | |
@@ -184,17 +216,29 @@ class SpdxLicenses | |
private function loadLicenses() | |
{ | |
- if (null === $this->licenses) { | |
- $json = file_get_contents(self::getResourcesDir() . '/' . self::LICENSES_FILE); | |
- $this->licenses = json_decode($json, true); | |
+ if (null !== $this->licenses) { | |
+ return; | |
+ } | |
+ | |
+ $json = file_get_contents(self::getResourcesDir() . '/' . self::LICENSES_FILE); | |
+ $this->licenses = array(); | |
+ | |
+ foreach (json_decode($json, true) as $identifier => $license) { | |
+ $this->licenses[strtolower($identifier)] = array($identifier, $license[0], $license[1], $license[2]); | |
} | |
} | |
private function loadExceptions() | |
{ | |
- if (null === $this->exceptions) { | |
- $json = file_get_contents(self::getResourcesDir() . '/' . self::EXCEPTIONS_FILE); | |
- $this->exceptions = json_decode($json, true); | |
+ if (null !== $this->exceptions) { | |
+ return; | |
+ } | |
+ | |
+ $json = file_get_contents(self::getResourcesDir() . '/' . self::EXCEPTIONS_FILE); | |
+ $this->exceptions = array(); | |
+ | |
+ foreach (json_decode($json, true) as $identifier => $exception) { | |
+ $this->exceptions[strtolower($identifier)] = array($identifier, $exception[0]); | |
} | |
} | |
@@ -237,7 +281,7 @@ class SpdxLicenses | |
*/ | |
private function isValidLicenseString($license) | |
{ | |
- if (isset($this->licenses[$license])) { | |
+ if (isset($this->licenses[strtolower($license)])) { | |
return true; | |
} | |
@@ -269,11 +313,11 @@ class SpdxLicenses | |
# compound-expression OR compound-expression | |
# ) / ( compound-expression ) ) | |
(?<compound_head> | |
- (?&simple_expression) ( \s+ (?:with|WITH) \s+ (?&licenseexceptionid))? | |
+ (?&simple_expression) ( \s+ WITH \s+ (?&licenseexceptionid))? | |
| \( \s* (?&compound_expression) \s* \) | |
) | |
(?<compound_expression> | |
- (?&compound_head) (?: \s+ (?:and|AND|or|OR) \s+ (?&compound_expression))? | |
+ (?&compound_head) (?: \s+ (?:AND|OR) \s+ (?&compound_expression))? | |
) | |
# license-expression: 1*1(simple-expression / compound-expression) | |
@@ -281,7 +325,7 @@ class SpdxLicenses | |
) # end of define | |
^(NONE | NOASSERTION | (?&license_expression))$ | |
-}x | |
+}xi | |
REGEX; | |
$match = preg_match($regex, $license); | |
diff --git a/vendor/composer/spdx-licenses/src/SpdxLicensesUpdater.php b/vendor/composer/spdx-licenses/src/SpdxLicensesUpdater.php | |
index 94c76c3..cda7c0a 100644 | |
--- a/vendor/composer/spdx-licenses/src/SpdxLicensesUpdater.php | |
+++ b/vendor/composer/spdx-licenses/src/SpdxLicensesUpdater.php | |
@@ -23,7 +23,7 @@ class SpdxLicensesUpdater | |
* @param string $file | |
* @param string $url | |
*/ | |
- public function dumpLicenses($file = null, $url = 'https://spdx.org/licenses/index.html') | |
+ public function dumpLicenses($file = null, $url = 'https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json') | |
{ | |
if (null === $file) { | |
$file = SpdxLicenses::getResourcesDir() . '/' . SpdxLicenses::LICENSES_FILE; | |
@@ -47,7 +47,7 @@ class SpdxLicensesUpdater | |
* @param string $file | |
* @param string $url | |
*/ | |
- public function dumpExceptions($file = null, $url = 'https://spdx.org/licenses/exceptions-index.html') | |
+ public function dumpExceptions($file = null, $url = 'https://raw.githubusercontent.com/spdx/license-list-data/master/json/exceptions.json') | |
{ | |
if (null === $file) { | |
$file = SpdxLicenses::getResourcesDir() . '/' . SpdxLicenses::EXCEPTIONS_FILE; | |
@@ -76,27 +76,12 @@ class SpdxLicensesUpdater | |
{ | |
$licenses = array(); | |
- $dom = new \DOMDocument(); | |
- @$dom->loadHTMLFile($url); /* use silence operator to ignore warnings about invalid dom content */ | |
+ $data = json_decode(file_get_contents($url), true); | |
- $xPath = new \DOMXPath($dom); | |
- $trs = $xPath->query('//table//tbody//tr'); | |
- | |
- /** @var \DOMElement $tr */ | |
- foreach ($trs as $tr) { | |
- $tds = $tr->getElementsByTagName('td'); | |
- | |
- if ($tds->length !== 4) { | |
- continue; | |
- } | |
- | |
- if ('License Text' === trim($tds->item(3)->nodeValue)) { | |
- $fullname = trim($tds->item(0)->nodeValue); | |
- $identifier = trim($tds->item(1)->nodeValue); | |
- $osiApproved = ((isset($tds->item(2)->nodeValue) && $tds->item(2)->nodeValue === 'Y')) ? true : false; | |
- | |
- $licenses += array($identifier => array($fullname, $osiApproved)); | |
- } | |
+ foreach ($data['licenses'] as $info) { | |
+ $licenses[$info['licenseId']] = array( | |
+ trim($info['name']), $info['isOsiApproved'], $info['isDeprecatedLicenseId'] | |
+ ); | |
} | |
uksort($licenses, 'strcasecmp'); | |
@@ -113,26 +98,10 @@ class SpdxLicensesUpdater | |
{ | |
$exceptions = array(); | |
- $dom = new \DOMDocument(); | |
- @$dom->loadHTMLFile($url); /* use silence operator to ignore warnings about invalid dom content */ | |
- | |
- $xPath = new \DOMXPath($dom); | |
- $trs = $xPath->query('//table//tbody//tr'); | |
- | |
- /** @var \DOMElement $tr */ | |
- foreach ($trs as $tr) { | |
- $tds = $tr->getElementsByTagName('td'); | |
- | |
- if ($tds->length !== 3) { | |
- continue; | |
- } | |
- | |
- if ('License Exception Text' === trim($tds->item(2)->nodeValue)) { | |
- $fullname = trim($tds->item(0)->nodeValue); | |
- $identifier = trim($tds->item(1)->nodeValue); | |
+ $data = json_decode(file_get_contents($url), true); | |
- $exceptions += array($identifier => array($fullname)); | |
- } | |
+ foreach ($data['exceptions'] as $info) { | |
+ $exceptions[$info['licenseExceptionId']] = array(trim($info['name'])); | |
} | |
uksort($exceptions, 'strcasecmp'); | |
diff --git a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php | |
index e50c7d0..a53130d 100644 | |
--- a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php | |
+++ b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php | |
@@ -10,9 +10,6 @@ | |
namespace JsonSchema\Constraints; | |
use JsonSchema\Entity\JsonPointer; | |
-use JsonSchema\SchemaStorage; | |
-use JsonSchema\Uri\UriRetriever; | |
-use JsonSchema\UriRetrieverInterface; | |
/** | |
* The Base Constraints, all Validators should extend this class | |
diff --git a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.php b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.php | |
index c929638..4e771c1 100644 | |
--- a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.php | |
+++ b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.php | |
@@ -9,9 +9,7 @@ | |
namespace JsonSchema\Constraints; | |
-use JsonSchema\Constraints\Constraint; | |
use JsonSchema\Exception\InvalidArgumentException; | |
-use JsonSchema\Exception\InvalidConfigException; | |
use JsonSchema\SchemaStorage; | |
use JsonSchema\SchemaStorageInterface; | |
use JsonSchema\Uri\UriRetriever; | |
diff --git a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php | |
index eed5395..db665ad 100644 | |
--- a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php | |
+++ b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php | |
@@ -13,7 +13,6 @@ use JsonSchema\Entity\JsonPointer; | |
use JsonSchema\Exception\InvalidArgumentException; | |
use JsonSchema\Exception\InvalidSchemaException; | |
use JsonSchema\Exception\RuntimeException; | |
-use JsonSchema\SchemaStorage; | |
use JsonSchema\Validator; | |
/** | |
diff --git a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php | |
index c0606ff..257db15 100644 | |
--- a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php | |
+++ b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php | |
@@ -243,6 +243,7 @@ class UndefinedConstraint extends Constraint | |
if (isset($schema->properties) && LooseTypeCheck::isObject($value)) { | |
// $value is an object or assoc array, and properties are defined - treat as an object | |
foreach ($schema->properties as $currentProperty => $propertyDefinition) { | |
+ $propertyDefinition = $this->factory->getSchemaStorage()->resolveRefSchema($propertyDefinition); | |
if ( | |
!LooseTypeCheck::propertyExists($value, $currentProperty) | |
&& property_exists($propertyDefinition, 'default') | |
@@ -266,6 +267,7 @@ class UndefinedConstraint extends Constraint | |
} | |
// $value is an array, and items are defined - treat as plain array | |
foreach ($items as $currentItem => $itemDefinition) { | |
+ $itemDefinition = $this->factory->getSchemaStorage()->resolveRefSchema($itemDefinition); | |
if ( | |
!array_key_exists($currentItem, $value) | |
&& property_exists($itemDefinition, 'default') | |
diff --git a/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php b/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php | |
index 0e3b470..448091c 100644 | |
--- a/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php | |
+++ b/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php | |
@@ -11,8 +11,6 @@ namespace JsonSchema; | |
use JsonSchema\Constraints\BaseConstraint; | |
use JsonSchema\Constraints\Constraint; | |
-use JsonSchema\Exception\InvalidConfigException; | |
-use JsonSchema\SchemaStorage; | |
/** | |
* A JsonSchema Constraint | |
diff --git a/vendor/symfony/console/Application.php b/vendor/symfony/console/Application.php | |
index 186e5a9..4785200 100644 | |
--- a/vendor/symfony/console/Application.php | |
+++ b/vendor/symfony/console/Application.php | |
@@ -501,7 +501,7 @@ class Application | |
public function find($name) | |
{ | |
$this->init(); | |
- | |
+ $aliases = array(); | |
$allCommands = array_keys($this->commands); | |
$expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name); | |
$commands = preg_grep('{^'.$expr.'}', $allCommands); | |
@@ -529,15 +529,16 @@ class Application | |
// filter out aliases for commands which are already on the list | |
if (count($commands) > 1) { | |
$commandList = $this->commands; | |
- $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands) { | |
+ $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands, &$aliases) { | |
$commandName = $commandList[$nameOrAlias]->getName(); | |
+ $aliases[$nameOrAlias] = $commandName; | |
return $commandName === $nameOrAlias || !in_array($commandName, $commands); | |
}); | |
} | |
- $exact = in_array($name, $commands, true); | |
- if (count($commands) > 1 && !$exact) { | |
+ $exact = in_array($name, $commands, true) || isset($aliases[$name]); | |
+ if (!$exact && count($commands) > 1) { | |
$suggestions = $this->getAbbreviationSuggestions(array_values($commands)); | |
throw new CommandNotFoundException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions), array_values($commands)); | |
@@ -605,7 +606,7 @@ class Application | |
*/ | |
public function asText($namespace = null, $raw = false) | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$descriptor = new TextDescriptor(); | |
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, !$raw); | |
@@ -626,7 +627,7 @@ class Application | |
*/ | |
public function asXml($namespace = null, $asDom = false) | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$descriptor = new XmlDescriptor(); | |
diff --git a/vendor/symfony/console/Command/Command.php b/vendor/symfony/console/Command/Command.php | |
index 1317590..3ed5eab 100644 | |
--- a/vendor/symfony/console/Command/Command.php | |
+++ b/vendor/symfony/console/Command/Command.php | |
@@ -622,7 +622,7 @@ class Command | |
*/ | |
public function asText() | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$descriptor = new TextDescriptor(); | |
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); | |
@@ -642,7 +642,7 @@ class Command | |
*/ | |
public function asXml($asDom = false) | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$descriptor = new XmlDescriptor(); | |
diff --git a/vendor/symfony/console/Descriptor/DescriptorInterface.php b/vendor/symfony/console/Descriptor/DescriptorInterface.php | |
index 3929b6d..5d3339a 100644 | |
--- a/vendor/symfony/console/Descriptor/DescriptorInterface.php | |
+++ b/vendor/symfony/console/Descriptor/DescriptorInterface.php | |
@@ -21,7 +21,7 @@ use Symfony\Component\Console\Output\OutputInterface; | |
interface DescriptorInterface | |
{ | |
/** | |
- * Describes an InputArgument instance. | |
+ * Describes an object if supported. | |
* | |
* @param OutputInterface $output | |
* @param object $object | |
diff --git a/vendor/symfony/console/Helper/DialogHelper.php b/vendor/symfony/console/Helper/DialogHelper.php | |
index f9f8170..49d57ab 100644 | |
--- a/vendor/symfony/console/Helper/DialogHelper.php | |
+++ b/vendor/symfony/console/Helper/DialogHelper.php | |
@@ -34,7 +34,7 @@ class DialogHelper extends InputAwareHelper | |
public function __construct($triggerDeprecationError = true) | |
{ | |
if ($triggerDeprecationError) { | |
- @trigger_error('"Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED); | |
+ @trigger_error('"Symfony\Component\Console\Helper\DialogHelper" is deprecated since Symfony 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED); | |
} | |
} | |
diff --git a/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php | |
index 681d20d..0d975f6 100644 | |
--- a/vendor/symfony/console/Helper/HelperSet.php | |
+++ b/vendor/symfony/console/Helper/HelperSet.php | |
@@ -81,11 +81,11 @@ class HelperSet implements \IteratorAggregate | |
} | |
if ('dialog' === $name && $this->helpers[$name] instanceof DialogHelper) { | |
- @trigger_error('"Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED); | |
+ @trigger_error('"Symfony\Component\Console\Helper\DialogHelper" is deprecated since Symfony 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED); | |
} elseif ('progress' === $name && $this->helpers[$name] instanceof ProgressHelper) { | |
- @trigger_error('"Symfony\Component\Console\Helper\ProgressHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\ProgressBar" instead.', E_USER_DEPRECATED); | |
+ @trigger_error('"Symfony\Component\Console\Helper\ProgressHelper" is deprecated since Symfony 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\ProgressBar" instead.', E_USER_DEPRECATED); | |
} elseif ('table' === $name && $this->helpers[$name] instanceof TableHelper) { | |
- @trigger_error('"Symfony\Component\Console\Helper\TableHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\Table" instead.', E_USER_DEPRECATED); | |
+ @trigger_error('"Symfony\Component\Console\Helper\TableHelper" is deprecated since Symfony 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\Table" instead.', E_USER_DEPRECATED); | |
} | |
return $this->helpers[$name]; | |
diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php | |
index 0a9b021..94fd239 100644 | |
--- a/vendor/symfony/console/Helper/ProgressBar.php | |
+++ b/vendor/symfony/console/Helper/ProgressBar.php | |
@@ -183,7 +183,7 @@ class ProgressBar | |
*/ | |
public function getStep() | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the getProgress() method instead.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the getProgress() method instead.', E_USER_DEPRECATED); | |
return $this->getProgress(); | |
} | |
@@ -366,7 +366,7 @@ class ProgressBar | |
*/ | |
public function setCurrent($step) | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setProgress() method instead.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the setProgress() method instead.', E_USER_DEPRECATED); | |
$this->setProgress($step); | |
} | |
diff --git a/vendor/symfony/console/Helper/ProgressHelper.php b/vendor/symfony/console/Helper/ProgressHelper.php | |
index ce5a040..1edcf17 100644 | |
--- a/vendor/symfony/console/Helper/ProgressHelper.php | |
+++ b/vendor/symfony/console/Helper/ProgressHelper.php | |
@@ -123,7 +123,7 @@ class ProgressHelper extends Helper | |
public function __construct($triggerDeprecationError = true) | |
{ | |
if ($triggerDeprecationError) { | |
- @trigger_error('The '.__CLASS__.' class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Console\Helper\ProgressBar class instead.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__CLASS__.' class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Console\Helper\ProgressBar class instead.', E_USER_DEPRECATED); | |
} | |
} | |
diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php | |
index 757aa8a..7e6d9c7 100644 | |
--- a/vendor/symfony/console/Helper/QuestionHelper.php | |
+++ b/vendor/symfony/console/Helper/QuestionHelper.php | |
@@ -46,6 +46,12 @@ class QuestionHelper extends Helper | |
} | |
if (!$input->isInteractive()) { | |
+ if ($question instanceof ChoiceQuestion) { | |
+ $choices = $question->getChoices(); | |
+ | |
+ return $choices[$question->getDefault()]; | |
+ } | |
+ | |
return $question->getDefault(); | |
} | |
diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php | |
index 411b560..1036faa 100644 | |
--- a/vendor/symfony/console/Helper/Table.php | |
+++ b/vendor/symfony/console/Helper/Table.php | |
@@ -224,6 +224,7 @@ class Table | |
* Renders table to output. | |
* | |
* Example: | |
+ * <code> | |
* +---------------+-----------------------+------------------+ | |
* | ISBN | Title | Author | | |
* +---------------+-----------------------+------------------+ | |
@@ -231,6 +232,7 @@ class Table | |
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | | |
* | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | | |
* +---------------+-----------------------+------------------+ | |
+ * </code> | |
*/ | |
public function render() | |
{ | |
@@ -264,7 +266,7 @@ class Table | |
/** | |
* Renders horizontal header separator. | |
* | |
- * Example: +-----+-----------+-------+ | |
+ * Example: <code>+-----+-----------+-------+</code> | |
*/ | |
private function renderRowSeparator() | |
{ | |
@@ -295,7 +297,7 @@ class Table | |
/** | |
* Renders table row. | |
* | |
- * Example: | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | | |
+ * Example: <code>| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |</code> | |
* | |
* @param array $row | |
* @param string $cellFormat | |
diff --git a/vendor/symfony/console/Helper/TableHelper.php b/vendor/symfony/console/Helper/TableHelper.php | |
index 91afbb1..7948038 100644 | |
--- a/vendor/symfony/console/Helper/TableHelper.php | |
+++ b/vendor/symfony/console/Helper/TableHelper.php | |
@@ -35,7 +35,7 @@ class TableHelper extends Helper | |
public function __construct($triggerDeprecationError = true) | |
{ | |
if ($triggerDeprecationError) { | |
- @trigger_error('The '.__CLASS__.' class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Console\Helper\Table class instead.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__CLASS__.' class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Console\Helper\Table class instead.', E_USER_DEPRECATED); | |
} | |
$this->table = new Table(new NullOutput()); | |
diff --git a/vendor/symfony/console/Input/ArgvInput.php b/vendor/symfony/console/Input/ArgvInput.php | |
index e294d25..42147fe 100644 | |
--- a/vendor/symfony/console/Input/ArgvInput.php | |
+++ b/vendor/symfony/console/Input/ArgvInput.php | |
@@ -281,17 +281,13 @@ class ArgvInput extends Input | |
foreach ($this->tokens as $token) { | |
foreach ($values as $value) { | |
- if ($token === $value || 0 === strpos($token, $value.'=')) { | |
+ // Options with values: | |
+ // For long options, test for '--option=' at beginning | |
+ // For short options, test for '-o' at beginning | |
+ $leading = 0 === strpos($value, '--') ? $value.'=' : $value; | |
+ if ($token === $value || '' !== $leading && 0 === strpos($token, $leading)) { | |
return true; | |
} | |
- | |
- if (0 === strpos($token, '-') && 0 !== strpos($token, '--')) { | |
- $searchableToken = str_replace('-', '', $token); | |
- $searchableValue = str_replace('-', '', $value); | |
- if ('' !== $searchableToken && '' !== $searchableValue && false !== strpos($searchableToken, $searchableValue)) { | |
- return true; | |
- } | |
- } | |
} | |
} | |
@@ -310,13 +306,16 @@ class ArgvInput extends Input | |
$token = array_shift($tokens); | |
foreach ($values as $value) { | |
- if ($token === $value || 0 === strpos($token, $value.'=')) { | |
- if (false !== $pos = strpos($token, '=')) { | |
- return substr($token, $pos + 1); | |
- } | |
- | |
+ if ($token === $value) { | |
return array_shift($tokens); | |
} | |
+ // Options with values: | |
+ // For long options, test for '--option=' at beginning | |
+ // For short options, test for '-o' at beginning | |
+ $leading = 0 === strpos($value, '--') ? $value.'=' : $value; | |
+ if ('' !== $leading && 0 === strpos($token, $leading)) { | |
+ return substr($token, strlen($leading)); | |
+ } | |
} | |
} | |
diff --git a/vendor/symfony/console/Input/ArrayInput.php b/vendor/symfony/console/Input/ArrayInput.php | |
index c4c12c8..2d69a96 100644 | |
--- a/vendor/symfony/console/Input/ArrayInput.php | |
+++ b/vendor/symfony/console/Input/ArrayInput.php | |
@@ -106,7 +106,7 @@ class ArrayInput extends Input | |
$params[] = $param.('' != $val ? '='.$this->escapeToken($val) : ''); | |
} | |
} else { | |
- $params[] = is_array($val) ? array_map(array($this, 'escapeToken'), $val) : $this->escapeToken($val); | |
+ $params[] = is_array($val) ? implode(' ', array_map(array($this, 'escapeToken'), $val)) : $this->escapeToken($val); | |
} | |
} | |
diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php | |
index 7dadf2b..411a2a7 100644 | |
--- a/vendor/symfony/console/Input/InputDefinition.php | |
+++ b/vendor/symfony/console/Input/InputDefinition.php | |
@@ -412,7 +412,7 @@ class InputDefinition | |
*/ | |
public function asText() | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$descriptor = new TextDescriptor(); | |
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); | |
@@ -432,7 +432,7 @@ class InputDefinition | |
*/ | |
public function asXml($asDom = false) | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$descriptor = new XmlDescriptor(); | |
diff --git a/vendor/symfony/console/Input/InputInterface.php b/vendor/symfony/console/Input/InputInterface.php | |
index 6044e92..805ee51 100644 | |
--- a/vendor/symfony/console/Input/InputInterface.php | |
+++ b/vendor/symfony/console/Input/InputInterface.php | |
@@ -24,7 +24,7 @@ interface InputInterface | |
/** | |
* Returns the first argument from the raw parameters (not parsed). | |
* | |
- * @return string The value of the first argument or null otherwise | |
+ * @return string|null The value of the first argument or null otherwise | |
*/ | |
public function getFirstArgument(); | |
@@ -33,6 +33,8 @@ interface InputInterface | |
* | |
* This method is to be used to introspect the input parameters | |
* before they have been validated. It must be used carefully. | |
+ * Does not necessarily return the correct result for short options | |
+ * when multiple flags are combined in the same option. | |
* | |
* @param string|array $values The values to look for in the raw parameters (can be an array) | |
* | |
@@ -45,6 +47,8 @@ interface InputInterface | |
* | |
* This method is to be used to introspect the input parameters | |
* before they have been validated. It must be used carefully. | |
+ * Does not necessarily return the correct result for short options | |
+ * when multiple flags are combined in the same option. | |
* | |
* @param string|array $values The value(s) to look for in the raw parameters (can be an array) | |
* @param mixed $default The default value to return if no result is found | |
diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php | |
index 08608f2..84d9368 100644 | |
--- a/vendor/symfony/console/Input/StringInput.php | |
+++ b/vendor/symfony/console/Input/StringInput.php | |
@@ -28,7 +28,7 @@ class StringInput extends ArgvInput | |
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')'; | |
/** | |
- * @param string $input An array of parameters from the CLI (in the argv format) | |
+ * @param string $input A string representing the parameters from the CLI | |
* @param InputDefinition $definition A InputDefinition instance | |
* | |
* @deprecated The second argument is deprecated as it does not work (will be removed in 3.0), use 'bind' method instead | |
diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php | |
index 51cad9b..37bb164 100644 | |
--- a/vendor/symfony/console/Output/StreamOutput.php | |
+++ b/vendor/symfony/console/Output/StreamOutput.php | |
@@ -83,16 +83,26 @@ class StreamOutput extends Output | |
* | |
* Colorization is disabled if not supported by the stream: | |
* | |
- * - Windows != 10.0.10586 without Ansicon, ConEmu or Mintty | |
+ * - the stream is redirected (eg php file.php >log) | |
+ * - Windows without VT100 support, Ansicon, ConEmu, Mintty | |
* - non tty consoles | |
* | |
* @return bool true if the stream supports colorization, false otherwise | |
*/ | |
protected function hasColorSupport() | |
{ | |
+ if (function_exists('stream_isatty') && !@stream_isatty($this->stream)) { | |
+ return false; | |
+ } | |
if (DIRECTORY_SEPARATOR === '\\') { | |
+ if (function_exists('sapi_windows_vt100_support')) { | |
+ $vt100Enabled = @sapi_windows_vt100_support($this->stream); | |
+ } else { | |
+ $vt100Enabled = '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD; | |
+ } | |
+ | |
return | |
- '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD | |
+ $vt100Enabled | |
|| false !== getenv('ANSICON') | |
|| 'ON' === getenv('ConEmuANSI') | |
|| 'xterm' === getenv('TERM'); | |
diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php | |
index a9205e5..475c268 100644 | |
--- a/vendor/symfony/console/Style/StyleInterface.php | |
+++ b/vendor/symfony/console/Style/StyleInterface.php | |
@@ -91,7 +91,7 @@ interface StyleInterface | |
* @param string|null $default | |
* @param callable|null $validator | |
* | |
- * @return string | |
+ * @return mixed | |
*/ | |
public function ask($question, $default = null, $validator = null); | |
@@ -101,7 +101,7 @@ interface StyleInterface | |
* @param string $question | |
* @param callable|null $validator | |
* | |
- * @return string | |
+ * @return mixed | |
*/ | |
public function askHidden($question, $validator = null); | |
@@ -122,7 +122,7 @@ interface StyleInterface | |
* @param array $choices | |
* @param string|int|null $default | |
* | |
- * @return string | |
+ * @return mixed | |
*/ | |
public function choice($question, array $choices, $default = null); | |
diff --git a/vendor/symfony/console/Style/SymfonyStyle.php b/vendor/symfony/console/Style/SymfonyStyle.php | |
index d2d0906..a21f3c1 100644 | |
--- a/vendor/symfony/console/Style/SymfonyStyle.php | |
+++ b/vendor/symfony/console/Style/SymfonyStyle.php | |
@@ -281,7 +281,7 @@ class SymfonyStyle extends OutputStyle | |
} | |
/** | |
- * @return string | |
+ * @return mixed | |
*/ | |
public function askQuestion(Question $question) | |
{ | |
diff --git a/vendor/symfony/filesystem/Filesystem.php b/vendor/symfony/filesystem/Filesystem.php | |
index 36cc339..98bd6f9 100644 | |
--- a/vendor/symfony/filesystem/Filesystem.php | |
+++ b/vendor/symfony/filesystem/Filesystem.php | |
@@ -431,13 +431,18 @@ class Filesystem | |
/** | |
* Mirrors a directory to another. | |
* | |
+ * Copies files and directories from the origin directory into the target directory. By default: | |
+ * | |
+ * - existing files in the target directory will be overwritten, except if they are newer (see the `override` option) | |
+ * - files in the target directory that do not exist in the source directory will not be deleted (see the `delete` option) | |
+ * | |
* @param string $originDir The origin directory | |
* @param string $targetDir The target directory | |
- * @param \Traversable $iterator A Traversable instance | |
+ * @param \Traversable $iterator Iterator that filters which files and directories to copy | |
* @param array $options An array of boolean options | |
* Valid options are: | |
- * - $options['override'] Whether to override an existing file on copy or not (see copy()) | |
- * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink()) | |
+ * - $options['override'] If true, target files newer than origin files are overwritten (see copy(), defaults to false) | |
+ * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink(), defaults to false) | |
* - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) | |
* | |
* @throws IOException When file type is unknown | |
@@ -603,7 +608,7 @@ class Filesystem | |
if (null !== $mode) { | |
if (func_num_args() > 2) { | |
- @trigger_error('Support for modifying file permissions is deprecated since version 2.3.12 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('Support for modifying file permissions is deprecated since Symfony 2.3.12 and will be removed in 3.0.', E_USER_DEPRECATED); | |
} | |
$this->chmod($tmpFile, $mode); | |
diff --git a/vendor/symfony/finder/Adapter/AbstractAdapter.php b/vendor/symfony/finder/Adapter/AbstractAdapter.php | |
index 48f993d..1a1647c 100644 | |
--- a/vendor/symfony/finder/Adapter/AbstractAdapter.php | |
+++ b/vendor/symfony/finder/Adapter/AbstractAdapter.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Adapter; | |
-@trigger_error('The '.__NAMESPACE__.'\AbstractAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\AbstractAdapter class is deprecated since Symfony 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
/** | |
* Interface for finder engine implementations. | |
diff --git a/vendor/symfony/finder/Adapter/AbstractFindAdapter.php b/vendor/symfony/finder/Adapter/AbstractFindAdapter.php | |
index d0294c9..71097f2 100644 | |
--- a/vendor/symfony/finder/Adapter/AbstractFindAdapter.php | |
+++ b/vendor/symfony/finder/Adapter/AbstractFindAdapter.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Adapter; | |
-@trigger_error('The '.__NAMESPACE__.'\AbstractFindAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\AbstractFindAdapter class is deprecated since Symfony 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
use Symfony\Component\Finder\Exception\AccessDeniedException; | |
use Symfony\Component\Finder\Iterator; | |
diff --git a/vendor/symfony/finder/Adapter/BsdFindAdapter.php b/vendor/symfony/finder/Adapter/BsdFindAdapter.php | |
index caaad19..d2bf6fb 100644 | |
--- a/vendor/symfony/finder/Adapter/BsdFindAdapter.php | |
+++ b/vendor/symfony/finder/Adapter/BsdFindAdapter.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Adapter; | |
-@trigger_error('The '.__NAMESPACE__.'\BsdFindAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\BsdFindAdapter class is deprecated since Symfony 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
use Symfony\Component\Finder\Shell\Shell; | |
use Symfony\Component\Finder\Shell\Command; | |
diff --git a/vendor/symfony/finder/Adapter/GnuFindAdapter.php b/vendor/symfony/finder/Adapter/GnuFindAdapter.php | |
index ec3dff4..47dbffb 100644 | |
--- a/vendor/symfony/finder/Adapter/GnuFindAdapter.php | |
+++ b/vendor/symfony/finder/Adapter/GnuFindAdapter.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Adapter; | |
-@trigger_error('The '.__NAMESPACE__.'\GnuFindAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\GnuFindAdapter class is deprecated since Symfony 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
use Symfony\Component\Finder\Shell\Shell; | |
use Symfony\Component\Finder\Shell\Command; | |
diff --git a/vendor/symfony/finder/Adapter/PhpAdapter.php b/vendor/symfony/finder/Adapter/PhpAdapter.php | |
index 3f2a070..c2fb66c 100644 | |
--- a/vendor/symfony/finder/Adapter/PhpAdapter.php | |
+++ b/vendor/symfony/finder/Adapter/PhpAdapter.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Adapter; | |
-@trigger_error('The '.__NAMESPACE__.'\PhpAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\PhpAdapter class is deprecated since Symfony 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED); | |
use Symfony\Component\Finder\Iterator; | |
diff --git a/vendor/symfony/finder/Exception/AdapterFailureException.php b/vendor/symfony/finder/Exception/AdapterFailureException.php | |
index 5c2111b..594940a 100644 | |
--- a/vendor/symfony/finder/Exception/AdapterFailureException.php | |
+++ b/vendor/symfony/finder/Exception/AdapterFailureException.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Exception; | |
-@trigger_error('The '.__NAMESPACE__.'\AdapterFailureException class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\AdapterFailureException class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
use Symfony\Component\Finder\Adapter\AdapterInterface; | |
diff --git a/vendor/symfony/finder/Exception/OperationNotPermitedException.php b/vendor/symfony/finder/Exception/OperationNotPermitedException.php | |
index d75d652..4c66858 100644 | |
--- a/vendor/symfony/finder/Exception/OperationNotPermitedException.php | |
+++ b/vendor/symfony/finder/Exception/OperationNotPermitedException.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Exception; | |
-@trigger_error('The '.__NAMESPACE__.'\OperationNotPermitedException class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\OperationNotPermitedException class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
/** | |
* @author Jean-François Simon <[email protected]> | |
diff --git a/vendor/symfony/finder/Exception/ShellCommandFailureException.php b/vendor/symfony/finder/Exception/ShellCommandFailureException.php | |
index 45d42ba..db85e68 100644 | |
--- a/vendor/symfony/finder/Exception/ShellCommandFailureException.php | |
+++ b/vendor/symfony/finder/Exception/ShellCommandFailureException.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Exception; | |
-@trigger_error('The '.__NAMESPACE__.'\ShellCommandFailureException class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\ShellCommandFailureException class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
use Symfony\Component\Finder\Adapter\AdapterInterface; | |
use Symfony\Component\Finder\Shell\Command; | |
diff --git a/vendor/symfony/finder/Expression/Expression.php b/vendor/symfony/finder/Expression/Expression.php | |
index 41a2cbf..e83c771 100644 | |
--- a/vendor/symfony/finder/Expression/Expression.php | |
+++ b/vendor/symfony/finder/Expression/Expression.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Expression; | |
-@trigger_error('The '.__NAMESPACE__.'\Expression class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\Expression class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
/** | |
* @author Jean-François Simon <[email protected]> | |
diff --git a/vendor/symfony/finder/Expression/Glob.php b/vendor/symfony/finder/Expression/Glob.php | |
index f4c1f9a..e80578e 100644 | |
--- a/vendor/symfony/finder/Expression/Glob.php | |
+++ b/vendor/symfony/finder/Expression/Glob.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Expression; | |
-@trigger_error('The '.__NAMESPACE__.'\Glob class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\Glob class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
use Symfony\Component\Finder\Glob as FinderGlob; | |
diff --git a/vendor/symfony/finder/Expression/Regex.php b/vendor/symfony/finder/Expression/Regex.php | |
index b8c770c..2f1ab3d 100644 | |
--- a/vendor/symfony/finder/Expression/Regex.php | |
+++ b/vendor/symfony/finder/Expression/Regex.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Expression; | |
-@trigger_error('The '.__NAMESPACE__.'\Regex class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\Regex class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
/** | |
* @author Jean-François Simon <[email protected]> | |
diff --git a/vendor/symfony/finder/Expression/ValueInterface.php b/vendor/symfony/finder/Expression/ValueInterface.php | |
index 7ff00bd..08ede14 100644 | |
--- a/vendor/symfony/finder/Expression/ValueInterface.php | |
+++ b/vendor/symfony/finder/Expression/ValueInterface.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Expression; | |
-@trigger_error('The '.__NAMESPACE__.'\ValueInterface interface is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\ValueInterface interface is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
/** | |
* @author Jean-François Simon <[email protected]> | |
diff --git a/vendor/symfony/finder/Finder.php b/vendor/symfony/finder/Finder.php | |
index d8a20f1..0c039ae 100644 | |
--- a/vendor/symfony/finder/Finder.php | |
+++ b/vendor/symfony/finder/Finder.php | |
@@ -94,7 +94,7 @@ class Finder implements \IteratorAggregate, \Countable | |
*/ | |
public function addAdapter(AdapterInterface $adapter, $priority = 0) | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$this->initDefaultAdapters(); | |
@@ -116,7 +116,7 @@ class Finder implements \IteratorAggregate, \Countable | |
*/ | |
public function useBestAdapter() | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$this->initDefaultAdapters(); | |
@@ -138,7 +138,7 @@ class Finder implements \IteratorAggregate, \Countable | |
*/ | |
public function setAdapter($name) | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$this->initDefaultAdapters(); | |
@@ -161,7 +161,7 @@ class Finder implements \IteratorAggregate, \Countable | |
*/ | |
public function removeAdapters() | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$this->adapters = array(); | |
@@ -177,7 +177,7 @@ class Finder implements \IteratorAggregate, \Countable | |
*/ | |
public function getAdapters() | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
$this->initDefaultAdapters(); | |
@@ -407,6 +407,10 @@ class Finder implements \IteratorAggregate, \Countable | |
/** | |
* Excludes directories. | |
* | |
+ * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: | |
+ * | |
+ * $finder->in(__DIR__)->exclude('ruby'); | |
+ * | |
* @param string|array $dirs A directory path or an array of directories | |
* | |
* @return $this | |
@@ -423,6 +427,8 @@ class Finder implements \IteratorAggregate, \Countable | |
/** | |
* Excludes "hidden" directories and files (starting with a dot). | |
* | |
+ * This option is enabled by default. | |
+ * | |
* @param bool $ignoreDotFiles Whether to exclude "hidden" files or not | |
* | |
* @return $this | |
@@ -443,6 +449,8 @@ class Finder implements \IteratorAggregate, \Countable | |
/** | |
* Forces the finder to ignore version control directories. | |
* | |
+ * This option is enabled by default. | |
+ * | |
* @param bool $ignoreVCS Whether to exclude VCS files or not | |
* | |
* @return $this | |
@@ -642,9 +650,9 @@ class Finder implements \IteratorAggregate, \Countable | |
foreach ((array) $dirs as $dir) { | |
if (is_dir($dir)) { | |
- $resolvedDirs[] = $dir; | |
+ $resolvedDirs[] = $this->normalizeDir($dir); | |
} elseif ($glob = glob($dir, (defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) { | |
- $resolvedDirs = array_merge($resolvedDirs, $glob); | |
+ $resolvedDirs = array_merge($resolvedDirs, array_map(array($this, 'normalizeDir'), $glob)); | |
} else { | |
throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir)); | |
} | |
@@ -893,4 +901,16 @@ class Finder implements \IteratorAggregate, \Countable | |
; | |
} | |
} | |
+ | |
+ /** | |
+ * Normalizes given directory names by removing trailing slashes. | |
+ * | |
+ * @param string $dir | |
+ * | |
+ * @return string | |
+ */ | |
+ private function normalizeDir($dir) | |
+ { | |
+ return rtrim($dir, '/'.\DIRECTORY_SEPARATOR); | |
+ } | |
} | |
diff --git a/vendor/symfony/finder/Iterator/FilePathsIterator.php b/vendor/symfony/finder/Iterator/FilePathsIterator.php | |
index 74ada6b..4bc9b87 100644 | |
--- a/vendor/symfony/finder/Iterator/FilePathsIterator.php | |
+++ b/vendor/symfony/finder/Iterator/FilePathsIterator.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Iterator; | |
-@trigger_error('The '.__NAMESPACE__.'\FilePathsIterator class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\FilePathsIterator class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
use Symfony\Component\Finder\SplFileInfo; | |
diff --git a/vendor/symfony/finder/Shell/Command.php b/vendor/symfony/finder/Shell/Command.php | |
index 67d4b74..b66ea33 100644 | |
--- a/vendor/symfony/finder/Shell/Command.php | |
+++ b/vendor/symfony/finder/Shell/Command.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Shell; | |
-@trigger_error('The '.__NAMESPACE__.'\Command class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\Command class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
/** | |
* @author Jean-François Simon <[email protected]> | |
diff --git a/vendor/symfony/finder/Shell/Shell.php b/vendor/symfony/finder/Shell/Shell.php | |
index 0cd1e1f..65ede47 100644 | |
--- a/vendor/symfony/finder/Shell/Shell.php | |
+++ b/vendor/symfony/finder/Shell/Shell.php | |
@@ -11,7 +11,7 @@ | |
namespace Symfony\Component\Finder\Shell; | |
-@trigger_error('The '.__NAMESPACE__.'\Shell class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+@trigger_error('The '.__NAMESPACE__.'\Shell class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | |
/** | |
* @author Jean-François Simon <[email protected]> | |
diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php | |
index 97e8c9b..67cf9ab 100644 | |
--- a/vendor/symfony/polyfill-mbstring/Mbstring.php | |
+++ b/vendor/symfony/polyfill-mbstring/Mbstring.php | |
@@ -20,7 +20,10 @@ namespace Symfony\Polyfill\Mbstring; | |
* - mb_convert_variables - Convert character code in variable(s) | |
* - mb_decode_mimeheader - Decode string in MIME header field | |
* - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED | |
+ * - mb_decode_numericentity - Decode HTML numeric string reference to character | |
+ * - mb_encode_numericentity - Encode character to HTML numeric string reference | |
* - mb_convert_case - Perform case folding on a string | |
+ * - mb_detect_encoding - Detect character encoding | |
* - mb_get_info - Get internal settings of mbstring | |
* - mb_http_input - Detect HTTP input character encoding | |
* - mb_http_output - Set/Get HTTP output character encoding | |
@@ -47,8 +50,6 @@ namespace Symfony\Polyfill\Mbstring; | |
* | |
* Not implemented: | |
* - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) | |
- * - mb_decode_numericentity - Decode HTML numeric string reference to character | |
- * - mb_encode_numericentity - Encode character to HTML numeric string reference | |
* - mb_ereg_* - Regular expression with multibyte support | |
* - mb_parse_str - Parse GET/POST/COOKIE data and set global variable | |
* - mb_preferred_mime_name - Get MIME charset string | |
@@ -137,9 +138,134 @@ final class Mbstring | |
trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING); | |
} | |
+ public static function mb_decode_numericentity($s, $convmap, $encoding = null) | |
+ { | |
+ if (null !== $s && !is_scalar($s) && !(is_object($s) && method_exists($s, '__toString'))) { | |
+ trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.gettype($s).' given', E_USER_WARNING); | |
+ return null; | |
+ } | |
+ | |
+ if (!is_array($convmap) || !$convmap) { | |
+ return false; | |
+ } | |
+ | |
+ if (null !== $encoding && !is_scalar($encoding)) { | |
+ trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); | |
+ return ''; // Instead of null (cf. mb_encode_numericentity). | |
+ } | |
+ | |
+ $s = (string) $s; | |
+ if ('' === $s) { | |
+ return ''; | |
+ } | |
+ | |
+ $encoding = self::getEncoding($encoding); | |
+ | |
+ if ('UTF-8' === $encoding) { | |
+ $encoding = null; | |
+ if (!preg_match('//u', $s)) { | |
+ $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); | |
+ } | |
+ } else { | |
+ $s = iconv($encoding, 'UTF-8//IGNORE', $s); | |
+ } | |
+ | |
+ $cnt = floor(count($convmap) / 4) * 4; | |
+ | |
+ for ($i = 0; $i < $cnt; $i += 4) { | |
+ // collector_decode_htmlnumericentity ignores $convmap[$i + 3] | |
+ $convmap[$i] += $convmap[$i + 2]; | |
+ $convmap[$i + 1] += $convmap[$i + 2]; | |
+ } | |
+ | |
+ $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { | |
+ $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; | |
+ for ($i = 0; $i < $cnt; $i += 4) { | |
+ if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { | |
+ return Mbstring::mb_chr($c - $convmap[$i + 2]); | |
+ } | |
+ } | |
+ return $m[0]; | |
+ }, $s); | |
+ | |
+ if (null === $encoding) { | |
+ return $s; | |
+ } | |
+ | |
+ return iconv('UTF-8', $encoding.'//IGNORE', $s); | |
+ } | |
+ | |
+ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) | |
+ { | |
+ if (null !== $s && !is_scalar($s) && !(is_object($s) && method_exists($s, '__toString'))) { | |
+ trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.gettype($s).' given', E_USER_WARNING); | |
+ return null; | |
+ } | |
+ | |
+ if (!is_array($convmap) || !$convmap) { | |
+ return false; | |
+ } | |
+ | |
+ if (null !== $encoding && !is_scalar($encoding)) { | |
+ trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); | |
+ return null; // Instead of '' (cf. mb_decode_numericentity). | |
+ } | |
+ | |
+ if (null !== $is_hex && !is_scalar($is_hex)) { | |
+ trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.gettype($s).' given', E_USER_WARNING); | |
+ return null; | |
+ } | |
+ | |
+ $s = (string) $s; | |
+ if ('' === $s) { | |
+ return ''; | |
+ } | |
+ | |
+ $encoding = self::getEncoding($encoding); | |
+ | |
+ if ('UTF-8' === $encoding) { | |
+ $encoding = null; | |
+ if (!preg_match('//u', $s)) { | |
+ $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); | |
+ } | |
+ } else { | |
+ $s = iconv($encoding, 'UTF-8//IGNORE', $s); | |
+ } | |
+ | |
+ static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); | |
+ | |
+ $cnt = floor(count($convmap) / 4) * 4; | |
+ $i = 0; | |
+ $len = strlen($s); | |
+ $result = ''; | |
+ | |
+ while ($i < $len) { | |
+ $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; | |
+ $uchr = substr($s, $i, $ulen); | |
+ $i += $ulen; | |
+ $c = self::mb_ord($uchr); | |
+ | |
+ for ($j = 0; $j < $cnt; $j += 4) { | |
+ if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { | |
+ $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; | |
+ $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; | |
+ continue 2; | |
+ } | |
+ } | |
+ $result .= $uchr; | |
+ } | |
+ | |
+ if (null === $encoding) { | |
+ return $result; | |
+ } | |
+ | |
+ return iconv('UTF-8', $encoding.'//IGNORE', $result); | |
+ } | |
+ | |
public static function mb_convert_case($s, $mode, $encoding = null) | |
{ | |
- if ('' === $s .= '') { | |
+ $s = (string) $s; | |
+ if ('' === $s) { | |
return ''; | |
} | |
@@ -354,7 +480,8 @@ final class Mbstring | |
return strpos($haystack, $needle, $offset); | |
} | |
- if ('' === $needle .= '') { | |
+ $needle = (string) $needle; | |
+ if ('' === $needle) { | |
trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); | |
return false; | |
@@ -428,7 +555,7 @@ final class Mbstring | |
} | |
} | |
- return iconv_substr($s, $start, $length, $encoding).''; | |
+ return (string) iconv_substr($s, $start, $length, $encoding); | |
} | |
public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) | |
@@ -600,7 +727,7 @@ final class Mbstring | |
return self::mb_substr($haystack, $pos, null, $encoding); | |
} | |
- private static function html_encoding_callback($m) | |
+ private static function html_encoding_callback(array $m) | |
{ | |
$i = 1; | |
$entities = ''; | |
@@ -625,12 +752,12 @@ final class Mbstring | |
return $entities; | |
} | |
- private static function title_case_lower($s) | |
+ private static function title_case_lower(array $s) | |
{ | |
return self::mb_convert_case($s[0], MB_CASE_LOWER, 'UTF-8'); | |
} | |
- private static function title_case_upper($s) | |
+ private static function title_case_upper(array $s) | |
{ | |
return self::mb_convert_case($s[0], MB_CASE_UPPER, 'UTF-8'); | |
} | |
diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php | |
index 3372291..2fdcc5a 100644 | |
--- a/vendor/symfony/polyfill-mbstring/bootstrap.php | |
+++ b/vendor/symfony/polyfill-mbstring/bootstrap.php | |
@@ -19,6 +19,8 @@ if (!function_exists('mb_strlen')) { | |
function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } | |
function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } | |
function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } | |
+ function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } | |
+ function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } | |
function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } | |
function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } | |
function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } | |
diff --git a/vendor/symfony/process/PhpExecutableFinder.php b/vendor/symfony/process/PhpExecutableFinder.php | |
index fb29782..f5c97d6 100644 | |
--- a/vendor/symfony/process/PhpExecutableFinder.php | |
+++ b/vendor/symfony/process/PhpExecutableFinder.php | |
@@ -44,7 +44,7 @@ class PhpExecutableFinder | |
} | |
// PHP_BINARY return the current sapi executable | |
- if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) { | |
+ if (defined('PHP_BINARY') && PHP_BINARY && \in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'), true)) { | |
return PHP_BINARY.$args; | |
} | |
@@ -62,6 +62,10 @@ class PhpExecutableFinder | |
} | |
} | |
+ if (is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) { | |
+ return $php; | |
+ } | |
+ | |
$dirs = array(PHP_BINDIR); | |
if ('\\' === DIRECTORY_SEPARATOR) { | |
$dirs[] = 'C:\xampp\php\\'; | |
diff --git a/vendor/symfony/process/Pipes/AbstractPipes.php b/vendor/symfony/process/Pipes/AbstractPipes.php | |
index d46a861..9a23d93 100644 | |
--- a/vendor/symfony/process/Pipes/AbstractPipes.php | |
+++ b/vendor/symfony/process/Pipes/AbstractPipes.php | |
@@ -94,7 +94,7 @@ abstract class AbstractPipes implements PipesInterface | |
$w = array($this->pipes[0]); | |
// let's have a look if something changed in streams | |
- if (false === $n = @stream_select($r, $w, $e, 0, 0)) { | |
+ if (false === @stream_select($r, $w, $e, 0, 0)) { | |
return; | |
} | |
diff --git a/vendor/symfony/process/Pipes/UnixPipes.php b/vendor/symfony/process/Pipes/UnixPipes.php | |
index b5b8835..65f32ec 100644 | |
--- a/vendor/symfony/process/Pipes/UnixPipes.php | |
+++ b/vendor/symfony/process/Pipes/UnixPipes.php | |
@@ -99,7 +99,7 @@ class UnixPipes extends AbstractPipes | |
unset($r[0]); | |
// let's have a look if something changed in streams | |
- if (($r || $w) && false === $n = @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { | |
+ if (($r || $w) && false === @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { | |
// if a system call has been interrupted, forget about it, let's try again | |
// otherwise, an error occurred, let's reset pipes | |
if (!$this->hasSystemCallBeenInterrupted()) { | |
diff --git a/vendor/symfony/process/Process.php b/vendor/symfony/process/Process.php | |
index 05f7ecf..b5eb7f7 100644 | |
--- a/vendor/symfony/process/Process.php | |
+++ b/vendor/symfony/process/Process.php | |
@@ -1000,7 +1000,7 @@ class Process | |
/** | |
* Sets the environment variables. | |
* | |
- * An environment variable value should be a string. | |
+ * Each environment variable value should be a string. | |
* If it is an array, the variable is ignored. | |
* | |
* That happens in PHP when 'argv' is registered into | |
@@ -1036,7 +1036,7 @@ class Process | |
*/ | |
public function getStdin() | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getInput() method instead.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the getInput() method instead.', E_USER_DEPRECATED); | |
return $this->getInput(); | |
} | |
@@ -1066,7 +1066,7 @@ class Process | |
*/ | |
public function setStdin($stdin) | |
{ | |
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the setInput() method instead.', E_USER_DEPRECATED); | |
+ @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the setInput() method instead.', E_USER_DEPRECATED); | |
return $this->setInput($stdin); | |
} | |
diff --git a/vendor/symfony/process/ProcessUtils.php b/vendor/symfony/process/ProcessUtils.php | |
index c0fd9c1..c0558b7 100644 | |
--- a/vendor/symfony/process/ProcessUtils.php | |
+++ b/vendor/symfony/process/ProcessUtils.php | |
@@ -100,7 +100,7 @@ class ProcessUtils | |
} | |
// deprecated as of Symfony 2.5, to be removed in 3.0 | |
if (is_object($input) && method_exists($input, '__toString')) { | |
- @trigger_error('Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); | |
+ @trigger_error('Passing an object as an input is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); | |
return (string) $input; | |
} | |
diff --git a/vendor/wp-cli/checksum-command/src/Checksum_Base_Command.php b/vendor/wp-cli/checksum-command/src/Checksum_Base_Command.php | |
index ce06f8a..3c341b1 100644 | |
--- a/vendor/wp-cli/checksum-command/src/Checksum_Base_Command.php | |
+++ b/vendor/wp-cli/checksum-command/src/Checksum_Base_Command.php | |
@@ -10,17 +10,6 @@ use \WP_CLI\Utils; | |
class Checksum_Base_Command extends WP_CLI_Command { | |
/** | |
- * Normalizes directory separators to slashes. | |
- * | |
- * @param string $path Path to convert. | |
- * | |
- * @return string Path with all backslashes replaced by slashes. | |
- */ | |
- public static function normalize_directory_separators( $path ) { | |
- return str_replace( '\\', '/', $path ); | |
- } | |
- | |
- /** | |
* Read a remote file and return its contents. | |
* | |
* @param string $url URL of the remote file to read. | |
@@ -53,7 +42,7 @@ class Checksum_Base_Command extends WP_CLI_Command { | |
RecursiveIteratorIterator::CHILD_FIRST | |
); | |
foreach ( $files as $file_info ) { | |
- $pathname = self::normalize_directory_separators( substr( $file_info->getPathname(), strlen( $path ) ) ); | |
+ $pathname = substr( $file_info->getPathname(), strlen( $path ) ); | |
if ( $file_info->isFile() && $this->filter_file( $pathname ) ) { | |
$filtered_files[] = $pathname; | |
} | |
diff --git a/vendor/wp-cli/checksum-command/src/Checksum_Plugin_Command.php b/vendor/wp-cli/checksum-command/src/Checksum_Plugin_Command.php | |
index eb1e892..d02f55e 100644 | |
--- a/vendor/wp-cli/checksum-command/src/Checksum_Plugin_Command.php | |
+++ b/vendor/wp-cli/checksum-command/src/Checksum_Plugin_Command.php | |
@@ -339,7 +339,6 @@ class Checksum_Plugin_Command extends Checksum_Base_Command { | |
private function get_soft_change_files() { | |
static $files = array( | |
'readme.txt', | |
- 'readme.md', | |
); | |
return $files; | |
@@ -355,6 +354,6 @@ class Checksum_Plugin_Command extends Checksum_Base_Command { | |
* mode. | |
*/ | |
private function is_soft_change_file( $file ) { | |
- return in_array( strtolower( $file ), $this->get_soft_change_files(), true ); | |
+ return in_array( $file, $this->get_soft_change_files(), true ); | |
} | |
} | |
diff --git a/vendor/wp-cli/extension-command/src/Plugin_Command.php b/vendor/wp-cli/extension-command/src/Plugin_Command.php | |
index ca561b2..5ca1988 100644 | |
--- a/vendor/wp-cli/extension-command/src/Plugin_Command.php | |
+++ b/vendor/wp-cli/extension-command/src/Plugin_Command.php | |
@@ -810,7 +810,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade { | |
* | |
* ## OPTIONS | |
* | |
- * <plugin>... | |
+ * [<plugin>...] | |
* : One or more plugins to uninstall. | |
* | |
* [--deactivate] | |
@@ -820,6 +820,9 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade { | |
* : If set, the plugin files will not be deleted. Only the uninstall procedure | |
* will be run. | |
* | |
+ * [--all] | |
+ * : If set, all plugins will be uninstalled. | |
+ * | |
* ## EXAMPLES | |
* | |
* $ wp plugin uninstall hello | |
@@ -827,8 +830,20 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade { | |
* Success: Installed 1 of 1 plugins. | |
*/ | |
public function uninstall( $args, $assoc_args = array() ) { | |
+ | |
+ $all = Utils\get_flag_value( $assoc_args, 'all', false ); | |
+ | |
+ // Check if plugin names of --all is passed. | |
+ if ( ! ( $args = $this->check_optional_args_and_all( $args, $all, 'uninstall' ) ) ) { | |
+ return; | |
+ } | |
+ | |
$successes = $errors = 0; | |
$plugins = $this->fetcher->get_many( $args ); | |
+ if ( count( $plugins ) < count( $args ) ) { | |
+ $errors = count( $args ) - count( $plugins ); | |
+ } | |
+ | |
foreach ( $plugins as $plugin ) { | |
if ( is_plugin_active( $plugin->file ) && ! WP_CLI\Utils\get_flag_value( $assoc_args, 'deactivate' ) ) { | |
WP_CLI::warning( "The '{$plugin->name}' plugin is active." ); | |
@@ -1082,7 +1097,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade { | |
* @param bool $all All flag. | |
* @return array Same as $args if not all, otherwise all slugs. | |
*/ | |
- private function check_optional_args_and_all( $args, $all ) { | |
+ private function check_optional_args_and_all( $args, $all, $verb = 'install' ) { | |
if ( $all ) { | |
$args = array_map( function( $file ){ | |
return Utils\get_plugin_name( $file ); | |
@@ -1093,7 +1108,9 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade { | |
if ( ! $all ) { | |
WP_CLI::error( 'Please specify one or more plugins, or use --all.' ); | |
} | |
- WP_CLI::success( 'No plugins installed.' ); // Don't error if --all given for BC. | |
+ | |
+ $past_tense_verb = Utils\past_tense_verb( $verb ); | |
+ WP_CLI::success( "No plugins {$past_tense_verb}." ); // Don't error if --all given for BC. | |
} | |
return $args; | |
diff --git a/vendor/wp-cli/package-command/src/Package_Command.php b/vendor/wp-cli/package-command/src/Package_Command.php | |
index e2dee2c..bab96b7 100644 | |
--- a/vendor/wp-cli/package-command/src/Package_Command.php | |
+++ b/vendor/wp-cli/package-command/src/Package_Command.php | |
@@ -558,7 +558,6 @@ class Package_Command extends WP_CLI_Command { | |
* Gets a Composer instance. | |
*/ | |
private function get_composer() { | |
- $this->avoid_composer_ca_bundle(); | |
try { | |
$composer_path = $this->get_composer_json_path(); | |
@@ -586,7 +585,6 @@ class Package_Command extends WP_CLI_Command { | |
static $community_packages; | |
if ( null === $community_packages ) { | |
- $this->avoid_composer_ca_bundle(); | |
try { | |
$community_packages = $this->package_index()->getPackages(); | |
} catch( Exception $e ) { | |
@@ -994,11 +992,7 @@ class Package_Command extends WP_CLI_Command { | |
$response = WP_CLI\Utils\http_request( 'GET', $raw_content_url, null /*data*/, $headers ); | |
if ( 20 != substr( $response->status_code, 0, 2 ) ) { | |
- // Could not get composer.json. Possibly private so warn and return best guess from input (always xxx/xxx). | |
- $package_name = explode( '/', $package_name ); | |
- $package_name = $package_name[1]; | |
- WP_CLI::warning( sprintf( "Couldn't download composer.json file from '%s' (HTTP code %d). Presuming package name is '%s'.", $raw_content_url, $response->status_code, $package_name ) ); | |
- return $package_name; | |
+ WP_CLI::error( sprintf( "Couldn't download composer.json file from '%s' (HTTP code %d).", $raw_content_url, $response->status_code ) ); | |
} | |
// Convert composer.json JSON to Array. | |
@@ -1067,16 +1061,6 @@ class Package_Command extends WP_CLI_Command { | |
} | |
/** | |
- * Avoid using default Composer CA bundle if in phar as we don't include it. | |
- * See https://github.com/composer/ca-bundle/blob/1.1.0/src/CaBundle.php#L64 | |
- */ | |
- private function avoid_composer_ca_bundle() { | |
- if ( Utils\inside_phar() && ! getenv( 'SSL_CERT_FILE' ) && ! getenv( 'SSL_CERT_DIR' ) && ! ini_get( 'openssl.cafile' ) && ! ini_get( 'openssl.capath' ) ) { | |
- putenv( 'SSL_CERT_FILE=phar://wp-cli.phar/vendor/rmccue/requests/library/Requests/Transport/cacert.pem' ); | |
- } | |
- } | |
- | |
- /** | |
* Reads the WP-CLI packages composer.json, checking validity and returning array containing its path, contents, and decoded contents. | |
* | |
* @return array Indexed array containing the path, the contents, and the decoded contents of the WP-CLI packages composer.json. | |
diff --git a/vendor/wp-cli/php-cli-tools/lib/cli/Streams.php b/vendor/wp-cli/php-cli-tools/lib/cli/Streams.php | |
index 85e2929..1dbfcd6 100644 | |
--- a/vendor/wp-cli/php-cli-tools/lib/cli/Streams.php | |
+++ b/vendor/wp-cli/php-cli-tools/lib/cli/Streams.php | |
@@ -165,7 +165,7 @@ class Streams { | |
self::out( $question . $marker ); | |
$line = self::input( null, $hide ); | |
- if ( trim( $line ) !== '' ) | |
+ if( !empty( $line ) ) | |
return $line; | |
if( $default !== false ) | |
return $default; | |
diff --git a/vendor/wp-cli/php-cli-tools/lib/cli/progress/Bar.php b/vendor/wp-cli/php-cli-tools/lib/cli/progress/Bar.php | |
index e800509..e05ef50 100644 | |
--- a/vendor/wp-cli/php-cli-tools/lib/cli/progress/Bar.php | |
+++ b/vendor/wp-cli/php-cli-tools/lib/cli/progress/Bar.php | |
@@ -13,7 +13,6 @@ | |
namespace cli\progress; | |
use cli; | |
-use cli\Notify; | |
use cli\Progress; | |
use cli\Shell; | |
use cli\Streams; | |
@@ -47,7 +46,7 @@ class Bar extends Progress { | |
public function display($finish = false) { | |
$_percent = $this->percent(); | |
- $percent = str_pad(floor($_percent * 100), 3); | |
+ $percent = str_pad(floor($_percent * 100), 3);; | |
$msg = $this->_message; | |
$msg = Streams::render($this->_formatMessage, compact('msg', 'percent')); | |
@@ -67,19 +66,4 @@ class Bar extends Progress { | |
Streams::out($this->_format, compact('msg', 'bar', 'timing')); | |
} | |
- | |
- /** | |
- * This method augments the base definition from cli\Notify to optionally | |
- * allow passing a new message. | |
- * | |
- * @param int $increment The amount to increment by. | |
- * @param string $msg The text to display next to the Notifier. (optional) | |
- * @see cli\Notify::tick() | |
- */ | |
- public function tick($increment = 1, $msg = null) { | |
- if ($msg) { | |
- $this->_message = $msg; | |
- } | |
- Notify::tick($increment); | |
- } | |
} | |
diff --git a/vendor/wp-cli/role-command/src/Capabilities_Command.php b/vendor/wp-cli/role-command/src/Capabilities_Command.php | |
index 8a5a092..4a5ac62 100644 | |
--- a/vendor/wp-cli/role-command/src/Capabilities_Command.php | |
+++ b/vendor/wp-cli/role-command/src/Capabilities_Command.php | |
@@ -45,12 +45,6 @@ class Capabilities_Command extends WP_CLI_Command { | |
* - count | |
* - yaml | |
* --- | |
- * | |
- * [--show-grant] | |
- * : Display all capabilities defined for a role including grant. | |
- * --- | |
- * default: false | |
- * --- | |
* | |
* ## EXAMPLES | |
* | |
@@ -66,38 +60,21 @@ class Capabilities_Command extends WP_CLI_Command { | |
*/ | |
public function list_( $args, $assoc_args ) { | |
$role_obj = self::get_role( $args[0] ); | |
- | |
- $show_grant = ! empty( $assoc_args['show-grant'] ); | |
- | |
- if ( $show_grant ) { | |
- array_push( $this->fields, 'grant' ); | |
- $capabilities = $role_obj->capabilities; | |
- } | |
- else { | |
- $capabilities = array_filter( $role_obj->capabilities ); | |
- } | |
- | |
- $output_caps = array(); | |
- foreach ( $capabilities as $cap => $grant ) { | |
- $output_cap = new StdClass; | |
- | |
- $output_cap->name = $cap; | |
- $output_cap->grant = ( $grant ) ? 'true' : 'false'; | |
- | |
- $output_caps[] = $output_cap; | |
- } | |
if ( 'list' === $assoc_args['format'] ) { | |
- foreach ( $output_caps as $cap ) { | |
- if ( $show_grant ) { | |
- WP_CLI::line( implode( ',', array( $cap->name, $cap->grant ) ) ); | |
- } | |
- else { | |
- WP_CLI::line( $cap->name ); | |
- } | |
+ foreach ( array_keys( $role_obj->capabilities ) as $cap ) { | |
+ WP_CLI::line( $cap ); | |
} | |
} | |
else { | |
+ $output_caps = array(); | |
+ foreach ( array_keys( $role_obj->capabilities ) as $cap ) { | |
+ $output_cap = new stdClass; | |
+ | |
+ $output_cap->name = $cap; | |
+ | |
+ $output_caps[] = $output_cap; | |
+ } | |
$formatter = new \WP_CLI\Formatter( $assoc_args, $this->fields ); | |
$formatter->display_items( $output_caps ); | |
} | |
@@ -113,15 +90,6 @@ class Capabilities_Command extends WP_CLI_Command { | |
* | |
* <cap>... | |
* : One or more capabilities to add. | |
- * | |
- * [--grant] | |
- * : Adds the capability as an explicit boolean value, instead of implicitly defaulting to `true`. | |
- * --- | |
- * default: true | |
- * options: | |
- * - true | |
- * - false | |
- * --- | |
* | |
* ## EXAMPLES | |
* | |
@@ -129,34 +97,25 @@ class Capabilities_Command extends WP_CLI_Command { | |
* $ wp cap add author spectate | |
* Success: Added 1 capability to 'author' role. | |
*/ | |
- public function add( $args, $assoc_args ) { | |
+ public function add( $args ) { | |
self::persistence_check(); | |
$role = array_shift( $args ); | |
$role_obj = self::get_role( $role ); | |
- $grant = ! isset( $assoc_args['grant'] ) || ! empty( $assoc_args['grant'] ); | |
- | |
$count = 0; | |
foreach ( $args as $cap ) { | |
- if ( true === $grant && $role_obj->has_cap( $cap ) ) | |
- continue; | |
- | |
- if ( false === $grant && isset( $role_obj->capabilities[ $cap ] ) && false === $role_obj->capabilities[ $cap ] ) | |
+ if ( $role_obj->has_cap( $cap ) ) | |
continue; | |
- $role_obj->add_cap( $cap, $grant ); | |
+ $role_obj->add_cap( $cap ); | |
$count++; | |
} | |
- if ( $grant ) { | |
- $message = ( 1 === $count ) ? "Added %d capability to '%s' role." : "Added %d capabilities to '%s' role."; | |
- } else { | |
- $message = ( 1 === $count ) ? "Added %d capability to '%s' role as false." : "Added %d capabilities to '%s' role as false."; | |
- } | |
+ $message = ( 1 === $count ) ? "Added %d capability to '%s' role." : "Added %d capabilities to '%s' role."; | |
WP_CLI::success( sprintf( $message, $count, $role ) ); | |
} | |
@@ -187,7 +146,7 @@ class Capabilities_Command extends WP_CLI_Command { | |
$count = 0; | |
foreach ( $args as $cap ) { | |
- if ( ! isset( $role_obj->capabilities[ $cap ] ) ) | |
+ if ( !$role_obj->has_cap( $cap ) ) | |
continue; | |
$role_obj->remove_cap( $cap ); | |
diff --git a/vendor/wp-cli/role-command/src/Role_Command.php b/vendor/wp-cli/role-command/src/Role_Command.php | |
index 2ef920f..6c1c1db 100644 | |
--- a/vendor/wp-cli/role-command/src/Role_Command.php | |
+++ b/vendor/wp-cli/role-command/src/Role_Command.php | |
@@ -49,9 +49,6 @@ class Role_Command extends WP_CLI_Command { | |
* [--fields=<fields>] | |
* : Limit the output to specific object fields. | |
* | |
- * [--field=<field>] | |
- * : Prints the value of a single field. | |
- * | |
* [--format=<format>] | |
* : Render output in a particular format. | |
* --- | |
diff --git a/vendor/wp-cli/scaffold-command/src/Scaffold_Command.php b/vendor/wp-cli/scaffold-command/src/Scaffold_Command.php | |
index 9532616..0ab09b2 100644 | |
--- a/vendor/wp-cli/scaffold-command/src/Scaffold_Command.php | |
+++ b/vendor/wp-cli/scaffold-command/src/Scaffold_Command.php | |
@@ -290,8 +290,6 @@ class Scaffold_Command extends WP_CLI_Command { | |
$data['namespace'] = $control_args['plugin'] ? $control_args['plugin'] : $this->get_theme_name( $control_args['theme'] ); | |
$data['machine_name'] = $this->generate_machine_name( $slug ); | |
- $data['plugin'] = $control_args['plugin'] ? true : false; | |
- $data['theme'] = ! $data['plugin']; | |
$block_dir = $this->get_output_path( $control_args, "/blocks" ); | |
if ( ! $block_dir ) { | |
@@ -300,7 +298,7 @@ class Scaffold_Command extends WP_CLI_Command { | |
$files_written = $this->create_files( array( | |
"$block_dir/$slug.php" => self::mustache_render( 'block-php.mustache', $data ), | |
- "$block_dir/$slug/index.js" => self::mustache_render( 'block-index-js.mustache', $data ), | |
+ "$block_dir/$slug/block.js" => self::mustache_render( 'block-block-js.mustache', $data ), | |
"$block_dir/$slug/editor.css" => self::mustache_render( 'block-editor-css.mustache', $data ), | |
"$block_dir/$slug/style.css" => self::mustache_render( 'block-style-css.mustache', $data ), | |
), $control_args['force'] ); | |
@@ -723,7 +721,6 @@ class Scaffold_Command extends WP_CLI_Command { | |
* - travis | |
* - circle | |
* - gitlab | |
- * - bitbucket | |
* --- | |
* | |
* [--force] | |
@@ -776,7 +773,6 @@ class Scaffold_Command extends WP_CLI_Command { | |
* - travis | |
* - circle | |
* - gitlab | |
- * - bitbucket | |
* --- | |
* | |
* [--force] | |
@@ -869,13 +865,10 @@ class Scaffold_Command extends WP_CLI_Command { | |
if ( 'travis' === $assoc_args['ci'] ) { | |
$files_to_create["{$target_dir}/.travis.yml"] = self::mustache_render( 'plugin-travis.mustache', compact( 'wp_versions_to_test' ) ); | |
} else if ( 'circle' === $assoc_args['ci'] ) { | |
- $files_to_create["{$target_dir}/.circleci/config.yml"] = self::mustache_render( 'plugin-circle.mustache', compact( 'wp_versions_to_test' ) ); | |
+ $files_to_create["{$target_dir}/circle.yml"] = self::mustache_render( 'plugin-circle.mustache', compact( 'wp_versions_to_test' ) ); | |
} else if ( 'gitlab' === $assoc_args['ci'] ) { | |
$files_to_create["{$target_dir}/.gitlab-ci.yml"] = self::mustache_render( 'plugin-gitlab.mustache' ); | |
- } else if ( 'bitbucket' === $assoc_args['ci'] ) { | |
- $files_to_create["{$target_dir}/bitbucket-pipelines.yml"] = self::mustache_render( 'plugin-bitbucket.mustache' ); | |
} | |
- | |
$files_written = $this->create_files( $files_to_create, $force ); | |
$to_copy = array( | |
diff --git a/vendor/wp-cli/scaffold-command/templates/block-block-js.mustache b/vendor/wp-cli/scaffold-command/templates/block-block-js.mustache | |
new file mode 100644 | |
index 0000000..7227631 | |
--- /dev/null | |
+++ b/vendor/wp-cli/scaffold-command/templates/block-block-js.mustache | |
@@ -0,0 +1,84 @@ | |
+( function( wp ) { | |
+ /** | |
+ * Registers a new block provided a unique name and an object defining its behavior. | |
+ * @see https://github.com/WordPress/gutenberg/tree/master/blocks#api | |
+ */ | |
+ var registerBlockType = wp.blocks.registerBlockType; | |
+ /** | |
+ * Returns a new element of given type. Element is an abstraction layer atop React. | |
+ * @see https://github.com/WordPress/gutenberg/tree/master/element#element | |
+ */ | |
+ var el = wp.element.createElement; | |
+ /** | |
+ * Retrieves the translation of text. | |
+ * @see https://github.com/WordPress/gutenberg/tree/master/i18n#api | |
+ */ | |
+ var __ = wp.i18n.__; | |
+ | |
+ /** | |
+ * Every block starts by registering a new block type definition. | |
+ * @see https://wordpress.org/gutenberg/handbook/block-api/ | |
+ */ | |
+ registerBlockType( '{{namespace}}/{{slug}}', { | |
+ /** | |
+ * This is the display title for your block, which can be translated with `i18n` functions. | |
+ * The block inserter will show this name. | |
+ */ | |
+ title: __( '{{title_ucfirst}}' ), | |
+ | |
+ {{#dashicon}} | |
+ /** | |
+ * An icon property should be specified to make it easier to identify a block. | |
+ * These can be any of WordPress’ Dashicons, or a custom svg element. | |
+ */ | |
+ icon: '{{dashicon}}', | |
+ | |
+ {{/dashicon}} | |
+ /** | |
+ * Blocks are grouped into categories to help users browse and discover them. | |
+ * The categories provided by core are `common`, `embed`, `formatting`, `layout` and `widgets`. | |
+ */ | |
+ category: '{{category}}', | |
+ | |
+ /** | |
+ * Optional block extended support features. | |
+ */ | |
+ supports: { | |
+ // Removes support for an HTML mode. | |
+ html: false, | |
+ }, | |
+ | |
+ /** | |
+ * The edit function describes the structure of your block in the context of the editor. | |
+ * This represents what the editor will render when the block is used. | |
+ * @see https://wordpress.org/gutenberg/handbook/block-edit-save/#edit | |
+ * | |
+ * @param {Object} [props] Properties passed from the editor. | |
+ * @return {Element} Element to render. | |
+ */ | |
+ edit: function( props ) { | |
+ return el( | |
+ 'p', | |
+ { className: props.className }, | |
+ __( 'Hello from the editor!' ) | |
+ ); | |
+ }, | |
+ | |
+ /** | |
+ * The save function defines the way in which the different attributes should be combined | |
+ * into the final markup, which is then serialized by Gutenberg into `post_content`. | |
+ * @see https://wordpress.org/gutenberg/handbook/block-edit-save/#save | |
+ * | |
+ * @return {Element} Element to render. | |
+ */ | |
+ save: function() { | |
+ return el( | |
+ 'p', | |
+ {}, | |
+ __( 'Hello from the saved content!' ) | |
+ ); | |
+ } | |
+ } ); | |
+} )( | |
+ window.wp | |
+); | |
diff --git a/vendor/wp-cli/scaffold-command/templates/block-php.mustache b/vendor/wp-cli/scaffold-command/templates/block-php.mustache | |
index 43f6708..d09fc46 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/block-php.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/block-php.mustache | |
@@ -13,39 +13,24 @@ | |
* @see https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts | |
*/ | |
function {{machine_name}}_block_init() { | |
- {{#plugin}} | |
$dir = dirname( __FILE__ ); | |
- {{/plugin}} | |
- {{#theme}} | |
- $dir = get_template_directory() . '/blocks'; | |
- {{/theme}} | |
- $index_js = '{{slug}}/index.js'; | |
+ $block_js = '{{slug}}/block.js'; | |
wp_register_script( | |
'{{slug}}-block-editor', | |
- {{#plugin}} | |
- plugins_url( $index_js, __FILE__ ), | |
- {{/plugin}} | |
- {{#theme}} | |
- get_template_directory_uri() . "/blocks/$index_js, | |
- {{/theme}} | |
+ plugins_url( $block_js, __FILE__ ), | |
array( | |
'wp-blocks', | |
'wp-i18n', | |
'wp-element', | |
), | |
- filemtime( "$dir/$index_js" ) | |
+ filemtime( "$dir/$block_js" ) | |
); | |
$editor_css = '{{slug}}/editor.css'; | |
wp_register_style( | |
'{{slug}}-block-editor', | |
- {{#plugin}} | |
plugins_url( $editor_css, __FILE__ ), | |
- {{/plugin}} | |
- {{#theme}} | |
- get_template_directory_uri() . "/blocks/$editor_css", | |
- {{/theme}} | |
array( | |
'wp-blocks', | |
), | |
@@ -55,12 +40,7 @@ function {{machine_name}}_block_init() { | |
$style_css = '{{slug}}/style.css'; | |
wp_register_style( | |
'{{slug}}-block', | |
- {{#plugin}} | |
plugins_url( $style_css, __FILE__ ), | |
- {{/plugin}} | |
- {{#theme}} | |
- get_template_directory_uri() . "/blocks/$style_css", | |
- {{/theme}} | |
array( | |
'wp-blocks', | |
), | |
diff --git a/vendor/wp-cli/scaffold-command/templates/install-wp-tests.sh b/vendor/wp-cli/scaffold-command/templates/install-wp-tests.sh | |
index 364f839..878881f 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/install-wp-tests.sh | |
+++ b/vendor/wp-cli/scaffold-command/templates/install-wp-tests.sh | |
@@ -95,7 +95,7 @@ install_wp() { | |
install_test_suite() { | |
# portable in-place argument for both GNU sed and Mac OSX sed | |
if [[ $(uname -s) == 'Darwin' ]]; then | |
- local ioption='-i.bak' | |
+ local ioption='-i .bak' | |
else | |
local ioption='-i' | |
fi | |
diff --git a/vendor/wp-cli/scaffold-command/templates/phpunit.xml.dist b/vendor/wp-cli/scaffold-command/templates/phpunit.xml.dist | |
index 16a3902..d9af975 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/phpunit.xml.dist | |
+++ b/vendor/wp-cli/scaffold-command/templates/phpunit.xml.dist | |
@@ -10,7 +10,6 @@ | |
<testsuites> | |
<testsuite> | |
<directory prefix="test-" suffix=".php">./tests/</directory> | |
- <exclude>./tests/test-sample.php</exclude> | |
</testsuite> | |
</testsuites> | |
</phpunit> | |
diff --git a/vendor/wp-cli/scaffold-command/templates/plugin-circle.mustache b/vendor/wp-cli/scaffold-command/templates/plugin-circle.mustache | |
index 4d87e00..2f6a8c6 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/plugin-circle.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/plugin-circle.mustache | |
@@ -1,146 +1,39 @@ | |
-workflows: | |
- version: 2 | |
- main: | |
- jobs: | |
- - php56-build | |
- - php70-build | |
- - php71-build | |
- - php72-build | |
+machine: | |
+ php: | |
+ version: 5.6.22 | |
+ environment: | |
+ WP_TESTS_DIR: /tmp/wordpress-tests-lib | |
+ WP_CORE_DIR: /tmp/wordpress/ | |
+ PATH: $HOME/.composer/vendor/bin:$PATH | |
-version: 2 | |
-jobs: | |
- php56-build: | |
- docker: | |
- - image: circleci/php:5.6 | |
- - image: circleci/mysql:5.7 | |
- environment: | |
- - WP_TESTS_DIR: "/tmp/wordpress-tests-lib" | |
- - WP_CORE_DIR: "/tmp/wordpress/" | |
- steps: | |
- - checkout | |
- - run: | |
- name: "Setup Environment Variables" | |
- command: | | |
- echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV | |
- source /home/circleci/.bashrc | |
- - run: | |
- name: "Install Dependencies" | |
- command: | | |
- sudo apt-get update && sudo apt-get install subversion | |
- sudo docker-php-ext-install mysqli | |
- sudo sh -c "printf '\ndeb http://ftp.us.debian.org/debian sid main\n' >> /etc/apt/sources.list" | |
- sudo apt-get update && sudo apt-get install mysql-client-5.7 | |
- - run: | |
- name: "Run Tests" | |
- command: | | |
- composer global require "phpunit/phpunit=5.7.*" | |
- composer global require wp-coding-standards/wpcs | |
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs | |
- phpcs | |
- SKIP_DB_CREATE=false | |
- {{#wp_versions_to_test}} | |
- rm -rf $WP_TESTS_DIR $WP_CORE_DIR | |
- bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 {{.}} $SKIP_DB_CREATE | |
- phpunit | |
- WP_MULTISITE=1 phpunit | |
- SKIP_DB_CREATE=true | |
- {{/wp_versions_to_test}} | |
+dependencies: | |
+ pre: | |
+ - sudo apt-get update; sudo apt-get install subversion | |
- php70-build: | |
- docker: | |
- - image: circleci/php:7.0 | |
- - image: circleci/mysql:5.7 | |
- environment: | |
- - WP_TESTS_DIR: "/tmp/wordpress-tests-lib" | |
- - WP_CORE_DIR: "/tmp/wordpress/" | |
- steps: | |
- - checkout | |
- - run: | |
- name: "Setup Environment Variables" | |
- command: | | |
- echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV | |
- source /home/circleci/.bashrc | |
- - run: | |
- name: "Install Dependencies" | |
- command: | | |
- sudo apt-get update && sudo apt-get install subversion | |
- sudo docker-php-ext-install mysqli | |
- sudo sh -c "printf '\ndeb http://ftp.us.debian.org/debian sid main\n' >> /etc/apt/sources.list" | |
- sudo apt-get update && sudo apt-get install mysql-client-5.7 | |
- - run: | |
- name: "Run Tests" | |
- command: | | |
- composer global require "phpunit/phpunit=5.7.*" | |
- composer global require wp-coding-standards/wpcs | |
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs | |
- phpcs | |
- rm -rf $WP_TESTS_DIR $WP_CORE_DIR | |
- bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest | |
- phpunit | |
- WP_MULTISITE=1 phpunit | |
- | |
- php71-build: | |
- docker: | |
- - image: circleci/php:7.1 | |
- - image: circleci/mysql:5.7 | |
- environment: | |
- - WP_TESTS_DIR: "/tmp/wordpress-tests-lib" | |
- - WP_CORE_DIR: "/tmp/wordpress/" | |
- steps: | |
- - checkout | |
- - run: | |
- name: "Setup Environment Variables" | |
- command: | | |
- echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV | |
- source /home/circleci/.bashrc | |
- - run: | |
- name: "Install Dependencies" | |
- command: | | |
- sudo apt-get update && sudo apt-get install subversion | |
- sudo docker-php-ext-install mysqli | |
- sudo sh -c "printf '\ndeb http://ftp.us.debian.org/debian sid main\n' >> /etc/apt/sources.list" | |
- sudo apt-get update && sudo apt-get install mysql-client-5.7 | |
- - run: | |
- name: "Run Tests" | |
- command: | | |
- composer global require "phpunit/phpunit=5.7.*" | |
- composer global require wp-coding-standards/wpcs | |
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs | |
- phpcs | |
- rm -rf $WP_TESTS_DIR $WP_CORE_DIR | |
- bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest | |
- phpunit | |
- WP_MULTISITE=1 phpunit | |
- | |
- php72-build: | |
- docker: | |
- - image: circleci/php:7.2 | |
- - image: circleci/mysql:5.7 | |
- environment: | |
- - WP_TESTS_DIR: "/tmp/wordpress-tests-lib" | |
- - WP_CORE_DIR: "/tmp/wordpress/" | |
- steps: | |
- - checkout | |
- - run: | |
- name: "Setup Environment Variables" | |
- command: | | |
- echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV | |
- source /home/circleci/.bashrc | |
- - run: | |
- name: "Install Dependencies" | |
- command: | | |
- sudo apt-get update && sudo apt-get install subversion | |
- sudo docker-php-ext-install mysqli | |
- sudo sh -c "printf '\ndeb http://ftp.us.debian.org/debian sid main\n' >> /etc/apt/sources.list" | |
- sudo apt-get update && sudo apt-get install mysql-client-5.7 | |
- - run: | |
- name: "Run Tests" | |
- command: | | |
- composer global require "phpunit/phpunit=5.7.*" | |
- composer global require wp-coding-standards/wpcs | |
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs | |
- phpcs | |
- rm -rf $WP_TESTS_DIR $WP_CORE_DIR | |
- bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest | |
- phpunit | |
- WP_MULTISITE=1 phpunit | |
+test: | |
+ pre: | |
+ - composer global require "phpunit/phpunit=5.7.*" | |
+ - | | |
+ composer global require wp-coding-standards/wpcs | |
+ phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs | |
+ override: | |
+ - phpcs | |
+ {{#wp_versions_to_test}} | |
+ - | | |
+ rm -rf $WP_TESTS_DIR $WP_CORE_DIR | |
+ bash bin/install-wp-tests.sh wordpress_test ubuntu '' 127.0.0.1 {{.}} | |
+ phpunit | |
+ WP_MULTISITE=1 phpunit | |
+ {{/wp_versions_to_test}} | |
+ - | | |
+ phpenv global 7.0.17 | |
+ rm -rf $WP_TESTS_DIR $WP_CORE_DIR | |
+ bash bin/install-wp-tests.sh wordpress_test ubuntu '' 127.0.0.1 latest | |
+ phpunit | |
+ WP_MULTISITE=1 phpunit | |
+ - | | |
+ phpenv global 7.1.3 | |
+ rm -rf $WP_TESTS_DIR $WP_CORE_DIR | |
+ bash bin/install-wp-tests.sh wordpress_test ubuntu '' 127.0.0.1 latest | |
+ phpunit | |
+ WP_MULTISITE=1 phpunit | |
diff --git a/vendor/wp-cli/scaffold-command/templates/plugin-distignore.mustache b/vendor/wp-cli/scaffold-command/templates/plugin-distignore.mustache | |
index 6b7c70e..962c3e3 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/plugin-distignore.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/plugin-distignore.mustache | |
@@ -8,9 +8,8 @@ | |
.DS_Store | |
Thumbs.db | |
behat.yml | |
-bitbucket-pipelines.yml | |
bin | |
-.circleci/config.yml | |
+circle.yml | |
composer.json | |
composer.lock | |
Gruntfile.js | |
diff --git a/vendor/wp-cli/scaffold-command/templates/plugin-gitlab.mustache b/vendor/wp-cli/scaffold-command/templates/plugin-gitlab.mustache | |
index 78d1f13..6c7ca7e 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/plugin-gitlab.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/plugin-gitlab.mustache | |
@@ -55,11 +55,3 @@ PHPunit:PHP7.1:MySQL: | |
script: | |
- phpcs | |
- phpunit | |
- | |
-PHPunit:PHP7.2:MySQL: | |
- image: tetraweb/php:7.2 | |
- services: | |
- - mysql:5.6 | |
- script: | |
- - phpcs | |
- - phpunit | |
diff --git a/vendor/wp-cli/scaffold-command/templates/plugin-readme.mustache b/vendor/wp-cli/scaffold-command/templates/plugin-readme.mustache | |
index dc9fb00..d796640 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/plugin-readme.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/plugin-readme.mustache | |
@@ -2,7 +2,7 @@ | |
Contributors: (this should be a list of wordpress.org userid's) | |
Donate link: https://example.com/ | |
Tags: comments, spam | |
-Requires at least: 4.5 | |
+Requires at least: 4.4 | |
Tested up to: {{plugin_tested_up_to}} | |
Stable tag: 0.1.0 | |
License: GPLv2 or later | |
diff --git a/vendor/wp-cli/scaffold-command/templates/plugin-test-sample.mustache b/vendor/wp-cli/scaffold-command/templates/plugin-test-sample.mustache | |
index 1fe7bf4..2e897d1 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/plugin-test-sample.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/plugin-test-sample.mustache | |
@@ -13,7 +13,7 @@ class SampleTest extends WP_UnitTestCase { | |
/** | |
* A single example test. | |
*/ | |
- public function test_sample() { | |
+ function test_sample() { | |
// Replace this with some actual testing code. | |
$this->assertTrue( true ); | |
} | |
diff --git a/vendor/wp-cli/scaffold-command/templates/plugin-travis.mustache b/vendor/wp-cli/scaffold-command/templates/plugin-travis.mustache | |
index 7ec76b9..0825f29 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/plugin-travis.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/plugin-travis.mustache | |
@@ -18,8 +18,6 @@ cache: | |
matrix: | |
include: | |
- - php: 7.2 | |
- env: WP_VERSION=latest | |
- php: 7.1 | |
env: WP_VERSION=latest | |
- php: 7.0 | |
diff --git a/vendor/wp-cli/scaffold-command/templates/theme-bootstrap.mustache b/vendor/wp-cli/scaffold-command/templates/theme-bootstrap.mustache | |
index 447eeeb..d8e1355 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/theme-bootstrap.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/theme-bootstrap.mustache | |
@@ -6,22 +6,17 @@ | |
*/ | |
$_tests_dir = getenv( 'WP_TESTS_DIR' ); | |
- | |
if ( ! $_tests_dir ) { | |
- $_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib'; | |
+ $_tests_dir = '/tmp/wordpress-tests-lib'; | |
} | |
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) { | |
- echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; | |
- exit( 1 ); | |
+ throw new Exception( "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" ); | |
} | |
// Give access to tests_add_filter() function. | |
require_once $_tests_dir . '/includes/functions.php'; | |
-/** | |
- * Registers theme | |
- */ | |
function _register_theme() { | |
$theme_dir = dirname( __DIR__ ); | |
diff --git a/vendor/wp-cli/scaffold-command/templates/theme-test-sample.mustache b/vendor/wp-cli/scaffold-command/templates/theme-test-sample.mustache | |
index fb44cdc..ec78927 100644 | |
--- a/vendor/wp-cli/scaffold-command/templates/theme-test-sample.mustache | |
+++ b/vendor/wp-cli/scaffold-command/templates/theme-test-sample.mustache | |
@@ -13,7 +13,7 @@ class SampleTest extends WP_UnitTestCase { | |
/** | |
* A single example test. | |
*/ | |
- public function test_sample() { | |
+ function test_sample() { | |
// Replace this with some actual testing code. | |
$this->assertTrue( true ); | |
} | |
diff --git a/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php b/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php | |
index 46d585b..df2e416 100644 | |
--- a/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php | |
+++ b/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php | |
@@ -383,6 +383,9 @@ class Search_Replace_Command extends WP_CLI_Command { | |
$success_message = 1 === $total ? "Made 1 replacement." : "Made $total replacements."; | |
if ( $total && 'Default' !== WP_CLI\Utils\wp_get_cache_type() ) { | |
$success_message .= ' Please remember to flush your persistent object cache with `wp cache flush`.'; | |
+ if ( is_multisite() ) { | |
+ $success_message .= ' If you see a "Site not found" error after replacing a domain, try flushing cache against the old domain (which may be the cached lookup value).'; | |
+ } | |
} | |
} | |
WP_CLI::success( $success_message ); | |
diff --git a/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php b/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php | |
index 1676c30..bc8660d 100644 | |
--- a/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php | |
+++ b/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php | |
@@ -2,9 +2,6 @@ | |
namespace WP_CLI; | |
-use ArrayObject; | |
-use Exception; | |
- | |
class SearchReplacer { | |
private $from, $to; | |
@@ -90,19 +87,9 @@ class SearchReplacer { | |
} | |
} | |
- elseif ( $this->recurse_objects && ( is_object( $data ) || $data instanceof \__PHP_Incomplete_Class ) ) { | |
- if ( $data instanceof \__PHP_Incomplete_Class ) { | |
- $array = new ArrayObject( $data ); | |
- \WP_CLI::warning( | |
- sprintf( | |
- 'Skipping an uninitialized class "%s", replacements might not be complete.', | |
- $array['__PHP_Incomplete_Class_Name'] | |
- ) | |
- ); | |
- } else { | |
- foreach ( $data as $key => $value ) { | |
- $data->$key = $this->_run( $value, false, $recursion_level + 1, $visited_data ); | |
- } | |
+ elseif ( $this->recurse_objects && is_object( $data ) ) { | |
+ foreach ( $data as $key => $value ) { | |
+ $data->$key = $this->_run( $value, false, $recursion_level + 1, $visited_data ); | |
} | |
} | |
@@ -115,17 +102,7 @@ class SearchReplacer { | |
$search_regex .= $this->from; | |
$search_regex .= $this->regex_delimiter; | |
$search_regex .= $this->regex_flags; | |
- | |
- $result = preg_replace( $search_regex, $this->to, $data ); | |
- if ( null === $result || PREG_NO_ERROR !== preg_last_error() ) { | |
- \WP_CLI::warning( | |
- sprintf( | |
- 'The provided regular expression threw a PCRE error - %s', | |
- $this->preg_error_message( $result ) | |
- ) | |
- ); | |
- } | |
- $data = $result; | |
+ $data = preg_replace( $search_regex, $this->to, $data ); | |
} else { | |
$data = str_replace( $this->from, $this->to, $data ); | |
} | |
@@ -158,27 +135,5 @@ class SearchReplacer { | |
public function clear_log_data() { | |
$this->log_data = array(); | |
} | |
- | |
- /** | |
- * Get the PCRE error constant name from an error value. | |
- * | |
- * @param integer $error Error code. | |
- * @return string Error constant name. | |
- */ | |
- private function preg_error_message( $error ) { | |
- static $error_names = null; | |
- | |
- if ( null === $error_names ) { | |
- $definitions = get_defined_constants( true ); | |
- $pcre_constants = array_key_exists( 'pcre', $definitions ) | |
- ? $definitions['pcre'] | |
- : array(); | |
- $error_names = array_flip( $pcre_constants ); | |
- } | |
- | |
- return isset( $error_names[ $error ] ) | |
- ? $error_names[ $error ] | |
- : '<unknown error>'; | |
- } | |
} | |
-- | |
2.10.1 (Apple Git-78) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment