- $a = get_app();
-
- if (!$refresh) {
- // Looking if the whole family isn't set
- if (isset($a->config[$uid][$family])) {
- if ($a->config[$uid][$family] === '!<unset>!') {
- return $default_value;
- }
- }
-
- if (isset($a->config[$uid][$family][$key])) {
- if ($a->config[$uid][$family][$key] === '!<unset>!') {
- return $default_value;
- }
- return $a->config[$uid][$family][$key];
- }
- }
-
- $pconfig = dba::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $family, 'k' => $key]);
- if (DBM::is_result($pconfig)) {
- $val = (preg_match("|^a:[0-9]+:{.*}$|s", $pconfig['v']) ? unserialize($pconfig['v']) : $pconfig['v']);
- $a->config[$uid][$family][$key] = $val;
- self::$in_db[$uid][$family][$key] = true;
-
- return $val;
- } else {
- $a->config[$uid][$family][$key] = '!<unset>!';
- self::$in_db[$uid][$family][$key] = false;
-
- return $default_value;
- }
+ return self::$config->get($uid, $cat, $key, $default_value, $refresh);