Improve dba::selectFirst calls

- Fix remaining $r[0] references
- Rename $r to meaningful names
This commit is contained in:
Hypolite Petovan 2018-01-11 03:26:30 -05:00
parent 465e1d6a5c
commit 5fc4927764
29 changed files with 228 additions and 250 deletions

View file

@ -97,10 +97,10 @@ class Config
}
}
$ret = dba::selectFirst('config', ['v'], ['cat' => $family, 'k' => $key]);
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;