mirror of
https://github.com/friendica/friendica
synced 2025-04-28 00:30:10 +00:00
Creating Friendica\App\Mode for encapsulating the App Mode
This commit is contained in:
parent
3c7d41c388
commit
065340dc32
9 changed files with 128 additions and 89 deletions
|
@ -31,7 +31,7 @@ class Config extends BaseObject
|
|||
public static function init()
|
||||
{
|
||||
// Database isn't ready or populated yet
|
||||
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||
if (!App\Mode::has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ class Config extends BaseObject
|
|||
public static function load($family = "config")
|
||||
{
|
||||
// Database isn't ready or populated yet
|
||||
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||
if (!App\Mode::has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -88,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 & App::MODE_DBCONFIGAVAILABLE)) {
|
||||
if (!App\Mode::has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
return self::getApp()->getConfigValue($family, $key, $default_value);
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ class Config extends BaseObject
|
|||
public static function set($family, $key, $value)
|
||||
{
|
||||
// Database isn't ready or populated yet
|
||||
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||
if (!App\Mode::has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ class Config extends BaseObject
|
|||
public static function delete($family, $key)
|
||||
{
|
||||
// Database isn't ready or populated yet
|
||||
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||
if (!App\Mode::has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue