Hello community,

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

Package is "platformsh-cli"

Sat May  6 18:30:20 2017 rev:10 rq:492761 version:3.15.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/platformsh-cli/platformsh-cli.changes    
2017-05-03 15:57:07.808734039 +0200
+++ /work/SRC/openSUSE:Factory/.platformsh-cli.new/platformsh-cli.changes       
2017-05-06 18:30:31.419842934 +0200
@@ -1,0 +2,9 @@
+Wed May 03 23:42:27 UTC 2017 - [email protected]
+
+- Update to version 3.15.4:
+  * Save update check time (to a place other than config)
+  * Note State could be used more often
+  * Simplify State->save()
+  * Release v3.15.4
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ platformsh-cli.spec ++++++
--- /var/tmp/diff_new_pack.28F3Q6/_old  2017-05-06 18:30:33.411561892 +0200
+++ /var/tmp/diff_new_pack.28F3Q6/_new  2017-05-06 18:30:33.415561328 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           platformsh-cli
-Version:        3.15.3
+Version:        3.15.4
 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.28F3Q6/_old  2017-05-06 18:30:33.463554556 +0200
+++ /var/tmp/diff_new_pack.28F3Q6/_new  2017-05-06 18:30:33.467553991 +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.3</param>
+    <param name="revision">refs/tags/v3.15.4</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.28F3Q6/_old  2017-05-06 18:30:33.503548913 +0200
+++ /var/tmp/diff_new_pack.28F3Q6/_new  2017-05-06 18:30:33.503548913 +0200
@@ -1,6 +1,6 @@
 <servicedata>
   <service name="tar_scm">
     <param name="url">git://github.com/platformsh/platformsh-cli.git</param>
-    <param 
name="changesrevision">3fff2c671e63c504259be508cdc4d2771862d051</param>
+    <param 
name="changesrevision">82a752a79a7e88fa36e74c4042e23904f37f8841</param>
   </service>
 </servicedata>

++++++ platformsh-cli-3.15.3.tar.xz -> platformsh-cli-3.15.4.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.3/config.yaml 
new/platformsh-cli-3.15.4/config.yaml
--- old/platformsh-cli-3.15.3/config.yaml       2017-05-02 00:40:27.000000000 
+0200
+++ new/platformsh-cli-3.15.4/config.yaml       2017-05-03 22:56:42.000000000 
+0200
@@ -1,13 +1,14 @@
 # Metadata about the CLI application itself.
 application:
   name: 'Platform.sh CLI'
-  version: '3.15.3'
+  version: '3.15.4'
   executable: 'platform'
   phar: 'platform.phar'
   package_name: 'platformsh/cli'
   installer_url: 'https://platform.sh/cli/installer'
   manifest_url: 'https://platform.sh/cli/manifest.json'
   user_config_dir: '.platformsh'
+  user_state_file: '.platformsh/state.json'
   env_prefix: 'PLATFORMSH_CLI_'
 
 # Configuration for working with projects locally.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.3/services.yaml 
new/platformsh-cli-3.15.4/services.yaml
--- old/platformsh-cli-3.15.3/services.yaml     2017-05-02 00:40:27.000000000 
+0200
+++ new/platformsh-cli-3.15.4/services.yaml     2017-05-03 22:56:42.000000000 
+0200
@@ -54,6 +54,9 @@
     ssh:
         class:     '\Platformsh\Cli\Service\Ssh'
         arguments: ['@input', '@output']
+    state:
+        class:     '\Platformsh\Cli\Service\State'
+        arguments: ['@config']
     table:
         class:     '\Platformsh\Cli\Service\Table'
         arguments: ['@input', '@output']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.3/src/Command/CommandBase.php 
new/platformsh-cli-3.15.4/src/Command/CommandBase.php
--- old/platformsh-cli-3.15.3/src/Command/CommandBase.php       2017-05-02 
00:40:27.000000000 +0200
+++ new/platformsh-cli-3.15.4/src/Command/CommandBase.php       2017-05-03 
22:56:42.000000000 +0200
@@ -19,7 +19,6 @@
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\ConsoleOutputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Output\StreamOutput;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
 
@@ -255,7 +254,9 @@
         $embargoTime = $timestamp - $config->get('updates.check_interval');
 
         // Stop if updates were last checked after the embargo time.
-        if ($config->has('updates.last_checked') && 
$config->get('updates.last_checked') > $embargoTime) {
+        /** @var \Platformsh\Cli\Service\State $state */
+        $state = $this->getService('state');
+        if ($state->get('updates.last_checked') > $embargoTime) {
             return;
         }
 
@@ -288,6 +289,8 @@
             }
         }
 
+        $state->set('updates.last_checked', $timestamp);
+
         // If the update was successful, and it's not a major version change,
         // then prompt the user to continue after updating.
         if ($newVersion !== false) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.3/src/Command/Server/ServerCommandBase.php 
new/platformsh-cli-3.15.4/src/Command/Server/ServerCommandBase.php
--- old/platformsh-cli-3.15.3/src/Command/Server/ServerCommandBase.php  
2017-05-02 00:40:27.000000000 +0200
+++ new/platformsh-cli-3.15.4/src/Command/Server/ServerCommandBase.php  
2017-05-03 22:56:42.000000000 +0200
@@ -97,6 +97,7 @@
     {
         if (!isset($this->serverInfo)) {
             $this->serverInfo = [];
+            // @todo move this to State service (in a new major version)
             $filename = $this->config()->getUserConfigDir() . 
'/local-servers.json';
             if (file_exists($filename)) {
                 $this->serverInfo = (array) 
json_decode(file_get_contents($filename), true);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/platformsh-cli-3.15.3/src/Command/Tunnel/TunnelCommandBase.php 
new/platformsh-cli-3.15.4/src/Command/Tunnel/TunnelCommandBase.php
--- old/platformsh-cli-3.15.3/src/Command/Tunnel/TunnelCommandBase.php  
2017-05-02 00:40:27.000000000 +0200
+++ new/platformsh-cli-3.15.4/src/Command/Tunnel/TunnelCommandBase.php  
2017-05-03 22:56:42.000000000 +0200
@@ -67,6 +67,7 @@
     {
         if (!isset($this->tunnelInfo)) {
             $this->tunnelInfo = [];
+            // @todo move this to State service (in a new major version)
             $filename = $this->config()->getUserConfigDir() . 
'/tunnel-info.json';
             if (file_exists($filename)) {
                 $this->debug(sprintf('Loading tunnel info from %s', 
$filename));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/platformsh-cli-3.15.3/src/Service/State.php 
new/platformsh-cli-3.15.4/src/Service/State.php
--- old/platformsh-cli-3.15.3/src/Service/State.php     1970-01-01 
01:00:00.000000000 +0100
+++ new/platformsh-cli-3.15.4/src/Service/State.php     2017-05-03 
22:56:42.000000000 +0200
@@ -0,0 +1,90 @@
+<?php
+
+namespace Platformsh\Cli\Service;
+
+use Platformsh\Cli\Util\NestedArrayUtil;
+use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;
+
+/**
+ * Save application state.
+ */
+class State
+{
+    protected $config;
+
+    protected $state = [];
+
+    protected $loaded = false;
+
+    /**
+     * @param Config $config
+     */
+    public function __construct(Config $config)
+    {
+        $this->config = $config;
+    }
+
+    /**
+     * @param string $key
+     *
+     * @return mixed|false
+     *   The value, or false if the value does not exist.
+     */
+    public function get($key)
+    {
+        $this->load();
+        $value = NestedArrayUtil::getNestedArrayValue($this->state, 
explode('.', $key), $exists);
+
+        return $exists ? $value : false;
+    }
+
+    /**
+     * Set a state value.
+     *
+     * @param string $key
+     * @param mixed  $value
+     * @param bool   $save
+     */
+    public function set($key, $value, $save = true)
+    {
+        $this->load();
+        NestedArrayUtil::setNestedArrayValue($this->state, explode('.', $key), 
$value);
+        if ($save) {
+            $this->save();
+        }
+    }
+
+    /**
+     * Save state.
+     */
+    public function save()
+    {
+        (new SymfonyFilesystem())->dumpFile(
+            $this->getFilename(),
+            json_encode($this->state)
+        );
+    }
+
+    /**
+     * Load state.
+     */
+    protected function load()
+    {
+        if (!$this->loaded) {
+            $filename = $this->getFilename();
+            if (file_exists($filename)) {
+                $content = file_get_contents($filename);
+                $this->state = json_decode($content, true) ?: [];
+            }
+            $this->loaded = true;
+        }
+    }
+
+    /**
+     * @return string
+     */
+    protected function getFilename()
+    {
+        return Filesystem::getHomeDirectory() . '/' . 
$this->config->get('application.user_state_file');
+    }
+}

++++++ 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-02 01:05:16.417576043 +0200
+++ new/vendor/autoload.php     2017-05-04 01:42:29.783354474 +0200
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit89af1a5db1fd8f018f647d41d92d023b::getLoader();
+return ComposerAutoloaderInit4d78107d8e04c97e94be640c74495e21::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-02 01:05:16.417576043 
+0200
+++ new/vendor/composer/autoload_real.php       2017-05-04 01:42:29.783354474 
+0200
@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInit89af1a5db1fd8f018f647d41d92d023b
+class ComposerAutoloaderInit4d78107d8e04c97e94be640c74495e21
 {
     private static $loader;
 
@@ -19,15 +19,15 @@
             return self::$loader;
         }
 
-        
spl_autoload_register(array('ComposerAutoloaderInit89af1a5db1fd8f018f647d41d92d023b',
 'loadClassLoader'), true, true);
+        
spl_autoload_register(array('ComposerAutoloaderInit4d78107d8e04c97e94be640c74495e21',
 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        
spl_autoload_unregister(array('ComposerAutoloaderInit89af1a5db1fd8f018f647d41d92d023b',
 'loadClassLoader'));
+        
spl_autoload_unregister(array('ComposerAutoloaderInit4d78107d8e04c97e94be640c74495e21',
 '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\ComposerStaticInit89af1a5db1fd8f018f647d41d92d023b::getInitializer($loader));
+            
call_user_func(\Composer\Autoload\ComposerStaticInit4d78107d8e04c97e94be640c74495e21::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\ComposerStaticInit89af1a5db1fd8f018f647d41d92d023b::$files;
+            $includeFiles = 
Composer\Autoload\ComposerStaticInit4d78107d8e04c97e94be640c74495e21::$files;
         } else {
             $includeFiles = require __DIR__ . '/autoload_files.php';
         }
         foreach ($includeFiles as $fileIdentifier => $file) {
-            composerRequire89af1a5db1fd8f018f647d41d92d023b($fileIdentifier, 
$file);
+            composerRequire4d78107d8e04c97e94be640c74495e21($fileIdentifier, 
$file);
         }
 
         return $loader;
     }
 }
 
-function composerRequire89af1a5db1fd8f018f647d41d92d023b($fileIdentifier, 
$file)
+function composerRequire4d78107d8e04c97e94be640c74495e21($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-02 01:05:16.417576043 
+0200
+++ new/vendor/composer/autoload_static.php     2017-05-04 01:42:29.783354474 
+0200
@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit89af1a5db1fd8f018f647d41d92d023b
+class ComposerStaticInit4d78107d8e04c97e94be640c74495e21
 {
     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 = 
ComposerStaticInit89af1a5db1fd8f018f647d41d92d023b::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = 
ComposerStaticInit89af1a5db1fd8f018f647d41d92d023b::$prefixDirsPsr4;
-            $loader->classMap = 
ComposerStaticInit89af1a5db1fd8f018f647d41d92d023b::$classMap;
+            $loader->prefixLengthsPsr4 = 
ComposerStaticInit4d78107d8e04c97e94be640c74495e21::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = 
ComposerStaticInit4d78107d8e04c97e94be640c74495e21::$prefixDirsPsr4;
+            $loader->classMap = 
ComposerStaticInit4d78107d8e04c97e94be640c74495e21::$classMap;
 
         }, null, ClassLoader::class);
     }


Reply via email to