]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/PConfig.php
Remove deprecated App::getHostName() - process methods to DI::baseUrl()->getHostName()
[friendica.git] / src / Core / PConfig.php
index 49e34720f55aa47785b900214a6e5fe5ce37808e..06b0140097697538226f58341e1c17d859d6e683 100644 (file)
@@ -8,6 +8,8 @@
  */
 namespace Friendica\Core;
 
+use Friendica\DI;
+
 /**
  * @brief Management of user configuration storage
  * Note:
@@ -17,21 +19,6 @@ namespace Friendica\Core;
  */
 class PConfig
 {
-       /**
-        * @var Config\PConfiguration
-        */
-       private static $config;
-
-       /**
-        * Initialize the config with only the cache
-        *
-        * @param Config\PConfiguration $config The configuration cache
-        */
-       public static function init(Config\PConfiguration $config)
-       {
-               self::$config = $config;
-       }
-
        /**
         * @brief Loads all configuration values of a user's config family into a cached storage.
         *
@@ -42,7 +29,7 @@ class PConfig
         */
        public static function load(int $uid, string $cat)
        {
-               self::$config->load($uid, $cat);
+               DI::pConfig()->load($uid, $cat);
        }
 
        /**
@@ -59,7 +46,7 @@ class PConfig
         */
        public static function get(int $uid, string $cat, string $key, $default_value = null, bool $refresh = false)
        {
-               return self::$config->get($uid, $cat, $key, $default_value, $refresh);
+               return DI::pConfig()->get($uid, $cat, $key, $default_value, $refresh);
        }
 
        /**
@@ -74,7 +61,7 @@ class PConfig
         */
        public static function set(int $uid, string $cat, string $key, $value)
        {
-               return self::$config->set($uid, $cat, $key, $value);
+               return DI::pConfig()->set($uid, $cat, $key, $value);
        }
 
        /**
@@ -88,6 +75,6 @@ class PConfig
         */
        public static function delete(int $uid, string $cat, string $key)
        {
-               return self::$config->delete($uid, $cat, $key);
+               return DI::pConfig()->delete($uid, $cat, $key);
        }
 }