Add error message when setting config to existing value

This commit is contained in:
Matthew Exon 2021-04-26 20:20:51 +02:00
parent 0649d2c393
commit 4858993024
2 changed files with 28 additions and 2 deletions

View file

@ -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} <= " .