*/
public function load(int $uid, string $cat = 'config')
{
- // Don't load the whole configuration twice
- if (!empty($this->config_loaded[$uid])) {
+ // Don't load the whole configuration twice or with invalid uid
+ if (!$uid || !empty($this->config_loaded[$uid])) {
return;
}
*/
public function get(int $uid, string $cat, string $key, $default_value = null, bool $refresh = false)
{
+ if (!$uid) {
+ return $default_value;
+ }
+
if (empty($this->config_loaded[$uid])) {
$this->load($uid);
} elseif ($refresh) {
*/
public function set(int $uid, string $cat, string $key, $value)
{
+ if (!$uid) {
+ return false;
+ }
+
if (empty($this->config_loaded[$uid])) {
$this->load($uid);
}
*/
public function delete(int $uid, string $cat, string $key)
{
+ if (!$uid) {
+ return false;
+ }
+
if (empty($this->config_loaded[$uid])) {
$this->load($uid);
}