Added method updateConfigurationValue() to acm2

This commit is contained in:
Netkas 2021-10-06 10:48:46 -04:00
parent a177db464e
commit dcbba3ba8a
1 changed files with 16 additions and 0 deletions

View File

@ -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
*/