mirror of
https://github.com/friendica/friendica
synced 2025-04-28 00:30:10 +00:00
Prevent infinite loops with Config when App is in install mode
This commit is contained in:
parent
46b34574d9
commit
fd7179ee6c
3 changed files with 55 additions and 5 deletions
|
@ -29,6 +29,11 @@ class Config extends BaseObject
|
|||
|
||||
public static function init()
|
||||
{
|
||||
// Database isn't ready or populated yet
|
||||
if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (self::getApp()->getConfigValue('system', 'config_adapter') == 'preload') {
|
||||
self::$adapter = new Config\PreloadConfigAdapter();
|
||||
} else {
|
||||
|
@ -48,6 +53,11 @@ 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) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty(self::$adapter)) {
|
||||
self::init();
|
||||
}
|
||||
|
@ -76,6 +86,11 @@ 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) {
|
||||
return self::getApp()->getConfigValue($family, $key, $default_value);
|
||||
}
|
||||
|
||||
if (empty(self::$adapter)) {
|
||||
self::init();
|
||||
}
|
||||
|
@ -99,6 +114,11 @@ class Config extends BaseObject
|
|||
*/
|
||||
public static function set($family, $key, $value)
|
||||
{
|
||||
// Database isn't ready or populated yet
|
||||
if (self::getApp()->mode === \Friendica\App::MODE_INSTALL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty(self::$adapter)) {
|
||||
self::init();
|
||||
}
|
||||
|
@ -119,6 +139,11 @@ 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) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty(self::$adapter)) {
|
||||
self::init();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue