X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FConfig.php;h=f71522d068b9c63e6dbc4a7cd158fcf4d0a7df29;hb=9fbaaa1481a609563e00a40db64bdce5e02c5524;hp=b327eb133ff9e1233d247bed46605eaff22bf82c;hpb=fd7179ee6cbc154af0db9d41114bc671deeba08c;p=friendica.git diff --git a/src/Core/Config.php b/src/Core/Config.php index b327eb133f..f71522d068 100644 --- a/src/Core/Config.php +++ b/src/Core/Config.php @@ -8,6 +8,7 @@ */ namespace Friendica\Core; +use Friendica\App; use Friendica\BaseObject; use Friendica\Core\Config; @@ -30,7 +31,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 & App::MODE_DBCONFIGAVAILABLE)) { return; } @@ -54,7 +55,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 & App::MODE_DBCONFIGAVAILABLE)) { return; } @@ -87,7 +88,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 & App::MODE_DBCONFIGAVAILABLE)) { return self::getApp()->getConfigValue($family, $key, $default_value); } @@ -110,12 +111,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 & App::MODE_DBCONFIGAVAILABLE)) { return false; } @@ -140,7 +141,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 & App::MODE_DBCONFIGAVAILABLE)) { return false; }