*/
class PreloadPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfigAdapter
{
- private $config_loaded = false;
+ /**
+ * @var array true if config for user is loaded
+ */
+ private $config_loaded;
/**
* @param int $uid The UID of the current user
if (isset($uid)) {
$this->load($uid, 'config');
}
+
+ $this->config_loaded = [];
}
/**
{
$return = [];
- if ($this->config_loaded) {
+ if (empty($uid)) {
return $return;
}
- if (empty($uid)) {
+ if ($this->isLoaded($uid, $cat, null)) {
return $return;
}
}
DBA::close($pconfigs);
- $this->config_loaded = true;
+ $this->config_loaded[$uid] = true;
return $return;
}
return '!<unset>!';
}
- if (!$this->config_loaded) {
+ if (!$this->isLoaded($uid, $cat, $key)) {
$this->load($uid, $cat);
}
return false;
}
- if (!$this->config_loaded) {
+ if ($this->isLoaded($uid, $cat, $key)) {
$this->load($uid, $cat);
}
// We store our setting values as strings.
return false;
}
- if (!$this->config_loaded) {
+ if (!$this->isLoaded($uid, $cat, $key)) {
$this->load($uid, $cat);
}
return false;
}
- return $this->config_loaded;
+ return isset($this->config_loaded[$uid]) && $this->config_loaded[$uid];
}
}