Added method updateConfigurationValue() to acm2
This commit is contained in:
parent
a177db464e
commit
dcbba3ba8a
|
@ -141,6 +141,22 @@
|
|||
return $this->Configuration['configuration'][$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a configuration value
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $config_name
|
||||
* @param string $config_value
|
||||
* @throws ConfigurationNotDefinedException
|
||||
*/
|
||||
public function updateConfigurationValue(string $name, string $config_name, string $config_value)
|
||||
{
|
||||
if(isset($this->Configuration['configuration'][$name]) == false)
|
||||
throw new ConfigurationNotDefinedException($name . ' is not defined in the configuration');
|
||||
$this->Configuration['configuration'][$name][$config_name] = $config_value;
|
||||
file_put_contents($this->MasterConfigurationPath, json_encode($this->Configuration, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue