Hello community, here is the log from the commit of package platformsh-cli for openSUSE:Factory checked in at 2017-04-28 09:13:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/platformsh-cli (Old) and /work/SRC/openSUSE:Factory/.platformsh-cli.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "platformsh-cli" Fri Apr 28 09:13:54 2017 rev:8 rq:491315 version:3.15.1 Changes: -------- --- /work/SRC/openSUSE:Factory/platformsh-cli/platformsh-cli.changes 2017-04-20 20:57:29.688434459 +0200 +++ /work/SRC/openSUSE:Factory/.platformsh-cli.new/platformsh-cli.changes 2017-04-28 09:13:56.784641352 +0200 @@ -1,0 +2,21 @@ +Wed Apr 26 16:39:33 UTC 2017 - ji...@boombatower.com + +- Update to version 3.15.1: + * Add more contextual help in activity:list + * Avoid formatting activity result in CSV/TSV output + * Use pseudo-terminal for SSH + * Remove CommandBase->isTerminal() in favour of Output->isDecorated() + * Remove unnecessary 2>&1 from sql/drush over SSH commands + * Use RequestTty and remove LogLevel hack + * Update dependencies + * ... security-checker still doesn't work via PHP in Travis + * Rely on date_default_timezone_get() instead of UTC fallback + * Update comment + * Ssh issue with windows (#592) + * Add certificate commands (#583) + * Fix return value in certificate:add + * Release v3.15.0 + * Fix certificate:delete confirm question + * Release v3.15.1 + +------------------------------------------------------------------- Old: ---- platformsh-cli-3.14.5.tar.xz New: ---- platformsh-cli-3.15.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ platformsh-cli.spec ++++++ --- /var/tmp/diff_new_pack.ilBRsw/_old 2017-04-28 09:13:57.608525170 +0200 +++ /var/tmp/diff_new_pack.ilBRsw/_new 2017-04-28 09:13:57.612524606 +0200 @@ -17,7 +17,7 @@ Name: platformsh-cli -Version: 3.14.5 +Version: 3.15.1 Release: 0 Summary: The unified tool for managing your Platform.sh services from the command line. # See licenses.txt for dependency licenses. ++++++ _service ++++++ --- /var/tmp/diff_new_pack.ilBRsw/_old 2017-04-28 09:13:57.652518966 +0200 +++ /var/tmp/diff_new_pack.ilBRsw/_new 2017-04-28 09:13:57.652518966 +0200 @@ -2,7 +2,7 @@ <service name="tar_scm" mode="disabled"> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> - <param name="revision">refs/tags/v3.14.5</param> + <param name="revision">refs/tags/v3.15.1</param> <param name="url">git://github.com/platformsh/platformsh-cli.git</param> <param name="scm">git</param> <param name="changesgenerate">enable</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.ilBRsw/_old 2017-04-28 09:13:57.672516147 +0200 +++ /var/tmp/diff_new_pack.ilBRsw/_new 2017-04-28 09:13:57.676515583 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/platformsh/platformsh-cli.git</param> - <param name="changesrevision">83d450528b0f2bc0dd108a8ed1e526a620f916fe</param> + <param name="changesrevision">75e6ca004b80b07475892f2feb89e1cda8a17c36</param> </service> </servicedata> ++++++ licenses.txt ++++++ --- /var/tmp/diff_new_pack.ilBRsw/_old 2017-04-28 09:13:57.732507687 +0200 +++ /var/tmp/diff_new_pack.ilBRsw/_new 2017-04-28 09:13:57.736507122 +0200 @@ -6,7 +6,7 @@ Name Version License cocur/slugify v1.4.1 MIT commerceguys/guzzle-oauth2-plugin v2.1.1 MIT -cweagans/composer-patches 1.6.0 BSD-2-Clause +cweagans/composer-patches 1.6.1 BSD-2-Clause doctrine/cache v1.6.1 MIT firebase/php-jwt v2.2.0 BSD-3-Clause guzzlehttp/cache-subscriber 0.1.0 MIT @@ -15,18 +15,18 @@ guzzlehttp/streams 3.0.0 MIT padraic/humbug_get_contents 1.0.4 BSD-3-Clause padraic/phar-updater 1.0.3 BSD-3-Clause -platformsh/client v0.9.0 MIT +platformsh/client v0.10.0 MIT platformsh/console-form v0.0.8 MIT psr/log 1.0.2 MIT -react/promise v2.5.0 MIT +react/promise v2.5.1 MIT stecman/symfony-console-completion 0.7.0 MIT -symfony/config v3.2.6 MIT -symfony/console v3.2.4 MIT -symfony/debug v3.2.6 MIT -symfony/dependency-injection v3.2.6 MIT -symfony/event-dispatcher v3.2.6 MIT -symfony/filesystem v3.2.6 MIT -symfony/finder v3.2.6 MIT +symfony/config v3.2.7 MIT +symfony/console v3.2.7 MIT +symfony/debug v3.2.7 MIT +symfony/dependency-injection v3.2.7 MIT +symfony/event-dispatcher v3.2.7 MIT +symfony/filesystem v3.2.7 MIT +symfony/finder v3.2.7 MIT symfony/polyfill-mbstring v1.3.0 MIT -symfony/process v3.2.4 MIT -symfony/yaml v3.2.6 MIT +symfony/process v3.2.7 MIT +symfony/yaml v3.2.7 MIT ++++++ platformsh-cli-3.14.5.tar.xz -> platformsh-cli-3.15.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/README.md new/platformsh-cli-3.15.1/README.md --- old/platformsh-cli-3.14.5/README.md 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/README.md 2017-04-26 16:54:54.000000000 +0200 @@ -85,6 +85,11 @@ auth:info Display your account information auth:login (login) Log in to Platform.sh auth:logout (logout) Log out of Platform.sh +certificate + certificate:add Add an SSL certificate to the project + certificate:delete Delete a certificate from the project + certificate:get View a certificate + certificate:list (certificates) List project certificates db db:dump Create a local dump of the remote database db:size Estimate the disk usage of a database diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/composer.json new/platformsh-cli-3.15.1/composer.json --- old/platformsh-cli-3.14.5/composer.json 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/composer.json 2017-04-26 16:54:54.000000000 +0200 @@ -8,7 +8,7 @@ "guzzlehttp/guzzle": "^5.3", "guzzlehttp/ringphp": "^1.1", "platformsh/console-form": "0.0.8", - "platformsh/client": "^0.9", + "platformsh/client": "^0.10", "symfony/console": "^3.0 !=3.2.5 !=3.2.6", "symfony/yaml": "^3.0 || ^2.6", "symfony/finder": "^3.0", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/composer.lock new/platformsh-cli-3.15.1/composer.lock --- old/platformsh-cli-3.14.5/composer.lock 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/composer.lock 2017-04-26 16:54:54.000000000 +0200 @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "5e12bd35449c6bbfe017f04b0a9d398f", + "content-hash": "45c0dda3a1b95ceb517677403cf37592", "packages": [ { "name": "cocur/slugify", @@ -116,16 +116,16 @@ }, { "name": "cweagans/composer-patches", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/cweagans/composer-patches.git", - "reference": "7cd5c6eb7e68b8f7436ce1a7b9fffa4418bf59c6" + "reference": "b3036f23b73570ab5d869e345277786c8eb248a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/7cd5c6eb7e68b8f7436ce1a7b9fffa4418bf59c6", - "reference": "7cd5c6eb7e68b8f7436ce1a7b9fffa4418bf59c6", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/b3036f23b73570ab5d869e345277786c8eb248a9", + "reference": "b3036f23b73570ab5d869e345277786c8eb248a9", "shasum": "" }, "require": { @@ -156,7 +156,7 @@ } ], "description": "Provides a way to patch Composer packages.", - "time": "2016-12-01T01:19:32+00:00" + "time": "2017-03-19T18:18:52+00:00" }, { "name": "doctrine/cache", @@ -482,12 +482,12 @@ "version": "1.0.4", "source": { "type": "git", - "url": "https://github.com/padraic/file_get_contents.git", + "url": "https://github.com/humbug/file_get_contents.git", "reference": "66797199019d0cb4529cb8d29c6f0b4c5085b53a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/file_get_contents/zipball/66797199019d0cb4529cb8d29c6f0b4c5085b53a", + "url": "https://api.github.com/repos/humbug/file_get_contents/zipball/66797199019d0cb4529cb8d29c6f0b4c5085b53a", "reference": "66797199019d0cb4529cb8d29c6f0b4c5085b53a", "shasum": "" }, @@ -539,12 +539,12 @@ "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/padraic/phar-updater.git", + "url": "https://github.com/humbug/phar-updater.git", "reference": "c17eeb3887dc4269d1b4837dc875d39e9f8149a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/phar-updater/zipball/c17eeb3887dc4269d1b4837dc875d39e9f8149a8", + "url": "https://api.github.com/repos/humbug/phar-updater/zipball/c17eeb3887dc4269d1b4837dc875d39e9f8149a8", "reference": "c17eeb3887dc4269d1b4837dc875d39e9f8149a8", "shasum": "" }, @@ -588,16 +588,16 @@ }, { "name": "platformsh/client", - "version": "v0.9.0", + "version": "v0.10.0", "source": { "type": "git", "url": "https://github.com/platformsh/platformsh-client-php.git", - "reference": "329af288b4363c4ff44110b62eb0a2b048255335" + "reference": "c56d8251e3c5eff1dae45aad6f00afd90395931e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/platformsh/platformsh-client-php/zipball/329af288b4363c4ff44110b62eb0a2b048255335", - "reference": "329af288b4363c4ff44110b62eb0a2b048255335", + "url": "https://api.github.com/repos/platformsh/platformsh-client-php/zipball/c56d8251e3c5eff1dae45aad6f00afd90395931e", + "reference": "c56d8251e3c5eff1dae45aad6f00afd90395931e", "shasum": "" }, "require": { @@ -633,7 +633,7 @@ } ], "description": "Platform.sh API client", - "time": "2017-02-21T14:42:11+00:00" + "time": "2017-04-01T18:12:24+00:00" }, { "name": "platformsh/console-form", @@ -722,21 +722,24 @@ }, { "name": "react/promise", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "2760f3898b7e931aa71153852dcd48a75c9b95db" + "reference": "62785ae604c8d69725d693eb370e1d67e94c4053" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/2760f3898b7e931aa71153852dcd48a75c9b95db", - "reference": "2760f3898b7e931aa71153852dcd48a75c9b95db", + "url": "https://api.github.com/repos/reactphp/promise/zipball/62785ae604c8d69725d693eb370e1d67e94c4053", + "reference": "62785ae604c8d69725d693eb370e1d67e94c4053", "shasum": "" }, "require": { "php": ">=5.4.0" }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, "type": "library", "autoload": { "psr-4": { @@ -761,7 +764,7 @@ "promise", "promises" ], - "time": "2016-12-22T14:09:01+00:00" + "time": "2017-03-25T12:08:31+00:00" }, { "name": "stecman/symfony-console-completion", @@ -810,16 +813,16 @@ }, { "name": "symfony/config", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "741d6d4cd1414d67d48eb71aba6072b46ba740c2" + "reference": "8444bde28e3c2a33e571e6f180c2d78bfdc4480d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/741d6d4cd1414d67d48eb71aba6072b46ba740c2", - "reference": "741d6d4cd1414d67d48eb71aba6072b46ba740c2", + "url": "https://api.github.com/repos/symfony/config/zipball/8444bde28e3c2a33e571e6f180c2d78bfdc4480d", + "reference": "8444bde28e3c2a33e571e6f180c2d78bfdc4480d", "shasum": "" }, "require": { @@ -862,20 +865,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-03-01T18:18:25+00:00" + "time": "2017-04-04T15:30:56+00:00" }, { "name": "symfony/console", - "version": "v3.2.4", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0e5e6899f82230fcb1153bcaf0e106ffaa44b870" + "reference": "c30243cc51f726812be3551316b109a2f5deaf8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0e5e6899f82230fcb1153bcaf0e106ffaa44b870", - "reference": "0e5e6899f82230fcb1153bcaf0e106ffaa44b870", + "url": "https://api.github.com/repos/symfony/console/zipball/c30243cc51f726812be3551316b109a2f5deaf8d", + "reference": "c30243cc51f726812be3551316b109a2f5deaf8d", "shasum": "" }, "require": { @@ -925,20 +928,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-02-16T14:07:22+00:00" + "time": "2017-04-04T14:33:42+00:00" }, { "name": "symfony/debug", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "b90c9f91ad8ac37d9f114e369042d3226b34dc1a" + "reference": "56f613406446a4a0a031475cfd0a01751de22659" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/b90c9f91ad8ac37d9f114e369042d3226b34dc1a", - "reference": "b90c9f91ad8ac37d9f114e369042d3226b34dc1a", + "url": "https://api.github.com/repos/symfony/debug/zipball/56f613406446a4a0a031475cfd0a01751de22659", + "reference": "56f613406446a4a0a031475cfd0a01751de22659", "shasum": "" }, "require": { @@ -982,20 +985,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-02-18T17:28:00+00:00" + "time": "2017-03-28T21:38:24+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "74e0935e414ad33d5e82074212c0eedb4681a691" + "reference": "923bb014708b666e4092c9ba39993895c9c8fcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/74e0935e414ad33d5e82074212c0eedb4681a691", - "reference": "74e0935e414ad33d5e82074212c0eedb4681a691", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/923bb014708b666e4092c9ba39993895c9c8fcd7", + "reference": "923bb014708b666e4092c9ba39993895c9c8fcd7", "shasum": "" }, "require": { @@ -1045,20 +1048,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-03-05T00:06:55+00:00" + "time": "2017-04-04T07:26:27+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d" + "reference": "154bb1ef7b0e42ccc792bd53edbce18ed73440ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d", - "reference": "b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/154bb1ef7b0e42ccc792bd53edbce18ed73440ca", + "reference": "154bb1ef7b0e42ccc792bd53edbce18ed73440ca", "shasum": "" }, "require": { @@ -1105,20 +1108,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-02-21T09:12:04+00:00" + "time": "2017-04-04T07:26:27+00:00" }, { "name": "symfony/filesystem", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "bc0f17bed914df2cceb989972c3b996043c4da4a" + "reference": "64421e6479c4a8e60d790fb666bd520992861b66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/bc0f17bed914df2cceb989972c3b996043c4da4a", - "reference": "bc0f17bed914df2cceb989972c3b996043c4da4a", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/64421e6479c4a8e60d790fb666bd520992861b66", + "reference": "64421e6479c4a8e60d790fb666bd520992861b66", "shasum": "" }, "require": { @@ -1154,20 +1157,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-03-06T19:30:27+00:00" + "time": "2017-03-26T15:47:15+00:00" }, { "name": "symfony/finder", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "92d7476d2df60cd851a3e13e078664b1deb8ce10" + "reference": "b20900ce5ea164cd9314af52725b0bb5a758217a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/92d7476d2df60cd851a3e13e078664b1deb8ce10", - "reference": "92d7476d2df60cd851a3e13e078664b1deb8ce10", + "url": "https://api.github.com/repos/symfony/finder/zipball/b20900ce5ea164cd9314af52725b0bb5a758217a", + "reference": "b20900ce5ea164cd9314af52725b0bb5a758217a", "shasum": "" }, "require": { @@ -1203,7 +1206,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-02-21T09:12:04+00:00" + "time": "2017-03-20T09:32:19+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1266,16 +1269,16 @@ }, { "name": "symfony/process", - "version": "v3.2.4", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856" + "reference": "57fdaa55827ae14d617550ebe71a820f0a5e2282" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856", - "reference": "0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856", + "url": "https://api.github.com/repos/symfony/process/zipball/57fdaa55827ae14d617550ebe71a820f0a5e2282", + "reference": "57fdaa55827ae14d617550ebe71a820f0a5e2282", "shasum": "" }, "require": { @@ -1311,20 +1314,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-02-16T14:07:22+00:00" + "time": "2017-03-27T18:07:02+00:00" }, { "name": "symfony/yaml", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" + "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", - "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "url": "https://api.github.com/repos/symfony/yaml/zipball/62b4cdb99d52cb1ff253c465eb1532a80cebb621", + "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621", "shasum": "" }, "require": { @@ -1366,7 +1369,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-03-07T16:47:02+00:00" + "time": "2017-03-20T09:45:15+00:00" } ], "packages-dev": [ @@ -2780,16 +2783,16 @@ }, { "name": "sensiolabs/security-checker", - "version": "v3.0.5", + "version": "v3.0.7", "source": { "type": "git", "url": "https://github.com/sensiolabs/security-checker.git", - "reference": "462f4d089e641deef4759ac1117387c9bfd62764" + "reference": "59a6a299e2f5612dc8692d40e84373703a5df1b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/462f4d089e641deef4759ac1117387c9bfd62764", - "reference": "462f4d089e641deef4759ac1117387c9bfd62764", + "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/59a6a299e2f5612dc8692d40e84373703a5df1b5", + "reference": "59a6a299e2f5612dc8692d40e84373703a5df1b5", "shasum": "" }, "require": { @@ -2820,7 +2823,7 @@ } ], "description": "A security checker for your composer.lock", - "time": "2017-03-09T17:41:10+00:00" + "time": "2017-03-29T09:29:53+00:00" }, { "name": "symfony/var-dumper", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/config.yaml new/platformsh-cli-3.15.1/config.yaml --- old/platformsh-cli-3.14.5/config.yaml 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/config.yaml 2017-04-26 16:54:54.000000000 +0200 @@ -1,7 +1,7 @@ # Metadata about the CLI application itself. application: name: 'Platform.sh CLI' - version: '3.14.5' + version: '3.15.1' executable: 'platform' phar: 'platform.phar' package_name: 'platformsh/cli' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Application.php new/platformsh-cli-3.15.1/src/Application.php --- old/platformsh-cli-3.14.5/src/Application.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Application.php 2017-04-26 16:54:54.000000000 +0200 @@ -95,6 +95,10 @@ $commands[] = new Command\Auth\AuthInfoCommand(); $commands[] = new Command\Auth\LogoutCommand(); $commands[] = new Command\Auth\LoginCommand(); + $commands[] = new Command\Certificate\CertificateAddCommand(); + $commands[] = new Command\Certificate\CertificateDeleteCommand(); + $commands[] = new Command\Certificate\CertificateGetCommand(); + $commands[] = new Command\Certificate\CertificateListCommand(); $commands[] = new Command\Db\DbSqlCommand(); $commands[] = new Command\Db\DbDumpCommand(); $commands[] = new Command\Db\DbSizeCommand(); @@ -235,15 +239,15 @@ } /** - * Set the default timezone. + * Set the default PHP timezone according to the system timezone. * - * PHP 5.4 has removed the autodetection of the system timezone, - * so it needs to be done manually. - * UTC is the fallback in case autodetection fails. + * PHP >=5.4 removed the autodetection of the system timezone, so it is + * re-implemented here. */ protected function setDefaultTimezone() { - $timezone = 'UTC'; + $timezone = date_default_timezone_get(); + if (is_link('/etc/localtime')) { // Mac OS X (and older Linuxes) // /etc/localtime is a symlink to the timezone in /usr/share/zoneinfo. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Activity/ActivityListCommand.php new/platformsh-cli-3.15.1/src/Command/Activity/ActivityListCommand.php --- old/platformsh-cli-3.14.5/src/Command/Activity/ActivityListCommand.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Command/Activity/ActivityListCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -73,7 +73,7 @@ $activity->getDescription(), $activity->getCompletionPercent() . '%', ActivityMonitor::formatState($activity->state), - ActivityMonitor::formatResult($activity->result), + ActivityMonitor::formatResult($activity->result, !$table->formatIsMachineReadable()), ]; if (!$environmentSpecific) { $row[] = implode(', ', $activity->environments); @@ -89,14 +89,34 @@ if (!$table->formatIsMachineReadable()) { if ($environmentSpecific && isset($environment)) { - $this->stdErr->writeln("Activities for the environment <info>" . $environment->id . "</info>"); + $this->stdErr->writeln( + sprintf( + 'Activities for the environment <info>%s</info>:', + $environment->id + ) + ); } elseif (!$environmentSpecific) { - $this->stdErr->writeln("Activities for the project <info>" . $project->id . "</info>"); + $this->stdErr->writeln( + sprintf( + 'Activities for the project <info>%s</info>:', + $project->id + ) + ); } } $table->render($rows, $headers); + if (!$table->formatIsMachineReadable()) { + $this->stdErr->writeln(''); + $this->stdErr->writeln( + sprintf( + 'To view the log for an activity, run: <info>%s activity:log [id]</info>', + $this->config()->get('application.executable') + ) + ); + } + return 0; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Activity/ActivityLogCommand.php new/platformsh-cli-3.15.1/src/Command/Activity/ActivityLogCommand.php --- old/platformsh-cli-3.14.5/src/Command/Activity/ActivityLogCommand.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Command/Activity/ActivityLogCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -69,7 +69,7 @@ ); $refresh = $input->getOption('refresh'); - if ($refresh > 0 && !$this->runningViaMulti && $this->isTerminal($output) && !$activity->isComplete()) { + if ($refresh > 0 && !$this->runningViaMulti && $output->isDecorated() && !$activity->isComplete()) { $activity->wait( null, function ($log) use ($output) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Certificate/CertificateAddCommand.php new/platformsh-cli-3.15.1/src/Command/Certificate/CertificateAddCommand.php --- old/platformsh-cli-3.14.5/src/Command/Certificate/CertificateAddCommand.php 1970-01-01 01:00:00.000000000 +0100 +++ new/platformsh-cli-3.15.1/src/Command/Certificate/CertificateAddCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -0,0 +1,50 @@ +<?php +namespace Platformsh\Cli\Command\Certificate; + +use Platformsh\Cli\Command\CommandBase; +use Platformsh\Cli\Util\SslUtil; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class CertificateAddCommand extends CommandBase +{ + + protected function configure() + { + $this + ->setName('certificate:add') + ->setDescription('Add an SSL certificate to the project') + ->addOption('cert', null, InputOption::VALUE_REQUIRED, 'The path to the certificate file') + ->addOption('key', null, InputOption::VALUE_REQUIRED, 'The path to the certificate private key file') + ->addOption('chain', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'The path to the certificate chain file'); + $this->addProjectOption(); + $this->addNoWaitOption(); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->validateInput($input); + $project = $this->getSelectedProject(); + + $certPath = $input->getOption('cert'); + $keyPath = $input->getOption('key'); + $chainPaths = $input->getOption('chain'); + if (!isset($certPath, $keyPath)) { + $this->stdErr->writeln('The --cert and --key options are required'); + return 1; + } + + list($certificate, $key, $chain) = (new SslUtil())->validate($certPath, $keyPath, $chainPaths); + + $result = $project->addCertificate($certificate, $key, $chain); + + if (!$input->getOption('no-wait')) { + /** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */ + $activityMonitor = $this->getService('activity_monitor'); + $activityMonitor->waitMultiple($result->getActivities(), $project); + } + + return 0; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Certificate/CertificateDeleteCommand.php new/platformsh-cli-3.15.1/src/Command/Certificate/CertificateDeleteCommand.php --- old/platformsh-cli-3.14.5/src/Command/Certificate/CertificateDeleteCommand.php 1970-01-01 01:00:00.000000000 +0100 +++ new/platformsh-cli-3.15.1/src/Command/Certificate/CertificateDeleteCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -0,0 +1,57 @@ +<?php +namespace Platformsh\Cli\Command\Certificate; + +use Platformsh\Cli\Command\CommandBase; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class CertificateDeleteCommand extends CommandBase +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('certificate:delete') + ->setDescription('Delete a certificate from the project') + ->addArgument('id', InputArgument::REQUIRED, 'The full certificate ID'); + $this->addProjectOption(); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->validateInput($input); + + $id = $input->getArgument('id'); + $project = $this->getSelectedProject(); + + $certificate = $project->getCertificate($id); + if (!$certificate) { + $this->stdErr->writeln(sprintf('Certificate not found: <error>%s</error>', $id)); + return 1; + } + + /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */ + $questionHelper = $this->getService('question_helper'); + if (!$questionHelper->confirm(sprintf('Are you sure you want to delete the certificate <info>%s</info>?', $certificate->id))) { + return 1; + } + + $result = $certificate->delete(); + + $this->stdErr->writeln(sprintf('The certificate <info>%s</info> has been deleted.', $certificate->id)); + + if (!$input->getOption('no-wait')) { + /** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */ + $activityMonitor = $this->getService('activity_monitor'); + $activityMonitor->waitMultiple($result->getActivities(), $project); + } + + return 0; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Certificate/CertificateGetCommand.php new/platformsh-cli-3.15.1/src/Command/Certificate/CertificateGetCommand.php --- old/platformsh-cli-3.14.5/src/Command/Certificate/CertificateGetCommand.php 1970-01-01 01:00:00.000000000 +0100 +++ new/platformsh-cli-3.15.1/src/Command/Certificate/CertificateGetCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -0,0 +1,67 @@ +<?php +namespace Platformsh\Cli\Command\Certificate; + +use Platformsh\Cli\Command\CommandBase; +use Platformsh\Cli\Service\PropertyFormatter; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class CertificateGetCommand extends CommandBase +{ + + protected function configure() + { + $this + ->setName('certificate:get') + ->setDescription('View a certificate') + ->addArgument('id', InputArgument::REQUIRED, 'The certificate ID (or the start of it)') + ->addOption('property', 'P', InputOption::VALUE_REQUIRED, 'The certificate property to view'); + PropertyFormatter::configureInput($this->getDefinition()); + $this->addProjectOption(); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->validateInput($input); + $project = $this->getSelectedProject(); + + $id = $input->getArgument('id'); + $cert = $project->getCertificate($id); + if (!$cert) { + $cert = $this->matchCertificateId($id, $project->getCertificates()); + if (!$cert) { + $this->stdErr->writeln(sprintf('Certificate not found: %s', $id)); + + return 1; + } + } + + /** @var PropertyFormatter $propertyFormatter */ + $propertyFormatter = $this->getService('property_formatter'); + + $propertyFormatter->displayData($output, $cert->getProperties(), $input->getOption('property')); + + return 0; + } + + /** + * @param string $id + * @param \Platformsh\Client\Model\Certificate[] $certs + * + * @return \Platformsh\Client\Model\Certificate|null + */ + protected function matchCertificateId($id, array $certs) + { + if (strlen($id) > 5) { + foreach ($certs as $candidate) { + if (strpos($candidate->id, $id) === 0) { + return $candidate; + } + } + } + + return null; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Certificate/CertificateListCommand.php new/platformsh-cli-3.15.1/src/Command/Certificate/CertificateListCommand.php --- old/platformsh-cli-3.14.5/src/Command/Certificate/CertificateListCommand.php 1970-01-01 01:00:00.000000000 +0100 +++ new/platformsh-cli-3.15.1/src/Command/Certificate/CertificateListCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -0,0 +1,131 @@ +<?php +namespace Platformsh\Cli\Command\Certificate; + +use Platformsh\Cli\Command\CommandBase; +use Platformsh\Cli\Service\PropertyFormatter; +use Platformsh\Cli\Service\Table; +use Platformsh\Client\Model\Certificate; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class CertificateListCommand extends CommandBase +{ + + protected function configure() + { + $this + ->setName('certificate:list') + ->setAliases(['certificates']) + ->setDescription('List project certificates'); + $this->addOption('domain', null, InputOption::VALUE_REQUIRED, 'Filter by domain name (case-insensitive search)'); + $this->addOption('issuer', null, InputOption::VALUE_REQUIRED, 'Filter by issuer'); + $this->addOption('only-auto', null, InputOption::VALUE_NONE, 'Show only auto-provisioned certificates'); + $this->addOption('no-auto', null, InputOption::VALUE_NONE, 'Show only manually added certificates'); + PropertyFormatter::configureInput($this->getDefinition()); + Table::configureInput($this->getDefinition()); + $this->addProjectOption(); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->validateInput($input); + + $filterOptions = ['domain', 'issuer', 'only-auto', 'no-auto']; + $filters = array_filter(array_intersect_key($input->getOptions(), array_flip($filterOptions))); + + $project = $this->getSelectedProject(); + + $certs = $project->getCertificates(); + + $this->filterCerts($certs, $filters); + + if (!empty($filters)) { + $filtersUsed = '<comment>--' + . implode('</comment>, <comment>--', array_keys($filters)) + . '</comment>'; + $this->stdErr->writeln(sprintf('Filters in use: %s', $filtersUsed)); + } + + if (empty($certs)) { + $this->stdErr->writeln("No certificates found"); + + return 0; + } + + /** @var \Platformsh\Cli\Service\Table $table */ + $table = $this->getService('table'); + /** @var \Platformsh\Cli\Service\PropertyFormatter $propertyFormatter */ + $propertyFormatter = $this->getService('property_formatter'); + + $header = ['ID', 'Domain(s)', 'Created', 'Expires']; + $rows = []; + foreach ($certs as $cert) { + $rows[] = [ + $cert->id, + implode("\n", $cert->domains), + $propertyFormatter->format($cert->created_at, 'created_at'), + $propertyFormatter->format($cert->expires_at, 'expires_at'), + ]; + } + + if (!$table->formatIsMachineReadable()) { + $this->stdErr->writeln(sprintf('Certificates for the project <info>%s</info>:', $this->api()->getProjectLabel($project))); + } + + $table->render($rows, $header); + + if (!$table->formatIsMachineReadable()) { + $this->stdErr->writeln(''); + $this->stdErr->writeln(sprintf( + 'To view a single certificate, run: <info>%s certificate:get <id></info>', + $this->config()->get('application.executable') + )); + } + + return 0; + } + + protected function filterCerts(array &$certs, array $filters) + { + foreach ($filters as $filter => $value) { + switch ($filter) { + case 'domain': + $certs = array_filter($certs, function (Certificate $cert) use ($value) { + foreach ($cert->domains as $domain) { + if (stripos($domain, $value) !== false) { + return true; + } + } + + return false; + }); + break; + + case 'issuer': + $certs = array_filter($certs, function (Certificate $cert) use ($value) { + foreach ($cert->issuer as $issuer) { + if (isset($issuer['value']) && $issuer['value'] === $value) { + return true; + } + } + + return false; + }); + break; + + case 'only-auto': + $certs = array_filter($certs, function (Certificate $cert) { + return (bool) $cert->is_provisioned; + }); + break; + + case 'no-auto': + $certs = array_filter($certs, function (Certificate $cert) { + return !$cert->is_provisioned; + }); + break; + } + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/CommandBase.php new/platformsh-cli-3.15.1/src/Command/CommandBase.php --- old/platformsh-cli-3.14.5/src/Command/CommandBase.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Command/CommandBase.php 2017-04-26 16:54:54.000000000 +0200 @@ -526,31 +526,6 @@ } /** - * Detect automatically whether the output is a TTY terminal. - * - * @param OutputInterface $output - * - * @return bool - */ - protected function isTerminal(OutputInterface $output) - { - if (!$output instanceof StreamOutput) { - return false; - } - // If the POSIX extension doesn't exist, default to true. It's better - // for Windows users if we assume the output is a terminal. - if (!function_exists('posix_isatty')) { - return true; - } - // This uses the same test as StreamOutput::hasColorSupport(). - $stream = $output->getStream(); - - /** @noinspection PhpParamsInspection */ - - return @posix_isatty($stream); - } - - /** * Add the --project and --host options. * * @return CommandBase diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Db/DbSqlCommand.php new/platformsh-cli-3.15.1/src/Command/Db/DbSqlCommand.php --- old/platformsh-cli-3.14.5/src/Command/Db/DbSqlCommand.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Command/Db/DbSqlCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -58,16 +58,13 @@ $query = $input->getArgument('query'); if ($query) { - $sqlCommand .= $queryOption . escapeshellarg($query) . ' 2>&1'; + $sqlCommand .= $queryOption . escapeshellarg($query); } /** @var \Platformsh\Cli\Service\Ssh $ssh */ $ssh = $this->getService('ssh'); $sshCommand = $ssh->getSshCommand(); - if ($this->isTerminal($output)) { - $sshCommand .= ' -t'; - } $sshCommand .= ' ' . escapeshellarg($sshUrl) . ' ' . escapeshellarg($sqlCommand); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Domain/DomainCommandBase.php new/platformsh-cli-3.15.1/src/Command/Domain/DomainCommandBase.php --- old/platformsh-cli-3.14.5/src/Command/Domain/DomainCommandBase.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Command/Domain/DomainCommandBase.php 2017-04-26 16:54:54.000000000 +0200 @@ -3,6 +3,7 @@ use GuzzleHttp\Exception\ClientException; use Platformsh\Cli\Command\CommandBase; +use Platformsh\Cli\Util\SslUtil; use Platformsh\Client\Model\Project; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -16,10 +17,6 @@ protected $domainName; - protected $certPath; - protected $keyPath; - protected $chainPaths; - /** * @param InputInterface $input * @@ -34,15 +31,22 @@ return false; } - $this->certPath = $input->getOption('cert'); - $this->keyPath = $input->getOption('key'); - $this->chainPaths = $input->getOption('chain'); - if ($this->certPath || $this->keyPath || $this->chainPaths) { - if (!isset($this->certPath, $this->keyPath)) { + $certPath = $input->getOption('cert'); + $keyPath = $input->getOption('key'); + $chainPaths = $input->getOption('chain'); + if ($certPath || $keyPath || $chainPaths) { + if (!isset($certPath, $keyPath)) { $this->stdErr->writeln("Both the --cert and the --key are required for SSL certificates"); return false; } - return $this->validateSslOptions(); + try { + $this->sslOptions = (new SslUtil())->validate($certPath, $keyPath, $chainPaths); + } catch (\InvalidArgumentException $e) { + $this->stdErr->writeln($e->getMessage()); + return false; + } + + return true; } return true; @@ -57,74 +61,6 @@ } /** - * @return bool - */ - protected function validateSslOptions() - { - // Get the contents. - if (!is_readable($this->certPath)) { - $this->stdErr->writeln("The certificate file could not be read: " . $this->certPath); - return false; - } - $sslCert = trim(file_get_contents($this->certPath)); - // Do a bit of validation. - $certResource = openssl_x509_read($sslCert); - if (!$certResource) { - $this->stdErr->writeln("The certificate file is not a valid X509 certificate: " . $this->certPath); - return false; - } - // Then the key. Does it match? - if (!is_readable($this->keyPath)) { - $this->stdErr->writeln("The private key file could not be read: " . $this->keyPath); - return false; - } - $sslPrivateKey = trim(file_get_contents($this->keyPath)); - $keyResource = openssl_pkey_get_private($sslPrivateKey); - if (!$keyResource) { - $this->stdErr->writeln("Private key not valid, or passphrase-protected: " . $this->keyPath); - return false; - } - $keyMatch = openssl_x509_check_private_key($certResource, $keyResource); - if (!$keyMatch) { - $this->stdErr->writeln("The provided certificate does not match the provided private key."); - return false; - } - - // Each chain needs to contain one or more valid certificates. - $chainFileContents = $this->readChainFiles($this->chainPaths); - foreach ($chainFileContents as $filePath => $data) { - $chainResource = openssl_x509_read($data); - if (!$chainResource) { - $this->stdErr->writeln("File contains an invalid X509 certificate: " . $filePath); - return false; - } - openssl_x509_free($chainResource); - } - - // Split up the chain file contents. - $chain = []; - $begin = '-----BEGIN CERTIFICATE-----'; - foreach ($chainFileContents as $data) { - if (substr_count($data, $begin) > 1) { - foreach (explode($begin, $data) as $cert) { - $chain[] = $begin . $cert; - } - } else { - $chain[] = $data; - } - } - - // Yay we win. - $this->sslOptions = [ - 'certificate' => $sslCert, - 'key' => $sslPrivateKey, - 'chain' => $chain, - ]; - - return true; - } - - /** * Validate a domain. * * @param string $domain @@ -138,29 +74,6 @@ } /** - * Get the contents of multiple chain files. - * - * @param string[] $chainPaths - * - * @throws \Exception If any one of the files is not readable. - * - * @return array - * An array of file contents (whitespace trimmed) keyed by file name. - */ - protected function readChainFiles(array $chainPaths) - { - $chainFiles = []; - foreach ($chainPaths as $chainPath) { - if (!is_readable($chainPath)) { - throw new \Exception("The chain file could not be read: $chainPath"); - } - $chainFiles[$chainPath] = trim(file_get_contents($chainPath)); - } - - return $chainFiles; - } - - /** * Output a clear explanation for domains API errors. * * @param ClientException $e diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Environment/EnvironmentDrushCommand.php new/platformsh-cli-3.15.1/src/Command/Environment/EnvironmentDrushCommand.php --- old/platformsh-cli-3.14.5/src/Command/Environment/EnvironmentDrushCommand.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Command/Environment/EnvironmentDrushCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -95,7 +95,7 @@ if ($environmentUrl = $selectedEnvironment->getLink('public-url')) { $sshDrushCommand .= " --uri=" . escapeshellarg($environmentUrl); } - $sshDrushCommand .= ' ' . $drushCommand . ' 2>&1'; + $sshDrushCommand .= ' ' . $drushCommand; /** @var \Platformsh\Cli\Service\Ssh $ssh */ $ssh = $this->getService('ssh'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Environment/EnvironmentSshCommand.php new/platformsh-cli-3.15.1/src/Command/Environment/EnvironmentSshCommand.php --- old/platformsh-cli-3.14.5/src/Command/Environment/EnvironmentSshCommand.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Command/Environment/EnvironmentSshCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -20,7 +20,7 @@ ->setName('environment:ssh') ->setAliases(['ssh']) ->addArgument('cmd', InputArgument::OPTIONAL, 'A command to run on the environment.') - ->addOption('pipe', null, InputOption::VALUE_NONE, "Output the SSH URL only.") + ->addOption('pipe', null, InputOption::VALUE_NONE, 'Output the SSH URL only.') ->setDescription('SSH to the current environment'); $this->addProjectOption() ->addEnvironmentOption() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Command/Snapshot/SnapshotListCommand.php new/platformsh-cli-3.15.1/src/Command/Snapshot/SnapshotListCommand.php --- old/platformsh-cli-3.14.5/src/Command/Snapshot/SnapshotListCommand.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Command/Snapshot/SnapshotListCommand.php 2017-04-26 16:54:54.000000000 +0200 @@ -61,7 +61,7 @@ new AdaptiveTableCell($snapshot_name, ['wrap' => false]), $activity->getCompletionPercent() . '%', ActivityMonitor::formatState($activity->state), - ActivityMonitor::formatResult($activity->result), + ActivityMonitor::formatResult($activity->result, !$table->formatIsMachineReadable()), ]; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Service/ActivityMonitor.php new/platformsh-cli-3.15.1/src/Service/ActivityMonitor.php --- old/platformsh-cli-3.14.5/src/Service/ActivityMonitor.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Service/ActivityMonitor.php 2017-04-26 16:54:54.000000000 +0200 @@ -243,14 +243,17 @@ * Format a result. * * @param string $result + * @param bool $decorate * * @return string */ - public static function formatResult($result) + public static function formatResult($result, $decorate = true) { $name = isset(self::$stateNames[$result]) ? self::$stateNames[$result] : $result; - return $result === Activity::RESULT_FAILURE ? '<error>' . $name . '</error>' : $name; + return $decorate && $result === Activity::RESULT_FAILURE + ? '<error>' . $name . '</error>' + : $name; } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Service/PropertyFormatter.php new/platformsh-cli-3.15.1/src/Service/PropertyFormatter.php --- old/platformsh-cli-3.14.5/src/Service/PropertyFormatter.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Service/PropertyFormatter.php 2017-04-26 16:54:54.000000000 +0200 @@ -38,6 +38,7 @@ case 'created_at': case 'updated_at': + case 'expires_at': case 'ssl.expires_on': return $this->formatDate($value); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Service/Ssh.php new/platformsh-cli-3.15.1/src/Service/Ssh.php --- old/platformsh-cli-3.14.5/src/Service/Ssh.php 2017-04-17 17:47:07.000000000 +0200 +++ new/platformsh-cli-3.15.1/src/Service/Ssh.php 2017-04-26 16:54:54.000000000 +0200 @@ -74,6 +74,10 @@ $options[] = 'IdentityFile ' . $file; } + if ($this->output->isDecorated()) { + $options[] = 'RequestTty yes'; + } + return $options; } @@ -89,7 +93,7 @@ $command = 'ssh'; $args = $this->getSshArgs($extraOptions); if (!empty($args)) { - $command .= " '" . implode("' '", $args) . "'"; + $command .= ' ' . implode(' ', array_map('escapeshellarg', $args)); } return $command; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.14.5/src/Util/SslUtil.php new/platformsh-cli-3.15.1/src/Util/SslUtil.php --- old/platformsh-cli-3.14.5/src/Util/SslUtil.php 1970-01-01 01:00:00.000000000 +0100 +++ new/platformsh-cli-3.15.1/src/Util/SslUtil.php 2017-04-26 16:54:54.000000000 +0200 @@ -0,0 +1,94 @@ +<?php + +namespace Platformsh\Cli\Util; + +class SslUtil +{ + /** + * @param string $certPath + * @param string $keyPath + * @param array $chainPaths + * + * @return array + * An array containing the contents of the certificate files, keyed as + * 'certificate' (string), 'key' (string), and 'chain' (array). + */ + public function validate($certPath, $keyPath, array $chainPaths) + { + // Get the contents. + if (!is_readable($certPath)) { + throw new \InvalidArgumentException('The certificate file could not be read: ' . $certPath); + } + $sslCert = trim(file_get_contents($certPath)); + // Do a bit of validation. + $certResource = openssl_x509_read($sslCert); + if (!$certResource) { + throw new \InvalidArgumentException('The certificate file is not a valid X509 certificate: ' . $certPath); + } + // Then the key. Does it match? + if (!is_readable($keyPath)) { + throw new \InvalidArgumentException('The private key file could not be read: ' . $keyPath); + } + $sslPrivateKey = trim(file_get_contents($keyPath)); + $keyResource = openssl_pkey_get_private($sslPrivateKey); + if (!$keyResource) { + throw new \InvalidArgumentException('Private key not valid, or passphrase-protected: ' . $keyPath); + } + $keyMatch = openssl_x509_check_private_key($certResource, $keyResource); + if (!$keyMatch) { + throw new \InvalidArgumentException('The provided certificate does not match the provided private key.'); + } + + // Each chain needs to contain one or more valid certificates. + $chainFileContents = $this->readChainFiles($chainPaths); + foreach ($chainFileContents as $filePath => $data) { + $chainResource = openssl_x509_read($data); + if (!$chainResource) { + throw new \InvalidArgumentException('File contains an invalid X509 certificate: ' . $filePath); + } + openssl_x509_free($chainResource); + } + + // Split up the chain file contents. + $chain = []; + $begin = '-----BEGIN CERTIFICATE-----'; + foreach ($chainFileContents as $data) { + if (substr_count($data, $begin) > 1) { + foreach (explode($begin, $data) as $cert) { + $chain[] = $begin . $cert; + } + } else { + $chain[] = $data; + } + } + + return [ + 'certificate' => $sslCert, + 'key' => $sslPrivateKey, + 'chain' => $chain, + ]; + } + + /** + * Get the contents of multiple chain files. + * + * @param string[] $chainPaths + * + * @throws \Exception If any one of the files is not readable. + * + * @return array + * An array of file contents (whitespace trimmed) keyed by file name. + */ + protected function readChainFiles(array $chainPaths) + { + $chainFiles = []; + foreach ($chainPaths as $chainPath) { + if (!is_readable($chainPath)) { + throw new \Exception("The chain file could not be read: $chainPath"); + } + $chainFiles[$chainPath] = trim(file_get_contents($chainPath)); + } + + return $chainFiles; + } +} ++++++ platformsh-cli-vendor.tar.xz ++++++ ++++ 3504 lines of diff (skipped)