interface IConfigAdapter
{
/**
- * @brief Loads all configuration values into a cached storage.
- *
- * All configuration values of the system are stored in global cache
- * which is available under the global variable Config::$config
+ * Loads all configuration values into a cached storage.
*
* @param string $cat The category of the configuration values to load
*
public function load($cat = "config");
/**
- * @brief Get a particular user's config variable given the category name
+ * Get a particular user's config variable given the category name
* ($family) and a key.
*
- * Get a particular config value from the given category ($family)
- * and the $key from a cached storage in static::$config[$uid].
- * $instore is only used by the set_config function
- * to determine if the key already exists in the DB
- * If a key is found in the DB but doesn't exist in
- * local config cache, pull it into the cache so we don't have
- * to hit the DB again for this item.
- *
* @param string $cat The category of the configuration value
* @param string $k The configuration key to query
* @param mixed $default_value optional, The value to return if key is not set (default: null)
public function get($cat, $k, $default_value = null, $refresh = false);
/**
- * @brief Sets a configuration value for system config
- *
* Stores a config value ($value) in the category ($family) under the key ($key)
* for the user_id $uid.
*
public function set($cat, $k, $value);
/**
- * @brief Deletes the given key from the system configuration.
- *
- * Removes the configured value from the stored cache in Config::$config
+ * Removes the configured value from the stored cache
* and removes it from the database.
*
* @param string $cat The category of the configuration value
interface IPConfigAdapter
{
/**
- * @brief Loads all configuration values of a user's config family into a cached storage.
- *
- * All configuration values of the given user are stored in global cache
- * which is available under the global variable self::$config[$uid].
+ * Loads all configuration values of a user's config family into a cached storage.
*
* @param string $uid The user_id
* @param string $cat The category of the configuration value
public function load($uid, $cat);
/**
- * @brief Get a particular user's config variable given the category name
+ * Get a particular user's config variable given the category name
* ($family) and a key.
*
- * Get a particular user's config value from the given category ($family)
- * and the $key from a cached storage in self::$config[$uid].
- *
* @param string $uid The user_id
* @param string $cat The category of the configuration value
* @param string $k The configuration key to query
public function get($uid, $cat, $k, $default_value = null, $refresh = false);
/**
- * @brief Sets a configuration value for a user
- *
* Stores a config value ($value) in the category ($family) under the key ($key)
* for the user_id $uid.
*
public function set($uid, $cat, $k, $value);
/**
- * @brief Deletes the given key from the users's configuration.
- *
- * Removes the configured value from the stored cache in self::$config[$uid]
+ * Removes the configured value from the stored cache
* and removes it from the database.
*
* @param string $uid The user_id
$this->configCache = $configCache;
}
+ /**
+ * {@inheritdoc}
+ */
public function load($cat = "config")
{
// We don't preload "system" anymore.
DBA::close($configs);
}
+ /**
+ * {@inheritdoc}
+ */
public function get($cat, $k, $default_value = null, $refresh = false)
{
if (!$refresh) {
return $default_value;
}
+ /**
+ * {@inheritdoc}
+ */
public function set($cat, $k, $value)
{
// We store our setting values in a string variable.
return $result;
}
+ /**
+ * {@inheritdoc}
+ */
public function delete($cat, $k)
{
if (isset($this->cache[$cat][$k])) {
$this->configCache = $configCache;
}
+ /**
+ * {@inheritdoc}
+ */
public function load($uid, $cat)
{
$pconfigs = DBA::select('pconfig', ['v', 'k'], ['cat' => $cat, 'uid' => $uid]);
DBA::close($pconfigs);
}
+ /**
+ * {@inheritdoc}
+ */
public function get($uid, $cat, $k, $default_value = null, $refresh = false)
{
if (!$refresh) {
}
}
+ /**
+ * {@inheritdoc}
+ */
public function set($uid, $cat, $k, $value)
{
// We store our setting values in a string variable.
return $result;
}
+ /**
+ * {@inheritdoc}
+ */
public function delete($uid, $cat, $k)
{
$this->configCache->deleteP($uid, $cat, $k);
$this->load();
}
+ /**
+ * {@inheritdoc}
+ */
public function load($family = 'config')
{
if ($this->config_loaded) {
$this->config_loaded = true;
}
+ /**
+ * {@inheritdoc}
+ */
public function get($cat, $k, $default_value = null, $refresh = false)
{
if ($refresh) {
return $return;
}
+ /**
+ * {@inheritdoc}
+ */
public function set($cat, $k, $value)
{
// We store our setting values as strings.
return true;
}
+ /**
+ * {@inheritdoc}
+ */
public function delete($cat, $k)
{
$this->configCache->delete($cat, $k);
}
}
+ /**
+ * {@inheritdoc}
+ */
public function load($uid, $family)
{
if ($this->config_loaded) {
$this->config_loaded = true;
}
+ /**
+ * {@inheritdoc}
+ */
public function get($uid, $cat, $k, $default_value = null, $refresh = false)
{
if (!$this->config_loaded) {
return $this->configCache->getP($uid, $cat, $k, $default_value);;
}
+ /**
+ * {@inheritdoc}
+ */
public function set($uid, $cat, $k, $value)
{
if (!$this->config_loaded) {
return true;
}
+ /**
+ * {@inheritdoc}
+ */
public function delete($uid, $cat, $k)
{
if (!$this->config_loaded) {