Continued: (#5508)
- `App` is now "imported" to avoid having \Friendica\App::* everywhere
This commit is contained in:
parent
1e20fd84f7
commit
592190892c
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
namespace Friendica\Core;
|
namespace Friendica\Core;
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\BaseObject;
|
use Friendica\BaseObject;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ class Config extends BaseObject
|
||||||
public static function init()
|
public static function init()
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ class Config extends BaseObject
|
||||||
public static function load($family = "config")
|
public static function load($family = "config")
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +88,7 @@ class Config extends BaseObject
|
||||||
public static function get($family, $key, $default_value = null, $refresh = false)
|
public static function get($family, $key, $default_value = null, $refresh = false)
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet, fallback to file config
|
// Database isn't ready or populated yet, fallback to file config
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return self::getApp()->getConfigValue($family, $key, $default_value);
|
return self::getApp()->getConfigValue($family, $key, $default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +116,7 @@ class Config extends BaseObject
|
||||||
public static function set($family, $key, $value)
|
public static function set($family, $key, $value)
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +141,7 @@ class Config extends BaseObject
|
||||||
public static function delete($family, $key)
|
public static function delete($family, $key)
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
namespace Friendica\Core;
|
namespace Friendica\Core;
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\BaseObject;
|
use Friendica\BaseObject;
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
@ -29,7 +30,7 @@ class PConfig extends BaseObject
|
||||||
public static function init($uid)
|
public static function init($uid)
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ class PConfig extends BaseObject
|
||||||
public static function load($uid, $family)
|
public static function load($uid, $family)
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +84,7 @@ class PConfig extends BaseObject
|
||||||
public static function get($uid, $family, $key, $default_value = null, $refresh = false)
|
public static function get($uid, $family, $key, $default_value = null, $refresh = false)
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +113,7 @@ class PConfig extends BaseObject
|
||||||
public static function set($uid, $family, $key, $value)
|
public static function set($uid, $family, $key, $value)
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +139,7 @@ class PConfig extends BaseObject
|
||||||
public static function delete($uid, $family, $key)
|
public static function delete($uid, $family, $key)
|
||||||
{
|
{
|
||||||
// Database isn't ready or populated yet
|
// Database isn't ready or populated yet
|
||||||
if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
|
if (!(self::getApp()->mode & App::MODE_DBCONFIGAVAILABLE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue