X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FPConfig.php;h=2080f716ceb5cfac2b329108cd004535210ecfa3;hb=2a881cc2e71b1677cc9ce98001ae3f157743e542;hp=3b01bceeaf8a916bcd86584b454f98f489f78ada;hpb=fd7179ee6cbc154af0db9d41114bc671deeba08c;p=friendica.git diff --git a/src/Core/PConfig.php b/src/Core/PConfig.php index 3b01bceeaf..2080f716ce 100644 --- a/src/Core/PConfig.php +++ b/src/Core/PConfig.php @@ -8,6 +8,7 @@ */ namespace Friendica\Core; +use Friendica\App; use Friendica\BaseObject; require_once 'include/dba.php'; @@ -28,12 +29,14 @@ class PConfig extends BaseObject public static function init($uid) { + $a = self::getApp(); + // Database isn't ready or populated yet - if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) { + if (!$a->getMode()->has(App\Mode::DBCONFIGAVAILABLE)) { return; } - if (self::getApp()->getConfigValue('system', 'config_adapter') == 'preload') { + if ($a->getConfigValue('system', 'config_adapter') == 'preload') { self::$adapter = new Config\PreloadPConfigAdapter($uid); } else { self::$adapter = new Config\JITPConfigAdapter($uid); @@ -54,7 +57,7 @@ class PConfig extends BaseObject public static function load($uid, $family) { // Database isn't ready or populated yet - if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) { + if (!self::getApp()->getMode()->has(App\Mode::DBCONFIGAVAILABLE)) { return; } @@ -83,7 +86,7 @@ class PConfig extends BaseObject public static function get($uid, $family, $key, $default_value = null, $refresh = false) { // Database isn't ready or populated yet - if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) { + if (!self::getApp()->getMode()->has(App\Mode::DBCONFIGAVAILABLE)) { return; } @@ -107,12 +110,12 @@ class PConfig extends BaseObject * @param string $key The configuration key to set * @param string $value The value to store * - * @return mixed Stored $value or false + * @return bool Operation success */ public static function set($uid, $family, $key, $value) { // Database isn't ready or populated yet - if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) { + if (!self::getApp()->getMode()->has(App\Mode::DBCONFIGAVAILABLE)) { return false; } @@ -138,7 +141,7 @@ class PConfig extends BaseObject public static function delete($uid, $family, $key) { // Database isn't ready or populated yet - if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) { + if (!self::getApp()->getMode()->has(App\Mode::DBCONFIGAVAILABLE)) { return false; }