mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-09 16:44:26 +02:00
Bugfixings in Config
- replaced usage of "!<unset>!" with null-returns - fixed bool settings (0/1) - fixed overriding config-values - fixed basepath problems
This commit is contained in:
parent
2d91d5c3d9
commit
8c3aebc376
24 changed files with 175 additions and 157 deletions
|
@ -52,8 +52,6 @@ class PreloadPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfig
|
|||
$value = $pconfig['v'];
|
||||
if (isset($value) && $value !== '') {
|
||||
$return[$pconfig['cat']][$pconfig['k']] = $value;
|
||||
} else {
|
||||
$return[$pconfig['cat']][$pconfig['k']] = '!<unset>!';
|
||||
}
|
||||
}
|
||||
DBA::close($pconfigs);
|
||||
|
@ -69,7 +67,7 @@ class PreloadPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfig
|
|||
public function get($uid, $cat, $key)
|
||||
{
|
||||
if (!$this->isConnected()) {
|
||||
return '!<unset>!';
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!$this->isLoaded($uid, $cat, $key)) {
|
||||
|
@ -85,7 +83,7 @@ class PreloadPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfig
|
|||
return $value;
|
||||
}
|
||||
}
|
||||
return '!<unset>!';
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,9 +110,7 @@ class PreloadPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfig
|
|||
// manage array value
|
||||
$dbvalue = is_array($value) ? serialize($value) : $value;
|
||||
|
||||
$result = DBA::update('pconfig', ['v' => $dbvalue], ['uid' => $uid, 'cat' => $cat, 'k' => $key], true);
|
||||
|
||||
return $result;
|
||||
return DBA::update('pconfig', ['v' => $dbvalue], ['uid' => $uid, 'cat' => $cat, 'k' => $key], true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -130,9 +126,7 @@ class PreloadPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfig
|
|||
$this->load($uid, $cat);
|
||||
}
|
||||
|
||||
$result = DBA::delete('pconfig', ['uid' => $uid, 'cat' => $cat, 'k' => $key]);
|
||||
|
||||
return $result;
|
||||
return DBA::delete('pconfig', ['uid' => $uid, 'cat' => $cat, 'k' => $key]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue