add support for parsing JSON encoded options during initial setup
authorLars Kneschke <l.kneschke@metaways.de>
Fri, 27 Feb 2015 14:11:50 +0000 (15:11 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 2 Mar 2015 10:30:00 +0000 (11:30 +0100)
Change-Id: I62c94e4feecba0a252d470bff4d61f5c987a6b9b
Reviewed-on: http://gerrit.tine20.com/customers/1698
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Setup/Frontend/Cli.php

index c6fdd63..25bfd8d 100644 (file)
@@ -395,7 +395,7 @@ class Setup_Frontend_Cli
             $errors[] = 'Missing argument: configvalue';
         }
         $configKey = (string)$options['configkey'];
-        $configValue = (Tinebase_Helper::is_json($options['configvalue'])) ? Zend_Json::decode($options['configvalue']) : self::parseConfigValue($options['configvalue']);
+        $configValue = self::parseConfigValue($options['configvalue']);
         $applicationName = (isset($options['app'])) ? $options['app'] : 'Tinebase';
         
         if (empty($errors)) {
@@ -573,6 +573,11 @@ class Setup_Frontend_Cli
     {
         if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . print_r($_value, TRUE));
         
+        // check value is json encoded
+        if (Tinebase_Helper::is_json($_value)) {
+            return Zend_Json::decode($_value); 
+        }
+        
         $result = array(
             'active' => 1
         );