mirror of
https://github.com/friendica/friendica
synced 2025-04-26 05:10:11 +00: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
|
@ -35,8 +35,6 @@ class PreloadConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAd
|
|||
$value = $config['v'];
|
||||
if (isset($value) && $value !== '') {
|
||||
$return[$config['cat']][$config['k']] = $value;
|
||||
} else {
|
||||
$return[$config['cat']][$config['k']] = '!<unset>!';
|
||||
}
|
||||
}
|
||||
DBA::close($configs);
|
||||
|
@ -52,7 +50,7 @@ class PreloadConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAd
|
|||
public function get($cat, $key)
|
||||
{
|
||||
if (!$this->isConnected()) {
|
||||
return '!<unset>!';
|
||||
return null;
|
||||
}
|
||||
|
||||
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $key]);
|
||||
|
@ -65,7 +63,7 @@ class PreloadConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAd
|
|||
}
|
||||
}
|
||||
|
||||
return '!<unset>!';
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -89,9 +87,7 @@ class PreloadConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAd
|
|||
// manage array value
|
||||
$dbvalue = is_array($value) ? serialize($value) : $value;
|
||||
|
||||
$result = DBA::update('config', ['v' => $dbvalue], ['cat' => $cat, 'k' => $key], true);
|
||||
|
||||
return $result;
|
||||
return DBA::update('config', ['v' => $dbvalue], ['cat' => $cat, 'k' => $key], true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,9 +99,7 @@ class PreloadConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAd
|
|||
return false;
|
||||
}
|
||||
|
||||
$result = DBA::delete('config', ['cat' => $cat, 'k' => $key]);
|
||||
|
||||
return $result;
|
||||
return DBA::delete('config', ['cat' => $cat, 'k' => $key]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue