Hello community,

here is the log from the commit of package platformsh-cli for openSUSE:Factory 
checked in at 2017-05-17 10:54:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/platformsh-cli (Old)
 and      /work/SRC/openSUSE:Factory/.platformsh-cli.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "platformsh-cli"

Wed May 17 10:54:24 2017 rev:11 rq:495129 version:3.16.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/platformsh-cli/platformsh-cli.changes    
2017-05-06 18:30:31.419842934 +0200
+++ /work/SRC/openSUSE:Factory/.platformsh-cli.new/platformsh-cli.changes       
2017-05-17 10:54:26.498089142 +0200
@@ -1,0 +2,37 @@
+Mon May 15 21:07:38 UTC 2017 - [email protected]
+
+- Update to version 3.16.1:
+  * When creating a symlink, ensure both ends are real paths, if possible
+  * Use improved makePathRelative elsewhere
+  * Unused import
+  * Use improved makePathRelative() in get command
+  * ... typo
+  * Release v3.16.1
+
+-------------------------------------------------------------------
+Thu May 11 10:24:24 UTC 2017 - [email protected]
+
+- Kill dot off summary. Fix other nonsense in description.
+
+-------------------------------------------------------------------
+Wed May 10 21:13:51 UTC 2017 - [email protected]
+
+- Update to version 3.16.0:
+  * Remove old updates.last_checked default
+  * Remove application.phar config value
+  * Update self::install so it doesn't write to .profile
+  * Fix filename if a directory is passed to the db:dump --file option
+  * Stop timestamp being appended twice if --file is a directory
+  * Add --directory option to db:dump
+  * Use native search in docs command
+  * Simplify DocsCommand
+  * Note config.yaml snippet shows defaults
+  * Update API client
+  * Use starts_at paging to load more than 10 activities
+  * Update API client for activity descriptions
+  * Add project:curl command
+  * Add auth:token command
+  * Add -sS to project:curl
+  * Release v3.16.0
+
+-------------------------------------------------------------------

Old:
----
  platformsh-cli-3.15.4.tar.xz

New:
----
  platformsh-cli-3.16.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ platformsh-cli.spec ++++++
--- /var/tmp/diff_new_pack.Az61dm/_old  2017-05-17 10:54:27.269980553 +0200
+++ /var/tmp/diff_new_pack.Az61dm/_new  2017-05-17 10:54:27.273979990 +0200
@@ -17,9 +17,9 @@
 
 
 Name:           platformsh-cli
-Version:        3.15.4
+Version:        3.16.1
 Release:        0
-Summary:        The unified tool for managing your Platform.sh services from 
the command line.
+Summary:        Tool for managing Platform.sh services from the command line
 # See licenses.txt for dependency licenses.
 License:        MIT
 Group:          Productivity/Networking/Web/Servers
@@ -38,7 +38,7 @@
 
 %description
 The Platform.sh CLI is the official command-line interface for Platform.sh.
-Use this tool to interact with your Platform.sh projects, and to build them
+Use this tool to interact with Platform.sh projects, and to build them
 locally for development purposes.
 
 %prep

++++++ _service ++++++
--- /var/tmp/diff_new_pack.Az61dm/_old  2017-05-17 10:54:27.325972676 +0200
+++ /var/tmp/diff_new_pack.Az61dm/_new  2017-05-17 10:54:27.329972113 +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.15.4</param>
+    <param name="revision">refs/tags/v3.16.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.Az61dm/_old  2017-05-17 10:54:27.365967050 +0200
+++ /var/tmp/diff_new_pack.Az61dm/_new  2017-05-17 10:54:27.369966488 +0200
@@ -1,6 +1,6 @@
 <servicedata>
   <service name="tar_scm">
     <param name="url">git://github.com/platformsh/platformsh-cli.git</param>
-    <param 
name="changesrevision">82a752a79a7e88fa36e74c4042e23904f37f8841</param>
+    <param 
name="changesrevision">388e33ded6b0f5c74411bf099c50247b5ed47772</param>
   </service>
 </servicedata>

++++++ licenses.txt ++++++
--- /var/tmp/diff_new_pack.Az61dm/_old  2017-05-17 10:54:27.429958048 +0200
+++ /var/tmp/diff_new_pack.Az61dm/_new  2017-05-17 10:54:27.429958048 +0200
@@ -15,7 +15,7 @@
 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.10.0  MIT           
+platformsh/client                   v0.10.2  MIT           
 platformsh/console-form             v0.0.8   MIT           
 psr/log                             1.0.2    MIT           
 react/promise                       v2.5.1   MIT           

++++++ platformsh-cli-3.15.4.tar.xz -> platformsh-cli-3.16.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.4/README.md 
new/platformsh-cli-3.16.1/README.md
--- old/platformsh-cli-3.15.4/README.md 2017-05-03 22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/README.md 2017-05-12 10:13:12.000000000 +0200
@@ -180,7 +180,8 @@
 
 ## Customization
 
