]> git.mxchange.org Git - friendica.git/blobdiff - src/Console/Config.php
Merge remote-tracking branch 'upstream/develop' into api4
[friendica.git] / src / Console / Config.php
index d9fab41c147ec7098df7a9c116bd3013964cc122..9b2d251973090824fbb1ba8e4500340170f2b2a7 100644 (file)
@@ -23,7 +23,7 @@ namespace Friendica\Console;
 
 use Asika\SimpleConsole\CommandArgsException;
 use Friendica\App;
-use Friendica\Core\Config\IConfig;
+use Friendica\Core\Config\Capability\IManageConfigValues;
 use RuntimeException;
 
 /**
@@ -56,7 +56,7 @@ class Config extends \Asika\SimpleConsole\Console
         */
        private $appMode;
        /**
-        * @var IConfig
+        * @var IManageConfigValues
         */
        private $config;
 
@@ -94,7 +94,7 @@ HELP;
                return $help;
        }
 
-       public function __construct(App\Mode $appMode, IConfig $config, array $argv = null)
+       public function __construct(App\Mode $appMode, IManageConfigValues $config, array $argv = null)
        {
                parent::__construct($argv);
 
@@ -128,6 +128,10 @@ HELP;
                                throw new RuntimeException("$cat.$key is an array and can't be set using this command.");
                        }
 
+                       if ($this->config->get($cat, $key) === $value) {
+                               throw new RuntimeException("$cat.$key already set to $value.");
+                       }
+
                        $result = $this->config->set($cat, $key, $value);
                        if ($result) {
                                $this->out("{$cat}.{$key} <= " .