2018-03-24 18:39:13 +00:00
|
|
|
<?php
|
|
|
|
|
2019-02-10 19:52:21 +01:00
|
|
|
namespace Friendica\Core\Config\Adapter;
|
2018-03-24 18:39:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
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-11 23:45:08 +01:00
|
|
|
* Loads all configuration values and returns the loaded category as an array.
|
2018-03-24 18:39:13 +00:00
|
|
|
*
|
|
|
|
* @param string $cat The category of the configuration values to load
|
|
|
|
*
|
2019-02-10 19:52:21 +01:00
|
|
|
* @return array
|
2018-03-24 18:39:13 +00:00
|
|
|
*/
|
|
|
|
public function load($cat = "config");
|
|
|
|
|
|
|
|
/**
|
2019-02-11 23:45:08 +01:00
|
|
|
* Get a particular system-wide config variable given the category name
|
2018-03-24 18:39:13 +00:00
|
|
|
* ($family) and a key.
|
|
|
|
*
|
2019-02-10 19:52:21 +01:00
|
|
|
* @param string $cat The category of the configuration value
|
|
|
|
* @param string $key The configuration key to query
|
2018-03-24 18:39:13 +00:00
|
|
|
*
|
2019-02-10 19:52:21 +01:00
|
|
|
* @return mixed Stored value or "!<unset>!" if it does not exist
|
2018-03-24 18:39:13 +00:00
|
|
|
*/
|
2019-02-10 19:52:21 +01:00
|
|
|
public function get($cat, $key);
|
2018-03-24 18:39:13 +00:00
|
|
|
|
|
|
|
/**
|
2019-02-11 21:36:26 +01:00
|
|
|
* Stores a config value ($value) in the category ($family) under the key ($key).
|
2018-03-24 18:39:13 +00:00
|
|
|
*
|
|
|
|
* 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
|
2019-02-10 19:52:21 +01:00
|
|
|
* @param string $key The configuration key to set
|
2019-01-06 16:06:53 -05:00
|
|
|
* @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
|
|
|
*/
|
2019-02-10 19:52:21 +01:00
|
|
|
public function set($cat, $key, $value);
|
2018-03-24 18:39:13 +00:00
|
|
|
|
|
|
|
/**
|
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
|
2019-02-10 19:52:21 +01:00
|
|
|
* @param string $key The configuration key to delete
|
2018-03-24 18:39:13 +00:00
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2019-02-10 19:52:21 +01:00
|
|
|
public function delete($cat, $key);
|
2019-02-07 20:44:03 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks, if the current adapter is connected to the backend
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isConnected();
|
2019-02-11 21:36:26 +01:00
|
|
|
|
|
|
|
/**
|
2019-02-11 23:45:08 +01:00
|
|
|
* Checks, if a config key ($key) in the category ($cat) is already loaded.
|
2019-02-11 21:36:26 +01:00
|
|
|
*
|
|
|
|
* @param string $cat The configuration category
|
|
|
|
* @param string $key The configuration key
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isLoaded($cat, $key);
|
2018-03-24 18:39:13 +00:00
|
|
|
}
|