$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') {
}
}
- $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;
// 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;
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;
}