*/
public function get(string $cat, string $key = null, $default_value = null);
- /**
- * Load all configuration values from a given cache and saves it back in the configuration node store
- * @see ConfigFileManager::CONFIG_DATA_FILE
- *
- * All configuration values of the system are stored in the cache.
- *
- * @param Cache $cache a new cache
- *
- * @return void
- *
- * @throws ConfigPersistenceException In case the persistence layer throws errors
- */
- public function load(Cache $cache);
-
/**
* Sets a configuration value for system config
*
$this->configCache = $configCache;
}
+ /**
+ * Load all configuration values from a given cache and saves it back in the configuration node store
+ * @see ConfigFileManager::CONFIG_DATA_FILE
+ *
+ * All configuration values of the system are stored in the cache.
+ *
+ * @param Cache $cache a new cache
+ *
+ * @return void
+ *
+ * @throws ConfigPersistenceException In case the persistence layer throws errors
+ */
+ public function setCacheAndSave(Cache $cache)
+ {
+ $this->configCache = $cache;
+ $this->save();
+ }
+
/**
* {@inheritDoc}
*/
$this->configCache = $configCache;
}
- /** {@inheritDoc} */
- public function load(Cache $cache)
- {
- $this->configCache = $cache;
- $this->save();
- }
-
/** {@inheritDoc} */
public function get(string $cat, string $key = null, $default_value = null)
{
/** {@inheritDoc} */
public function delete(string $cat, string $key): ISetConfigValuesTransactionally
{
- $this->cache->delete($cat, $key, Cache::SOURCE_DATA);
+ $this->cache->delete($cat, $key);
$this->changedConfig = true;
return $this;
}
try {
- $this->config->load($this->cache);
+ $this->config->setCacheAndSave($this->cache);
$this->cache = clone $this->config->getCache();
} catch (\Exception $e) {
throw new ConfigPersistenceException('Cannot save config', $e);
private $source = [];
/**
- * @var array
+ * @var bool[][]
*/
private $delConfig = [];