]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Config.php
Merge pull request #5394 from MrPetovan/bug/fix-config-set-return-value
[friendica.git] / src / Core / Config.php
index b327eb133ff9e1233d247bed46605eaff22bf82c..b686b63e5291e1be0b89b7a24fe7758235f60192 100644 (file)
@@ -30,7 +30,7 @@ class Config extends BaseObject
        public static function init()
        {
                // Database isn't ready or populated yet
-               if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) {
+               if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
                        return;
                }
 
@@ -54,7 +54,7 @@ class Config extends BaseObject
        public static function load($family = "config")
        {
                // Database isn't ready or populated yet
-               if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) {
+               if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
                        return;
                }
 
@@ -87,7 +87,7 @@ class Config extends BaseObject
        public static function get($family, $key, $default_value = null, $refresh = false)
        {
                // Database isn't ready or populated yet, fallback to file config
-               if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) {
+               if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
                        return self::getApp()->getConfigValue($family, $key, $default_value);
                }
 
@@ -110,12 +110,12 @@ class Config extends BaseObject
         * @param string $key    The configuration key to set
         * @param mixed  $value  The value to store
         *
-        * @return mixed Stored $value or false if the database update failed
+        * @return bool Operation success
         */
        public static function set($family, $key, $value)
        {
                // Database isn't ready or populated yet
-               if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) {
+               if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
                        return false;
                }
 
@@ -140,7 +140,7 @@ class Config extends BaseObject
        public static function delete($family, $key)
        {
                // Database isn't ready or populated yet
-               if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) {
+               if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
                        return false;
                }