-You can configure the CLI via the user configuration file 
`~/.platformsh/config.yaml`:
+You can configure the CLI via the user configuration file 
`~/.platformsh/config.yaml`.
+These are the possible keys, and their default values:
 
 ```yaml
 api:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.4/composer.lock 
new/platformsh-cli-3.16.1/composer.lock
--- old/platformsh-cli-3.15.4/composer.lock     2017-05-03 22:56:42.000000000 
+0200
+++ new/platformsh-cli-3.16.1/composer.lock     2017-05-12 10:13:12.000000000 
+0200
@@ -593,16 +593,16 @@
         },
         {
             "name": "platformsh/client",
-            "version": "v0.10.0",
+            "version": "v0.10.2",
             "source": {
                 "type": "git",
                 "url": 
"https://github.com/platformsh/platformsh-client-php.git";,
-                "reference": "c56d8251e3c5eff1dae45aad6f00afd90395931e"
+                "reference": "69e90df40fe201469473a467420557aa9bb6bcd0"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/platformsh/platformsh-client-php/zipball/c56d8251e3c5eff1dae45aad6f00afd90395931e";,
-                "reference": "c56d8251e3c5eff1dae45aad6f00afd90395931e",
+                "url": 
"https://api.github.com/repos/platformsh/platformsh-client-php/zipball/69e90df40fe201469473a467420557aa9bb6bcd0";,
+                "reference": "69e90df40fe201469473a467420557aa9bb6bcd0",
                 "shasum": ""
             },
             "require": {
@@ -638,7 +638,7 @@
                 }
             ],
             "description": "Platform.sh API client",
-            "time": "2017-04-01T18:12:24+00:00"
+            "time": "2017-05-10T12:14:35+00:00"
         },
         {
             "name": "platformsh/console-form",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.4/config.yaml 
new/platformsh-cli-3.16.1/config.yaml
--- old/platformsh-cli-3.15.4/config.yaml       2017-05-03 22:56:42.000000000 
+0200
+++ new/platformsh-cli-3.16.1/config.yaml       2017-05-12 10:13:12.000000000 
+0200
@@ -1,9 +1,8 @@
 # Metadata about the CLI application itself.
 application:
   name: 'Platform.sh CLI'
-  version: '3.15.4'
+  version: '3.16.1'
   executable: 'platform'
-  phar: 'platform.phar'
   package_name: 'platformsh/cli'
   installer_url: 'https://platform.sh/cli/installer'
   manifest_url: 'https://platform.sh/cli/manifest.json'
@@ -33,6 +32,7 @@
   app_config_file: '.platform.app.yaml'
   project_config_dir: '.platform'
   docs_url: 'https://docs.platform.sh'
+  docs_search_url: 'https://docs.platform.sh/?q={{ terms }}'
   accounts_url: 'https://accounts.platform.sh'
   available_regions:
     - eu.platform.sh
@@ -75,7 +75,6 @@
 # Automatic updates.
 # This can be overridden in the user config file.
 updates:
-  last_checked: ~
   check_interval: 86400
 
   # Overridden by {application.env_prefix}UPDATES_CHECK env var.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.4/dist/installer.php 
new/platformsh-cli-3.16.1/dist/installer.php
--- old/platformsh-cli-3.15.4/dist/installer.php        2017-05-03 
22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/dist/installer.php        2017-05-12 
10:13:12.000000000 +0200
@@ -381,23 +381,25 @@
  * @param string $home
  *   The user's home directory.
  *
+ * @see \Platformsh\Cli\Command\Self\SelfInstallCommand::findShellConfigFile()
+ *
  * @return string|false
  *   The absolute path to an existing shell config file, or false on failure.
  */
 function findShellConfigFile($home)
 {
     $candidates = array(
-        $home . '/.bash_profile',
-        $home . '/.bashrc',
+        '.bash_profile',
+        '.bashrc',
     );
     $shell = str_replace('/bin/', '', getenv('SHELL'));
     if ($shell === 'zsh') {
-        array_unshift($candidates, $home . '/.zshrc');
-        array_unshift($candidates, $home . '/.zprofile');
+        array_unshift($candidates, '.zshrc');
+        array_unshift($candidates, '.zprofile');
     }
     foreach ($candidates as $candidate) {
-        if (file_exists($candidate)) {
-            return $candidate;
+        if (file_exists($home . DIRECTORY_SEPARATOR . $candidate)) {
+            return $home . DIRECTORY_SEPARATOR . $candidate;
         }
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.4/src/Application.php 
new/platformsh-cli-3.16.1/src/Application.php
--- old/platformsh-cli-3.15.4/src/Application.php       2017-05-03 
22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Application.php       2017-05-12 
10:13:12.000000000 +0200
@@ -93,6 +93,7 @@
         $commands[] = new Command\App\AppConfigGetCommand();
         $commands[] = new Command\App\AppListCommand();
         $commands[] = new Command\Auth\AuthInfoCommand();
+        $commands[] = new Command\Auth\AuthTokenCommand();
         $commands[] = new Command\Auth\LogoutCommand();
         $commands[] = new Command\Auth\LoginCommand();
         $commands[] = new Command\Certificate\CertificateAddCommand();
@@ -132,6 +133,7 @@
         $commands[] = new Command\Local\LocalCleanCommand();
         $commands[] = new Command\Local\LocalDrushAliasesCommand();
         $commands[] = new Command\Local\LocalDirCommand();
+        $commands[] = new Command\Project\ProjectCurlCommand();
         $commands[] = new Command\Project\ProjectCreateCommand();
         $commands[] = new Command\Project\ProjectDeleteCommand();
         $commands[] = new Command\Project\ProjectGetCommand();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.4/src/Command/Activity/ActivityListCommand.php 
new/platformsh-cli-3.16.1/src/Command/Activity/ActivityListCommand.php
--- old/platformsh-cli-3.15.4/src/Command/Activity/ActivityListCommand.php      
2017-05-03 22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Command/Activity/ActivityListCommand.php      
2017-05-12 10:13:12.000000000 +0200
@@ -5,8 +5,10 @@
 use Platformsh\Cli\Console\AdaptiveTableCell;
 use Platformsh\Cli\Service\ActivityMonitor;
 use Platformsh\Cli\Service\Table;
+use Symfony\Component\Console\Helper\ProgressBar;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\NullOutput;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class ActivityListCommand extends CommandBase
@@ -49,12 +51,33 @@
 
         if ($this->hasSelectedEnvironment() && !$input->getOption('all')) {
             $environmentSpecific = true;
-            $environment = $this->getSelectedEnvironment();
-            $activities = $environment->getActivities($limit, 
$input->getOption('type'), $startsAt);
+            $apiResource = $this->getSelectedEnvironment();
         } else {
             $environmentSpecific = false;
-            $activities = $project->getActivities($limit, 
$input->getOption('type'), $startsAt);
+            $apiResource = $project;
         }
+
+        $activities = [];
+        $type = $input->getOption('type');
+        $progress = new ProgressBar($output->isDecorated() ? $this->stdErr : 
new NullOutput());
+        $progress->setMessage('Loading activities...');
+        $progress->setFormat('%message% %current% (max: %max%)');
+        $progress->start($limit);
+        while (count($activities) < $limit) {
+            if ($activity = end($activities)) {
+                $startsAt = strtotime($activity->created_at);
+            }
+            $nextActivities = $apiResource->getActivities($limit - 
count($activities), $type, $startsAt);
+            if (!count($nextActivities)) {
+                break;
+            }
+            foreach ($nextActivities as $activity) {
+                $activities[$activity->id] = $activity;
+            }
+            $progress->setProgress(count($activities));
+        }
+        $progress->clear();
+
         /** @var \Platformsh\Client\Model\Activity[] $activities */
         if (!$activities) {
             $this->stdErr->writeln('No activities found');
@@ -88,18 +111,18 @@
         }
 
         if (!$table->formatIsMachineReadable()) {
-            if ($environmentSpecific && isset($environment)) {
+            if ($environmentSpecific) {
                 $this->stdErr->writeln(
                     sprintf(
                         'Activities for the environment <info>%s</info>:',
-                        $environment->id
+                        $apiResource->id
                     )
                 );
-            } elseif (!$environmentSpecific) {
+            } else {
                 $this->stdErr->writeln(
                     sprintf(
                         'Activities for the project <info>%s</info>:',
-                        $project->id
+                        $this->api()->getProjectLabel($project)
                     )
                 );
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.4/src/Command/Auth/AuthTokenCommand.php 
new/platformsh-cli-3.16.1/src/Command/Auth/AuthTokenCommand.php
--- old/platformsh-cli-3.15.4/src/Command/Auth/AuthTokenCommand.php     
1970-01-01 01:00:00.000000000 +0100
+++ new/platformsh-cli-3.16.1/src/Command/Auth/AuthTokenCommand.php     
2017-05-12 10:13:12.000000000 +0200
@@ -0,0 +1,31 @@
+<?php
+namespace Platformsh\Cli\Command\Auth;
+
+use Platformsh\Cli\Command\CommandBase;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class AuthTokenCommand extends CommandBase
+{
+    protected $hiddenInList = true;
+
+    protected function configure()
+    {
+        $this->setName('auth:token')
+            ->setDescription(sprintf(
+                'Obtain an OAuth 2 access token for requests to %s APIs',
+                $this->config()->get('service.name')
+            ));
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        $this->stdErr->writeln(
+            '<comment>Keep access tokens secret. Using this command is not 
recommended.</comment>'
+        );
+
+        $output->writeln($this->api()->getAccessToken());
+
+        return 0;
+    }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.4/src/Command/Db/DbDumpCommand.php 
new/platformsh-cli-3.16.1/src/Command/Db/DbDumpCommand.php
--- old/platformsh-cli-3.15.4/src/Command/Db/DbDumpCommand.php  2017-05-03 
22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Command/Db/DbDumpCommand.php  2017-05-12 
10:13:12.000000000 +0200
@@ -17,6 +17,7 @@
         $this->setName('db:dump')
             ->setDescription('Create a local dump of the remote database');
         $this->addOption('file', 'f', InputOption::VALUE_REQUIRED, 'A custom 
filename for the dump')
+            ->addOption('directory', 'd', InputOption::VALUE_REQUIRED, 'A 
custom directory for the dump')
             ->addOption('gzip', 'z', InputOption::VALUE_NONE, 'Compress the 
dump using gzip')
             ->addOption('timestamp', 't', InputOption::VALUE_NONE, 'Add a 
timestamp to the dump filename')
             ->addOption('stdout', 'o', InputOption::VALUE_NONE, 'Output to 
STDOUT instead of a file')
@@ -63,38 +64,45 @@
             if ($schemaOnly) {
                 $defaultFilename .= '--schema';
             }
-            if ($timestamp !== null) {
-                $defaultFilename .= '--' . $timestamp;
-            }
             $defaultFilename .= '--dump.sql';
             if ($gzip) {
                 $defaultFilename .= '.gz';
             }
-            if ($projectRoot = $this->getProjectRoot()) {
-                $defaultFilename = $projectRoot . '/' . $defaultFilename;
-            }
-            $dumpFile = $defaultFilename;
+            $projectRoot = $this->getProjectRoot();
+            $dumpFile = $projectRoot ? $projectRoot . '/' . $defaultFilename : 
$defaultFilename;
 
             // Process the user --file option.
-            if ($input->getOption('file')) {
-                $dumpFile = rtrim($input->getOption('file'), '/');
+            if ($fileOption = $input->getOption('file')) {
+                if (is_dir($fileOption)) {
+                    $this->stdErr->writeln(sprintf('Filename is a directory: 
<error>%s</error>', $fileOption));
+                    $this->stdErr->writeln('Use the --directory option to 
specify a directory.');
 
-                // Ensure the filename is not a directory.
-                if (is_dir($dumpFile)) {
-                    $dumpFile .= '/' . $defaultFilename;
+                    return 1;
                 }
+                $dumpFile = rtrim($fileOption, '/');
+            }
+
+            // Process the user --directory option.
+            if ($directoryOption = $input->getOption('directory')) {
+                if (!is_dir($directoryOption)) {
+                    $this->stdErr->writeln(sprintf('Directory not found: 
<error>%s</error>', $directoryOption));
+
+                    return 1;
+                }
+                $dumpFile = rtrim($directoryOption, '/') . '/' . 
basename($dumpFile);
+            }
 
-                // Insert a timestamp into the filename.
-                if ($timestamp) {
-                    $basename = basename($dumpFile);
-                    $prefix = substr($dumpFile, 0, - strlen($basename));
-                    if ($dotPos = strrpos($basename, '.')) {
-                        $basename = substr($basename, 0, $dotPos) . '--' . 
$timestamp . substr($basename, $dotPos);
-                    } else {
-                        $basename .= '--' . $timestamp;
-                    }
-                    $dumpFile = $prefix . $basename;
+            // Insert a timestamp into the filename, before the
+            // extension.
+            if ($timestamp !== null && strpos($dumpFile, $timestamp) === 
false) {
+                $basename = basename($dumpFile);
+                $prefix = substr($dumpFile, 0, - strlen($basename));
+                if (($dotPos = strpos($basename, '.')) > 0) {
+                    $basenameWithTimestamp = substr($basename, 0, $dotPos) . 
'--' . $timestamp . substr($basename, $dotPos);
+                } else {
+                    $basenameWithTimestamp = $basename . '--' . $timestamp;
                 }
+                $dumpFile = $prefix . $basenameWithTimestamp;
             }
 
             // Make the filename absolute.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.4/src/Command/DocsCommand.php 
new/platformsh-cli-3.16.1/src/Command/DocsCommand.php
--- old/platformsh-cli-3.15.4/src/Command/DocsCommand.php       2017-05-03 
22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Command/DocsCommand.php       2017-05-12 
10:13:12.000000000 +0200
@@ -22,19 +22,11 @@
 
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $url = $this->config()->get('service.docs_url');
-
-        $search = $input->getArgument('search');
-        if ($search) {
-            $query = $this->getSearchQuery($search);
-
-            // @todo provide native or other search options?
-            //$url .= '/search?q=' . urlencode($term);
-
-            // Use Google search.
-            $hostname = parse_url($this->config()->get('service.docs_url'), 
PHP_URL_HOST);
-            $url = 'https://www.google.com/search?q='
-                . urlencode('site:' . $hostname . ' ' . $query);
+        if ($searchArguments = $input->getArgument('search')) {
+            $query = $this->getSearchQuery($searchArguments);
+            $url = str_replace('{{ terms }}', urlencode($query), 
$this->config()->get('service.docs_search_url'));
+        } else {
+            $url = $this->config()->get('service.docs_url');
         }
 
         /** @var \Platformsh\Cli\Service\Url $urlService */
@@ -43,24 +35,19 @@
     }
 
     /**
-     * @param array $args
+     * Turn a list of command arguments into a search query.
      *
-     * @return string
-     */
-    protected function getSearchQuery(array $args)
-    {
-        $quoted = array_map([$this, 'quoteTerm'], $args);
-
-        return implode(' ', $quoted);
-    }
-
-    /**
-     * @param string $term
+     * Arguments containing a space would have been quoted on the command line,
+     * so quotes are added again here.
+     *
+     * @param string[] $args
      *
      * @return string
      */
-    public function quoteTerm($term)
+    protected function getSearchQuery(array $args)
     {
-        return strpos($term, ' ') ? '"' . $term . '"' : $term;
+        return implode(' ', array_map(function ($term) {
+            return strpos($term, ' ') ? '"' . $term . '"' : $term;
+        }, $args));
     }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.4/src/Command/Project/ProjectCurlCommand.php 
new/platformsh-cli-3.16.1/src/Command/Project/ProjectCurlCommand.php
--- old/platformsh-cli-3.15.4/src/Command/Project/ProjectCurlCommand.php        
1970-01-01 01:00:00.000000000 +0100
+++ new/platformsh-cli-3.16.1/src/Command/Project/ProjectCurlCommand.php        
2017-05-12 10:13:12.000000000 +0200
@@ -0,0 +1,84 @@
+<?php
+namespace Platformsh\Cli\Command\Project;
+
+use Platformsh\Cli\Command\CommandBase;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\BufferedOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class ProjectCurlCommand extends CommandBase
+{
+    protected $hiddenInList = true;
+
+    protected function configure()
+    {
+        $this
+            ->setName('project:curl')
+            ->setDescription("Run a cURL request on a project's API")
+            ->addArgument('path', InputArgument::OPTIONAL, 'The API path')
+            ->addOption('request', 'X', InputOption::VALUE_REQUIRED, 'The 
request method to use')
+            ->addOption('data', 'd', InputOption::VALUE_REQUIRED, 'Data to 
send')
+            ->addOption('include', 'i', InputOption::VALUE_NONE, 'Include 
headers in the output')
+            ->addOption('head', 'I', InputOption::VALUE_NONE, 'Fetch headers 
only')
+            ->addOption('header', 'H', InputOption::VALUE_REQUIRED | 
InputOption::VALUE_IS_ARRAY, 'Extra header(s)');
+        $this->addProjectOption();
+        $this->addExample('Change the project title', '-X PATCH -d \'{"title": 
"New title"}\'');
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        $this->validateInput($input);
+
+        $url = $this->getSelectedProject()->getUri();
+
+        if ($path = $input->getArgument('path')) {
+            if (parse_url($path, PHP_URL_HOST)) {
+                $this->stdErr->writeln(sprintf('Invalid path: 
<error>%s</error>', $path));
+
+                return 1;
+            }
+            $url .= '/' . ltrim($path, '/');
+        }
+
+        $token = $this->api()->getAccessToken();
+        $commandline = sprintf(
+            'curl -H %s %s',
+            escapeshellarg('Authorization: Bearer ' . $token),
+            escapeshellarg($url)
+        );
+
+        if ($input->getOption('head')) {
+            $commandline .= ' --head';
+        }
+
+        if ($input->getOption('include')) {
+            $commandline .= ' --include';
+        }
+
+        if ($requestMethod = $input->getOption('request')) {
+            $commandline .= ' -X ' . escapeshellarg($requestMethod);
+        }
+
+        if ($data = $input->getOption('data')) {
+            $commandline .= ' --data ' . escapeshellarg($data);
+        }
+
+        foreach ($input->getOption('header') as $header) {
+            $commandline .= ' --header ' . escapeshellarg($header);
+        }
+
+        if ($output->isVeryVerbose()) {
+            $commandline .= ' --verbose';
+        } else {
+            $commandline .= ' --silent --show-error';
+        }
+
+        $this->stdErr->writeln(sprintf('Running command: <info>%s</info>', 
str_replace($token, '[token]', $commandline)), 
OutputInterface::VERBOSITY_VERBOSE);
+
+        $process = proc_open($commandline, [STDIN, STDOUT, STDERR], $pipes);
+
+        return proc_close($process);
+    }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.4/src/Command/Project/ProjectGetCommand.php 
new/platformsh-cli-3.16.1/src/Command/Project/ProjectGetCommand.php
--- old/platformsh-cli-3.15.4/src/Command/Project/ProjectGetCommand.php 
2017-05-03 22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Command/Project/ProjectGetCommand.php 
2017-05-12 10:13:12.000000000 +0200
@@ -5,13 +5,11 @@
 use Platformsh\Cli\Command\CommandBase;
 use Platformsh\Cli\Local\BuildFlavor\Drupal;
 use Platformsh\Cli\Service\Ssh;
-use Platformsh\Client\Model\Project;
 use Symfony\Component\Console\Exception\InvalidArgumentException;
 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 Symfony\Component\Filesystem\Filesystem;
 
 class ProjectGetCommand extends CommandBase
 {
@@ -47,8 +45,10 @@
         $git = $this->getService('git');
         /** @var \Platformsh\Cli\Service\Ssh $ssh */
         $ssh = $this->getService('ssh');
+        /** @var \Platformsh\Cli\Service\Filesystem $fs */
+        $fs = $this->getService('fs');
 
-        $projectRootRelative = (new 
Filesystem())->makePathRelative($projectRoot, getcwd());
+        $projectRootRelative = $fs->makePathRelative($projectRoot, getcwd());
 
         $git->ensureInstalled();
         $git->setSshCommand($ssh->getSshCommand());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.4/src/Command/Self/SelfBuildCommand.php 
new/platformsh-cli-3.16.1/src/Command/Self/SelfBuildCommand.php
--- old/platformsh-cli-3.15.4/src/Command/Self/SelfBuildCommand.php     
2017-05-03 22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Command/Self/SelfBuildCommand.php     
2017-05-12 10:13:12.000000000 +0200
@@ -2,6 +2,7 @@
 namespace Platformsh\Cli\Command\Self;
 
 use Platformsh\Cli\Command\CommandBase;
+use Symfony\Component\Console\Helper\FormatterHelper;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
@@ -62,25 +63,23 @@
             return 1;
         }
 
+        $version = $this->config()->get('application.version');
+
         $boxConfig = [];
         if ($outputFilename) {
             /** @var \Platformsh\Cli\Service\Filesystem $fs */
             $fs = $this->getService('fs');
             $boxConfig['output'] = $fs->makePathAbsolute($outputFilename);
+            $phar = $boxConfig['output'];
         } else {
-            // Default output: CLI_PHAR in the current directory.
-            $cwd = getcwd();
-            if ($cwd && $cwd !== CLI_ROOT) {
-                $boxConfig['output'] = getcwd() . '/' . 
$this->config()->get('application.phar');
-            }
+            // Default output: cli-VERSION.phar in the current directory.
+            $boxConfig['output'] = getcwd() . '/cli-' . $version . '.phar';
+            $phar = $boxConfig['output'];
         }
         if ($keyFilename) {
             $boxConfig['key'] = realpath($keyFilename);
         }
 
-        $phar = isset($boxConfig['output'])
-            ? $boxConfig['output']
-            : CLI_ROOT . '/' . $this->config()->get('application.phar');
         if (file_exists($phar)) {
             /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */
             $questionHelper = $this->getService('question_helper');
@@ -118,7 +117,7 @@
             $boxArgs[] = '--configuration=' . $tmpJson;
         }
 
-        $this->stdErr->writeln("Building Phar package using Box");
+        $this->stdErr->writeln('Building Phar package using Box');
         $result = $shell->execute($boxArgs, CLI_ROOT, false, true);
 
         // Clean up the temporary file, regardless of errors.
@@ -131,18 +130,20 @@
         }
 
         if (!file_exists($phar)) {
-            $this->stdErr->writeln("File not found: <error>$phar</error>");
+            $this->stdErr->writeln(sprintf('Build failed: file not found: 
<error>%s</error>', $phar));
             return 1;
         }
 
         $sha1 = sha1_file($phar);
-        $version = $this->config()->get('application.version');
         $size = filesize($phar);
 
-        $output->writeln("Package built: <info>$phar</info>");
-        $this->stdErr->writeln("  Size: " . number_format($size) . " B");
-        $this->stdErr->writeln("  SHA1: $sha1");
-        $this->stdErr->writeln("  Version: $version");
+        $this->stdErr->writeln('The package was built successfully');
+        $output->writeln($phar);
+        $this->stdErr->writeln([
+            sprintf('Size: %s', FormatterHelper::formatMemory($size)),
+            sprintf('SHA1: %s', $sha1),
+            sprintf('Version: %s', $version),
+        ]);
         return 0;
     }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.4/src/Command/Self/SelfInstallCommand.php 
new/platformsh-cli-3.16.1/src/Command/Self/SelfInstallCommand.php
--- old/platformsh-cli-3.15.4/src/Command/Self/SelfInstallCommand.php   
2017-05-03 22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Command/Self/SelfInstallCommand.php   
2017-05-12 10:13:12.000000000 +0200
@@ -2,6 +2,7 @@
 namespace Platformsh\Cli\Command\Self;
 
 use Platformsh\Cli\Command\CommandBase;
+use Platformsh\Cli\Service\Filesystem;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
@@ -108,14 +109,16 @@
      */
     protected function findShellConfigFile()
     {
-        /** @var \Platformsh\Cli\Service\Filesystem $fs */
-        $fs = $this->getService('fs');
-        $homeDir = $fs->getHomeDirectory();
-        $candidates = ['.zshrc', '.bashrc', '.bash_profile', '.profile'];
+        $candidates = [
+            '.bash_profile',
+            '.bashrc',
+        ];
         $shell = str_replace('/bin/', '', getenv('SHELL'));
-        if (!empty($shell)) {
-            array_unshift($candidates, '.' . $shell . 'rc');
+        if ($shell === 'zsh') {
+            array_unshift($candidates, '.zshrc');
+            array_unshift($candidates, '.zprofile');
         }
+        $homeDir = Filesystem::getHomeDirectory();
         foreach ($candidates as $candidate) {
             if (file_exists($homeDir . DIRECTORY_SEPARATOR . $candidate)) {
                 return $homeDir . DIRECTORY_SEPARATOR . $candidate;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.4/src/Local/BuildFlavor/Drupal.php 
new/platformsh-cli-3.16.1/src/Local/BuildFlavor/Drupal.php
--- old/platformsh-cli-3.15.4/src/Local/BuildFlavor/Drupal.php  2017-05-03 
22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Local/BuildFlavor/Drupal.php  2017-05-12 
10:13:12.000000000 +0200
@@ -114,7 +114,7 @@
         if (!$repositoryDir = $this->gitHelper->getRoot($this->appRoot)) {
             return;
         }
-        $relative = (new Filesystem())->makePathRelative($this->appRoot . '/' 
. $filename, $repositoryDir);
+        $relative = $this->fsHelper->makePathRelative($this->appRoot . '/' . 
$filename, $repositoryDir);
         if (!$this->gitHelper->checkIgnore($relative, $repositoryDir)) {
             $suggestion = $suggestion ?: $relative;
             $this->stdErr->writeln("<comment>You should exclude this file 
using .gitignore:</comment> $suggestion");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.4/src/Service/Api.php 
new/platformsh-cli-3.16.1/src/Service/Api.php
--- old/platformsh-cli-3.15.4/src/Service/Api.php       2017-05-03 
22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Service/Api.php       2017-05-12 
10:13:12.000000000 +0200
@@ -593,4 +593,25 @@
 
         return reset($matched);
     }
+
+    /**
+     * Returns the OAuth 2 access token.
+     *
+     * @return string
+     */
+    public function getAccessToken()
+    {
+        $session = $this->getClient()->getConnector()->getSession();
+        $token = $session->get('accessToken');
+        $expires = $session->get('expires');
+        if (!$token || $expires < time()) {
+            // Force a connection to the API to ensure there is an access 
token.
+            $this->getMyAccount(true);
+            if (!$token = $session->get('accessToken')) {
+                throw new \RuntimeException('No access token found');
+            }
+        }
+
+        return $token;
+    }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.4/src/Service/Filesystem.php 
new/platformsh-cli-3.16.1/src/Service/Filesystem.php
--- old/platformsh-cli-3.15.4/src/Service/Filesystem.php        2017-05-03 
22:56:42.000000000 +0200
+++ new/platformsh-cli-3.16.1/src/Service/Filesystem.php        2017-05-12 
10:13:12.000000000 +0200
@@ -224,12 +224,34 @@
             throw new \InvalidArgumentException('Target not found: ' . 
$target);
         }
         if ($this->relative) {
-            $target = rtrim($this->fs->makePathRelative(realpath($target), 
dirname($link)), '/');
+            $target = $this->makePathRelative($target, dirname($link));
         }
         $this->fs->symlink($target, $link, $this->copyOnWindows);
     }
 
     /**
+     * Wraps Symfony Filesystem's makePathRelative() with enhancements.
+     *
+     * This ensures both parts of the path are realpaths, if possible, before
+     * calculating the relative path. It also trims trailing slashes.
+     *
+     * @param string $path      An absolute path.
+     * @param string $reference The path to which it will be made relative.
+     *
+     * @see SymfonyFilesystem::makePathRelative()
+     *
+     * @return string
+     *   The $path, relative to the $reference.
+     */
+    public function makePathRelative($path, $reference)
+    {
+        $path = realpath($path) ?: $path;
+        $reference = realpath($reference) ?: $reference;
+
+        return rtrim($this->fs->makePathRelative($path, $reference), 
DIRECTORY_SEPARATOR);
+    }
+
+    /**
      * Check if a filename is in the blacklist.
      *
      * @param string   $filename

++++++ platformsh-cli-vendor.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/autoload.php new/vendor/autoload.php
--- old/vendor/autoload.php     2017-05-04 01:42:29.783354474 +0200
+++ new/vendor/autoload.php     2017-05-15 23:07:40.647811086 +0200
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit4d78107d8e04c97e94be640c74495e21::getLoader();
+return ComposerAutoloaderInitaaa75d9b983169b74b3a2cb773c4dcdb::getLoader();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/composer/autoload_real.php 
new/vendor/composer/autoload_real.php
--- old/vendor/composer/autoload_real.php       2017-05-04 01:42:29.783354474 
+0200
+++ new/vendor/composer/autoload_real.php       2017-05-15 23:07:40.647811086 
+0200
@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInit4d78107d8e04c97e94be640c74495e21
+class ComposerAutoloaderInitaaa75d9b983169b74b3a2cb773c4dcdb
 {
     private static $loader;
 
@@ -19,15 +19,15 @@
             return self::$loader;
         }
 
-        
spl_autoload_register(array('ComposerAutoloaderInit4d78107d8e04c97e94be640c74495e21',
 'loadClassLoader'), true, true);
+        
spl_autoload_register(array('ComposerAutoloaderInitaaa75d9b983169b74b3a2cb773c4dcdb',
 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        
spl_autoload_unregister(array('ComposerAutoloaderInit4d78107d8e04c97e94be640c74495e21',
 'loadClassLoader'));
+        
spl_autoload_unregister(array('ComposerAutoloaderInitaaa75d9b983169b74b3a2cb773c4dcdb',
 'loadClassLoader'));
 
         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') 
&& (!function_exists('zend_loader_file_encoded') || 
!zend_loader_file_encoded());
         if ($useStaticLoader) {
             require_once __DIR__ . '/autoload_static.php';
 
-            
call_user_func(\Composer\Autoload\ComposerStaticInit4d78107d8e04c97e94be640c74495e21::getInitializer($loader));
+            
call_user_func(\Composer\Autoload\ComposerStaticInitaaa75d9b983169b74b3a2cb773c4dcdb::getInitializer($loader));
         } else {
             $map = require __DIR__ . '/autoload_namespaces.php';
             foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@
         $loader->register(true);
 
         if ($useStaticLoader) {
-            $includeFiles = 
Composer\Autoload\ComposerStaticInit4d78107d8e04c97e94be640c74495e21::$files;
+            $includeFiles = 
Composer\Autoload\ComposerStaticInitaaa75d9b983169b74b3a2cb773c4dcdb::$files;
         } else {
             $includeFiles = require __DIR__ . '/autoload_files.php';
         }
         foreach ($includeFiles as $fileIdentifier => $file) {
-            composerRequire4d78107d8e04c97e94be640c74495e21($fileIdentifier, 
$file);
+            composerRequireaaa75d9b983169b74b3a2cb773c4dcdb($fileIdentifier, 
$file);
         }
 
         return $loader;
     }
 }
 
-function composerRequire4d78107d8e04c97e94be640c74495e21($fileIdentifier, 
$file)
+function composerRequireaaa75d9b983169b74b3a2cb773c4dcdb($fileIdentifier, 
$file)
 {
     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
         require $file;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/composer/autoload_static.php 
new/vendor/composer/autoload_static.php
--- old/vendor/composer/autoload_static.php     2017-05-04 01:42:29.783354474 
+0200
+++ new/vendor/composer/autoload_static.php     2017-05-15 23:07:40.647811086 
+0200
@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit4d78107d8e04c97e94be640c74495e21
+class ComposerStaticInitaaa75d9b983169b74b3a2cb773c4dcdb
 {
     public static $files = array (
         '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . 
'/symfony/polyfill-mbstring/bootstrap.php',
@@ -183,9 +183,9 @@
     public static function getInitializer(ClassLoader $loader)
     {
         return \Closure::bind(function () use ($loader) {
-            $loader->prefixLengthsPsr4 = 
ComposerStaticInit4d78107d8e04c97e94be640c74495e21::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = 
ComposerStaticInit4d78107d8e04c97e94be640c74495e21::$prefixDirsPsr4;
-            $loader->classMap = 
ComposerStaticInit4d78107d8e04c97e94be640c74495e21::$classMap;
+            $loader->prefixLengthsPsr4 = 
ComposerStaticInitaaa75d9b983169b74b3a2cb773c4dcdb::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = 
ComposerStaticInitaaa75d9b983169b74b3a2cb773c4dcdb::$prefixDirsPsr4;
+            $loader->classMap = 
ComposerStaticInitaaa75d9b983169b74b3a2cb773c4dcdb::$classMap;
 
         }, null, ClassLoader::class);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/composer/installed.json 
new/vendor/composer/installed.json
--- old/vendor/composer/installed.json  2017-05-04 01:42:29.223350382 +0200
+++ new/vendor/composer/installed.json  2017-05-15 23:07:40.035805586 +0200
@@ -656,17 +656,17 @@
     },
     {
         "name": "platformsh/client",
-        "version": "v0.10.0",
-        "version_normalized": "0.10.0.0",
+        "version": "v0.10.2",
+        "version_normalized": "0.10.2.0",
         "source": {
             "type": "git",
             "url": "https://github.com/platformsh/platformsh-client-php.git";,
-            "reference": "c56d8251e3c5eff1dae45aad6f00afd90395931e"
+            "reference": "69e90df40fe201469473a467420557aa9bb6bcd0"
         },
         "dist": {
             "type": "zip",
-            "url": 
"https://api.github.com/repos/platformsh/platformsh-client-php/zipball/c56d8251e3c5eff1dae45aad6f00afd90395931e";,
-            "reference": "c56d8251e3c5eff1dae45aad6f00afd90395931e",
+            "url": 
"https://api.github.com/repos/platformsh/platformsh-client-php/zipball/69e90df40fe201469473a467420557aa9bb6bcd0";,
+            "reference": "69e90df40fe201469473a467420557aa9bb6bcd0",
             "shasum": ""
         },
         "require": {
@@ -679,7 +679,7 @@
         "require-dev": {
             "phpunit/phpunit": "~4.5"
         },
-        "time": "2017-04-01T18:12:24+00:00",
+        "time": "2017-05-10T12:14:35+00:00",
         "type": "library",
         "extra": {
             "patches": {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/platformsh/client/src/Model/Activity.php 
new/vendor/platformsh/client/src/Model/Activity.php
--- old/vendor/platformsh/client/src/Model/Activity.php 2017-04-01 
20:12:24.000000000 +0200
+++ new/vendor/platformsh/client/src/Model/Activity.php 2017-05-10 
14:14:35.000000000 +0200
@@ -129,97 +129,97 @@
         switch ($type) {
             case 'project.domain.create':
                 return sprintf(
-                  "%s added domain %s",
-                  $payload['user']['display_name'],
-                  $payload['domain']['name']
+                    '%s added domain %s',
+                    $payload['user']['display_name'],
+                    $payload['domain']['name']
                 );
 
             case 'project.domain.delete':
                 return sprintf(
-                  "%s deleted domain %s",
-                  $payload['user']['display_name'],
-                  $payload['domain']['name']
+                    '%s deleted domain %s',
+                    $payload['user']['display_name'],
+                    $payload['domain']['name']
                 );
 
             case 'project.domain.update':
                 return sprintf(
-                  "%s updated domain %s",
-                  $payload['user']['display_name'],
-                  $payload['domain']['name']
+                    '%s updated domain %s',
+                    $payload['user']['display_name'],
+                    $payload['domain']['name']
                 );
 
             case 'project.modify.title':
                 return sprintf(
-                  "%s changed project name to %s",
-                  $payload['user']['display_name'],
-                  $payload['new_title']
+                    '%s changed project name to %s',
+                    $payload['user']['display_name'],
+                    $payload['new_title']
                 );
 
             case 'environment.activate':
                 return sprintf(
-                  "%s activated environment %s",
-                  $payload['user']['display_name'],
-                  $payload['environment']['title']
+                    '%s activated environment %s',
+                    $payload['user']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.backup':
                 return sprintf(
-                  "%s created a snapshot of %s",
-                  $payload['user']['display_name'],
-                  $payload['environment']['title']
+                    '%s created a snapshot of %s',
+                    $payload['user']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.branch':
                 return sprintf(
-                  "%s branched %s from %s",
-                  $payload['user']['display_name'],
-                  $payload['outcome']['title'],
-                  $payload['parent']['title']
+                    '%s branched %s from %s',
+                    $payload['user']['display_name'],
+                    $payload['outcome']['title'],
+                    $payload['parent']['title']
                 );
 
             case 'environment.delete':
                 return sprintf(
-                  "%s deleted environment %s",
-                  $payload['user']['display_name'],
-                  $payload['environment']['title']
+                    '%s deleted environment %s',
+                    $payload['user']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.deactivate':
                 return sprintf(
-                  "%s deactivated environment %s",
-                  $payload['user']['display_name'],
-                  $payload['environment']['title']
+                    '%s deactivated environment %s',
+                    $payload['user']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.initialize':
                 return sprintf(
-                  "%s initialized environment %s with profile %s",
-                  $payload['user']['display_name'],
-                  $payload['outcome']['title'],
-                  $payload['profile']
+                    '%s initialized environment %s with profile %s',
+                    $payload['user']['display_name'],
+                    $payload['outcome']['title'],
+                    $payload['profile']
                 );
 
             case 'environment.merge':
                 return sprintf(
-                  "%s merged %s into %s",
-                  $payload['user']['display_name'],
-                  $payload['outcome']['title'],
-                  $payload['environment']['title']
+                    '%s merged %s into %s',
+                    $payload['user']['display_name'],
+                    $payload['outcome']['title'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.push':
                 return sprintf(
-                  "%s pushed to %s",
-                  $payload['user']['display_name'],
-                  $payload['environment']['title']
+                    '%s pushed to %s',
+                    $payload['user']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.restore':
                 return sprintf(
-                  "%s restored %s from snapshot %s",
-                  $payload['user']['display_name'],
-                  $payload['environment'],
-                  substr($payload['backup_name'], 0, 7)
+                    '%s restored %s from snapshot %s',
+                    $payload['user']['display_name'],
+                    $payload['environment'],
+                    substr($payload['backup_name'], 0, 7)
                 );
 
             case 'environment.synchronize':
@@ -232,98 +232,144 @@
                     $syncType = 'data';
                 }
                 return sprintf(
-                  "%s synced %s's %s with %s",
-                  $payload['user']['display_name'],
-                  $payload['outcome']['title'],
-                  $syncType,
-                  $payload['environment']['title']
+                    "%s synced %s's %s with %s",
+                    $payload['user']['display_name'],
+                    $payload['outcome']['title'],
+                    $syncType,
+                    $payload['environment']['title']
                 );
 
             case 'environment.access.add':
                 return sprintf(
-                  "%s added %s to %s",
-                  $payload['user']['display_name'],
-                  $payload['access']['display_name'],
-                  $payload['environment']['title']
+                    '%s added %s to %s',
+                    $payload['user']['display_name'],
+                    $payload['access']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.access.remove':
                 return sprintf(
-                  "%s removed %s from %s",
-                  $payload['user']['display_name'],
-                  $payload['access']['display_name'],
-                  $payload['environment']['title']
+                    '%s removed %s from %s',
+                    $payload['user']['display_name'],
+                    $payload['access']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.variable.create':
                 return sprintf(
-                  "%s added variable %s",
-                  $payload['user']['display_name'],
-                  $payload['variable']['name']
+                    '%s added environment variable %s',
+                    $payload['user']['display_name'],
+                    $payload['variable']['name']
                 );
 
             case 'environment.variable.delete':
                 return sprintf(
-                  "%s deleted variable %s",
-                  $payload['user']['display_name'],
-                  $payload['variable']['name']
+                    '%s deleted environment variable %s',
+                    $payload['user']['display_name'],
+                    $payload['variable']['name']
                 );
 
             case 'environment.variable.update':
                 return sprintf(
-                  "%s modified variable %s",
-                  $payload['user']['display_name'],
-                  $payload['variable']['name']
+                    '%s modified environment variable %s',
+                    $payload['user']['display_name'],
+                    $payload['variable']['name']
                 );
 
             case 'environment.update.http_access':
                 return sprintf(
-                  "%s updated HTTP Access settings on environment %s",
-                  $payload['user']['display_name'],
-                  $payload['environment']['title']
-                );
-
-            case 'environment.update.smtp':
-                return sprintf(
-                  "%s updated SMTP settings on environment %s",
-                  $payload['user']['display_name'],
-                  $payload['environment']['title']
+                    '%s updated HTTP Access settings on environment %s',
+                    $payload['user']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'environment.route.create':
                 return sprintf(
-                  "%s added route %s",
-                  $payload['user']['display_name'],
-                  $payload['route']['route']
+                    '%s added route %s',
+                    $payload['user']['display_name'],
+                    $payload['route']['id']
                 );
 
             case 'environment.route.delete':
                 return sprintf(
-                  "%s deleted route %s",
-                  $payload['user']['display_name'],
-                  $payload['route']['route']
+                    '%s deleted route %s',
+                    $payload['user']['display_name'],
+                    $payload['route']['id']
                 );
 
             case 'environment.route.update':
                 return sprintf(
-                  "%s modified route %s",
-                  $payload['user']['display_name'],
-                  $payload['route']['route']
+                    '%s modified route %s',
+                    $payload['user']['display_name'],
+                    $payload['route']['id']
                 );
 
             case 'environment.subscription.update':
                 return sprintf(
-                  "%s modified subscription",
-                  $payload['user']['display_name']
+                    '%s modified subscription',
+                    $payload['user']['display_name']
+                );
+
+            case 'environment.update.restrict_robots':
+                return sprintf(
+                    '%s updated the robots.txt settings on environment %s',
+                    $payload['user']['display_name'],
+                    $payload['environment']['title']
+                );
+
+            case 'environment.update.smtp':
+                return sprintf(
+                    '%s updated SMTP settings on environment %s',
+                    $payload['user']['display_name'],
+                    $payload['environment']['title']
                 );
 
             case 'project.create':
                 return sprintf(
-                  "%s created a new project %s",
-                  $payload['user']['display_name'],
-                  $payload['outcome']['title']
+                    '%s created a new project %s',
+                    $payload['user']['display_name'],
+                    $payload['outcome']['title']
+                );
+
+            case 'project.variable.create':
+                return sprintf(
+                    '%s added project variable %s',
+                    $payload['user']['display_name'],
+                    $payload['variable']['name']
+                );
+
+            case 'project.variable.delete':
+                return sprintf(
+                    '%s deleted project variable %s',
+                    $payload['user']['display_name'],
+                    $payload['variable']['name']
+                );
+
+            case 'project.variable.update':
+                return sprintf(
+                    '%s modified project variable %s',
+                    $payload['user']['display_name'],
+                    $payload['variable']['name']
                 );
         }
         return $type;
     }
+
+    /**
+     * @param int $timestamp
+     *
+     * @return false|string
+     */
+    public static function formatStartsAt($timestamp)
+    {
+        $tz = date_default_timezone_get();
+        date_default_timezone_set('UTC');
+        $date = date('c', $timestamp);
+        date_default_timezone_set($tz);
+        if (!$date) {
+            throw new \RuntimeException(sprintf('Failed to format timestamp: 
%d', $timestamp));
+        }
+
+        return $date;
+    }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/platformsh/client/src/Model/Environment.php 
new/vendor/platformsh/client/src/Model/Environment.php
--- old/vendor/platformsh/client/src/Model/Environment.php      2017-04-01 
20:12:24.000000000 +0200
+++ new/vendor/platformsh/client/src/Model/Environment.php      2017-05-10 
14:14:35.000000000 +0200
@@ -274,7 +274,7 @@
             $options['query']['type'] = $type;
         }
         if ($startsAt !== null) {
-            $options['query']['starts_at'] = date('c', $startsAt);
+            $options['query']['starts_at'] = 
Activity::formatStartsAt($startsAt);
         }
 
         return Activity::getCollection($this->getUri() . '/activities', 
$limit, $options, $this->client);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/platformsh/client/src/Model/Project.php 
new/vendor/platformsh/client/src/Model/Project.php
--- old/vendor/platformsh/client/src/Model/Project.php  2017-04-01 
20:12:24.000000000 +0200
+++ new/vendor/platformsh/client/src/Model/Project.php  2017-05-10 
14:14:35.000000000 +0200
@@ -256,7 +256,7 @@
             $options['query']['type'] = $type;
         }
         if ($startsAt !== null) {
-            $options['query']['starts_at'] = date('c', $startsAt);
+            $options['query']['starts_at'] = 
Activity::formatStartsAt($startsAt);
         }
 
         return Activity::getCollection($this->getUri() . '/activities', 
$limit, $options, $this->client);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vendor/platformsh/client/src/Session/Storage/File.php 
new/vendor/platformsh/client/src/Session/Storage/File.php
--- old/vendor/platformsh/client/src/Session/Storage/File.php   2017-04-01 
20:12:24.000000000 +0200
+++ new/vendor/platformsh/client/src/Session/Storage/File.php   2017-05-10 
14:14:35.000000000 +0200
@@ -107,13 +107,12 @@
     public function load(SessionInterface $session)
     {
         $filename = $this->getFilename($session);
-        if (file_exists($filename)) {
+        if (is_readable($filename)) {
             $raw = file_get_contents($filename);
-            if ($raw === false) {
-                throw new \Exception("Failed to read file: $filename");
+            if ($raw !== false) {
+                $data = json_decode($raw, true);
+                $session->setData(is_array($data) ? $data : []);
             }
-            $data = json_decode($raw, true);
-            $session->setData($data);
         }
     }
 }


Reply via email to