]> git.mxchange.org Git - friendica.git/blob - src/Core/Config.php
Move Config::get() to DI::config()->get()
[friendica.git] / src / Core / Config.php
1 <?php
2 /**
3  * System Configuration Class
4  *
5  * @file include/Core/Config.php
6  *
7  * Contains the class with methods for system configuration
8  */
9 namespace Friendica\Core;
10
11 use Friendica\DI;
12
13 /**
14  * Arbitrary system configuration storage
15  *
16  * Note:
17  * If we ever would decide to return exactly the variable type as entered,
18  * we will have fun with the additional features. :-)
19  */
20 class Config
21 {
22         /**
23          * Stores a config value ($value) in the category ($cat) under the key ($key)
24          *
25          * Note: Please do not store booleans - convert to 0/1 integer values!
26          *
27          * @param string $cat The category of the configuration value
28          * @param string $key    The configuration key to set
29          * @param mixed  $value  The value to store
30          *
31          * @return bool Operation success
32          */
33         public static function set($cat, $key, $value)
34         {
35                 return DI::config()->set($cat, $key, $value);
36         }
37
38         /**
39          * Deletes the given key from the system configuration.
40          *
41          * @param string $cat The category of the configuration value
42          * @param string $key    The configuration key to delete
43          *
44          * @return bool
45          */
46         public static function delete($cat, $key)
47         {
48                 return DI::config()->delete($cat, $key);
49         }
50 }