mirror of
https://github.com/friendica/friendica
synced 2025-04-28 01:10:12 +00:00
Rework App modes
- Replace App mode constants with capability-based flags - Add App->isInstallMode() - Add file config fallback in (P)Config abstraction - Removed logger disabling code
This commit is contained in:
parent
d487c399dd
commit
cd9b864045
12 changed files with 74 additions and 79 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ 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) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue