X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FConfig.php;h=5e162a3fa4e36536c9dbb562071b669099d7396a;hb=c42c121e517a7925439a33006f1e355a0f1dc9cc;hp=9a270511c50886ffbc52db10135a37e6eb945c85;hpb=8d07a69bba06f8cb8e63d46edcbb53fea34aa6d1;p=friendica.git diff --git a/src/Core/Config.php b/src/Core/Config.php index 9a270511c5..5e162a3fa4 100644 --- a/src/Core/Config.php +++ b/src/Core/Config.php @@ -49,7 +49,7 @@ class Config $a = get_app(); - $r = dba::select('config', array('v', 'k'), array('cat' => $family)); + $r = dba::select('config', ['v', 'k'], ['cat' => $family]); while ($rr = dba::fetch($r)) { $k = $rr['k']; if ($family === 'config') { @@ -97,10 +97,10 @@ class Config } } - $ret = dba::select('config', array('v'), array('cat' => $family, 'k' => $key), array('limit' => 1)); - if (DBM::is_result($ret)) { + $config = dba::selectFirst('config', ['v'], ['cat' => $family, 'k' => $key]); + if (DBM::is_result($config)) { // manage array value - $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret['v']) ? unserialize($ret['v']) : $ret['v']); + $val = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']); // Assign the value from the database to the cache self::$cache[$family][$key] = $val; @@ -161,7 +161,7 @@ class Config // manage array value $dbvalue = (is_array($value) ? serialize($value) : $dbvalue); - $ret = dba::update('config', array('v' => $dbvalue), array('cat' => $family, 'k' => $key), true); + $ret = dba::update('config', ['v' => $dbvalue], ['cat' => $family, 'k' => $key], true); if ($ret) { self::$in_db[$family][$key] = true; @@ -188,7 +188,7 @@ class Config unset(self::$in_db[$family][$key]); } - $ret = dba::delete('config', array('cat' => $family, 'k' => $key)); + $ret = dba::delete('config', ['cat' => $family, 'k' => $key]); return $ret; }