public static function init()
{
+ // Database isn't ready or populated yet
+ if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
+ return;
+ }
+
if (self::getApp()->getConfigValue('system', 'config_adapter') == 'preload') {
self::$adapter = new Config\PreloadConfigAdapter();
} else {
*/
public static function load($family = "config")
{
+ // Database isn't ready or populated yet
+ if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
+ return;
+ }
+
if (empty(self::$adapter)) {
self::init();
}
*/
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_DBCONFIGAVAILABLE)) {
+ return self::getApp()->getConfigValue($family, $key, $default_value);
+ }
+
if (empty(self::$adapter)) {
self::init();
}
* @param string $key The configuration key to set
* @param mixed $value The value to store
*
- * @return mixed Stored $value or false if the database update failed
+ * @return bool Operation success
*/
public static function set($family, $key, $value)
{
+ // Database isn't ready or populated yet
+ if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
+ return false;
+ }
+
if (empty(self::$adapter)) {
self::init();
}
*/
public static function delete($family, $key)
{
+ // Database isn't ready or populated yet
+ if (!(self::getApp()->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
+ return false;
+ }
+
if (empty(self::$adapter)) {
self::init();
}