2018-03-24 18:39:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Core\Config;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2018-09-15 19:28:38 -04:00
|
|
|
* @author Hypolite Petovan <hypolite@mrpetovan.com>
|
2018-03-24 18:39:13 +00:00
|
|
|
*/
|
|
|
|
interface IConfigAdapter
|
|
|
|
{
|
|
|
|
/**
|
2019-02-05 23:42:49 +01:00
|
|
|
* Loads all configuration values into a cached storage.
|
2018-03-24 18:39:13 +00:00
|
|
|
*
|
|
|
|
* @param string $cat The category of the configuration values to load
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function load($cat = "config");
|
|
|
|
|
|
|
|
/**
|
2019-02-05 23:42:49 +01:00
|
|
|
* Get a particular user's config variable given the category name
|
2018-03-24 18:39:13 +00:00
|
|
|
* ($family) and a key.
|
|
|
|
*
|
|
|
|
* @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)
|
|
|
|
* @param boolean $refresh optional, If true the config is loaded from the db and not from the cache (default: false)
|
|
|
|
*
|
|
|
|
* @return mixed Stored value or null if it does not exist
|
|
|
|
*/
|
|
|
|
public function get($cat, $k, $default_value = null, $refresh = false);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stores a config value ($value) in the category ($family) under the key ($key)
|
|
|
|
* for the user_id $uid.
|
|
|
|
*
|
|
|
|
* Note: Please do not store booleans - convert to 0/1 integer values!
|
|
|
|
*
|
2019-01-06 16:06:53 -05:00
|
|
|
* @param string $cat The category of the configuration value
|
|
|
|
* @param string $k The configuration key to set
|
|
|
|
* @param mixed $value The value to store
|
2018-03-24 18:39:13 +00:00
|
|
|
*
|
2018-07-18 02:32:35 -04:00
|
|
|
* @return bool Operation success
|
2018-03-24 18:39:13 +00:00
|
|
|
*/
|
|
|
|
public function set($cat, $k, $value);
|
|
|
|
|
|
|
|
/**
|
2019-02-05 23:42:49 +01:00
|
|
|
* Removes the configured value from the stored cache
|
2018-03-24 18:39:13 +00:00
|
|
|
* and removes it from the database.
|
|
|
|
*
|
|
|
|
* @param string $cat The category of the configuration value
|
|
|
|
* @param string $k The configuration key to delete
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function delete($cat, $k);
|
|
|
|
}
|