bugfixing adapter get() in case of no connection

This commit is contained in:
Philipp Holzer 2019-02-11 23:45:08 +01:00
rodzic ad1254c49c
commit 0a318925a4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 517BE60E2CE5C8A5
6 zmienionych plików z 10 dodań i 10 usunięć

Wyświetl plik

@ -9,7 +9,7 @@ namespace Friendica\Core\Config\Adapter;
interface IConfigAdapter
{
/**
* Loads all configuration values into a cached storage.
* Loads all configuration values and returns the loaded category as an array.
*
* @param string $cat The category of the configuration values to load
*
@ -18,7 +18,7 @@ interface IConfigAdapter
public function load($cat = "config");
/**
* Get a particular user's config variable given the category name
* Get a particular system-wide config variable given the category name
* ($family) and a key.
*
* @param string $cat The category of the configuration value
@ -60,7 +60,7 @@ interface IConfigAdapter
public function isConnected();
/**
* Checks, if a config value ($value) in the category ($cat) is already loaded.
* Checks, if a config key ($key) in the category ($cat) is already loaded.
*
* @param string $cat The configuration category
* @param string $key The configuration key

Wyświetl plik

@ -15,7 +15,7 @@ namespace Friendica\Core\Config\Adapter;
interface IPConfigAdapter
{
/**
* Loads all configuration values of a user's config family into a cached storage.
* Loads all configuration values of a user's config family and returns the loaded category as an array.
*
* @param string $uid The user_id
* @param string $cat The category of the configuration value
@ -71,7 +71,7 @@ interface IPConfigAdapter
public function isConnected();
/**
* Checks, if a config value ($value) in the category ($cat) is already loaded for the user_id $uid.
* Checks, if a config key ($key) in the category ($cat) is already loaded for the user_id $uid.
*
* @param string $uid The user_id
* @param string $cat The configuration category

Wyświetl plik

@ -49,7 +49,7 @@ class JITPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfigAdap
public function get($uid, $cat, $key)
{
if (!$this->isConnected()) {
return null;
return '!<unset>!';
}
$pconfig = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $key]);

Wyświetl plik

@ -47,7 +47,7 @@ class PreloadConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAd
public function get($cat, $key)
{
if (!$this->isConnected()) {
return null;
return '!<unset>!';
}
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $key]);

Wyświetl plik

@ -59,7 +59,7 @@ class PreloadPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfig
public function get($uid, $cat, $key)
{
if (!$this->isConnected()) {
return null;
return '!<unset>!';
}
if (!$this->config_loaded) {

Wyświetl plik

@ -68,7 +68,7 @@ class Logger extends BaseObject
*
* @param LoggerInterface $logger The Logger instance of this Application
*/
public static function init($logger)
public static function init(LoggerInterface $logger)
{
self::$logger = $logger;
}
@ -78,7 +78,7 @@ class Logger extends BaseObject
*
* @param LoggerInterface $logger The Logger instance of this Application
*/
public static function setDevLogger($logger)
public static function setDevLogger(LoggerInterface $logger)
{
self::$devLogger = $logger;
}