]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Config.php
Remove unused killme()
[friendica.git] / src / Core / Config.php
index 44556a6017dcfda80cac4b9b9b0b9c4ab556209b..6864cb78d6004b264b240406ae7e1bd40ba98c34 100644 (file)
@@ -8,6 +8,8 @@
  */
 namespace Friendica\Core;
 
+use Friendica\DI;
+
 /**
  * @brief Arbitrary system configuration storage
  *
@@ -17,21 +19,6 @@ namespace Friendica\Core;
  */
 class Config
 {
-       /**
-        * @var Config\Configuration
-        */
-       private static $config;
-
-       /**
-        * Initialize the config
-        *
-        * @param Config\Configuration $config
-        */
-       public static function init(Config\Configuration $config)
-       {
-               self::$config = $config;
-       }
-
        /**
         * @brief Loads all configuration values of family into a cached storage.
         *
@@ -41,15 +28,13 @@ class Config
         */
        public static function load($cat = "config")
        {
-               self::$config->load($cat);
+               DI::config()->load($cat);
        }
 
        /**
         * @brief Get a particular user's config variable given the category name
         * ($family) and a key.
         *
-        * Note: Please do not store booleans - convert to 0/1 integer values!
-        *
         * @param string  $cat        The category of the configuration value
         * @param string  $key           The configuration key to query
         * @param mixed   $default_value optional, The value to return if key is not set (default: null)
@@ -59,7 +44,7 @@ class Config
         */
        public static function get($cat, $key, $default_value = null, $refresh = false)
        {
-               return self::$config->get($cat, $key, $default_value, $refresh);
+               return DI::config()->get($cat, $key, $default_value, $refresh);
        }
 
        /**
@@ -67,6 +52,8 @@ class Config
         *
         * Stores a config value ($value) in the category ($cat) under the key ($key)
         *
+        * Note: Please do not store booleans - convert to 0/1 integer values!
+        *
         * @param string $cat The category of the configuration value
         * @param string $key    The configuration key to set
         * @param mixed  $value  The value to store
@@ -75,7 +62,7 @@ class Config
         */
        public static function set($cat, $key, $value)
        {
-               return self::$config->set($cat, $key, $value);
+               return DI::config()->set($cat, $key, $value);
        }
 
        /**
@@ -88,6 +75,6 @@ class Config
         */
        public static function delete($cat, $key)
        {
-               return self::$config->delete($cat, $key);
+               return DI::config()->delete($cat, $key);
        }
 }