2019-02-10 13:52:21 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Core\Config;
|
|
|
|
|
2019-07-02 18:42:47 -04:00
|
|
|
use Friendica\Model;
|
|
|
|
|
2019-02-10 13:52:21 -05:00
|
|
|
/**
|
|
|
|
* This class is responsible for all system-wide configuration values in Friendica
|
|
|
|
* There are two types of storage
|
2019-07-02 18:42:47 -04:00
|
|
|
* - The Config-Files (loaded into the FileCache @see Cache\ConfigCache )
|
|
|
|
* - The Config-DB-Table (per Config-DB-model @see Model\Config\Config )
|
2019-02-10 13:52:21 -05:00
|
|
|
*/
|
2019-07-02 18:42:47 -04:00
|
|
|
abstract class Configuration
|
2019-02-10 13:52:21 -05:00
|
|
|
{
|
|
|
|
/**
|
2019-07-12 16:38:50 -04:00
|
|
|
* @var Cache\ConfigCache
|
2019-02-10 13:52:21 -05:00
|
|
|
*/
|
2019-07-02 18:42:47 -04:00
|
|
|
protected $configCache;
|
2019-02-10 13:52:21 -05:00
|
|
|
|
|
|
|
/**
|
2019-07-02 18:42:47 -04:00
|
|
|
* @var Model\Config\Config
|
2019-02-10 13:52:21 -05:00
|
|
|
*/
|
2019-07-02 18:42:47 -04:00
|
|
|
protected $configModel;
|
2019-02-10 13:52:21 -05:00
|
|
|
|
|
|
|
/**
|
2019-07-02 18:42:47 -04:00
|
|
|
* @param Cache\ConfigCache $configCache The configuration cache (based on the config-files)
|
|
|
|
* @param Model\Config\Config $configModel The configuration model
|
2019-02-10 13:52:21 -05:00
|
|
|
*/
|
2019-07-02 18:42:47 -04:00
|
|
|
public function __construct(Cache\ConfigCache $configCache, Model\Config\Config $configModel)
|
2019-02-10 13:52:21 -05:00
|
|
|
{
|
|
|
|
$this->configCache = $configCache;
|
2019-07-02 18:42:47 -04:00
|
|
|
$this->configModel = $configModel;
|
2019-02-10 13:52:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-07-14 16:26:36 -04:00
|
|
|
* Returns the Config Cache
|
|
|
|
*
|
|
|
|
* @return Cache\ConfigCache
|
2019-02-10 13:52:21 -05:00
|
|
|
*/
|
|
|
|
public function getCache()
|
|
|
|
{
|
|
|
|
return $this->configCache;
|
|
|
|
}
|
|
|
|
|
2019-07-02 18:42:47 -04:00
|
|
|
abstract public function load(string $cat = 'config');
|
|
|
|
abstract public function get(string $cat, string $key, $default_value = null, bool $refresh = false);
|
|
|
|
abstract public function set(string $cat, string $key, $value);
|
|
|
|
abstract public function delete(string $cat, string $key);
|
2019-02-10 13:52:21 -05:00
|
|
|
}
|