]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/Configuration.php
759120f557e2860f7c04f13eaccb4a9d5069c31b
[friendica.git] / src / Core / Config / Configuration.php
1 <?php
2
3 namespace Friendica\Core\Config;
4
5 use Friendica\Model;
6
7 /**
8  * This class is responsible for all system-wide configuration values in Friendica
9  * There are two types of storage
10  * - The Config-Files    (loaded into the FileCache @see Cache\ConfigCache )
11  * - The Config-DB-Table (per Config-DB-model @see Model\Config\Config )
12  */
13 abstract class Configuration
14 {
15         /**
16          * @var Cache\ConfigCache
17          */
18         protected $configCache;
19
20         /**
21          * @var Model\Config\Config
22          */
23         protected $configModel;
24
25         /**
26          * @param Cache\ConfigCache  $configCache The configuration cache (based on the config-files)
27          * @param Model\Config\Config $configModel The configuration model
28          */
29         public function __construct(Cache\ConfigCache $configCache, Model\Config\Config $configModel)
30         {
31                 $this->configCache = $configCache;
32                 $this->configModel = $configModel;
33         }
34
35         /**
36          * Returns the Config Cache
37          *
38          * @return Cache\ConfigCache
39          */
40         public function getCache()
41         {
42                 return $this->configCache;
43         }
44
45         abstract public function load(string $cat = 'config');
46         abstract public function get(string $cat, string $key, $default_value = null, bool $refresh = false);
47         abstract public function set(string $cat, string $key, $value);
48         abstract public function delete(string $cat, string $key);
49 }