Browse Source

bugfixing adapter get() in case of no connection

tags/2019.03^2
Philipp Holzer 1 year ago
parent
commit
0a318925a4
No known key found for this signature in database GPG Key ID: 517BE60E2CE5C8A5
6 changed files with 10 additions and 10 deletions
  1. +3
    -3
      src/Core/Config/Adapter/IConfigAdapter.php
  2. +2
    -2
      src/Core/Config/Adapter/IPConfigAdapter.php
  3. +1
    -1
      src/Core/Config/Adapter/JITPConfigAdapter.php
  4. +1
    -1
      src/Core/Config/Adapter/PreloadConfigAdapter.php
  5. +1
    -1
      src/Core/Config/Adapter/PreloadPConfigAdapter.php
  6. +2
    -2
      src/Core/Logger.php

+ 3
- 3
src/Core/Config/Adapter/IConfigAdapter.php View File

@@ -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


+ 2
- 2
src/Core/Config/Adapter/IPConfigAdapter.php View File

@@ -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


+ 1
- 1
src/Core/Config/Adapter/JITPConfigAdapter.php View File

@@ -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]);


+ 1
- 1
src/Core/Config/Adapter/PreloadConfigAdapter.php View File

@@ -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]);


+ 1
- 1
src/Core/Config/Adapter/PreloadPConfigAdapter.php View File

@@ -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) {


+ 2
- 2
src/Core/Logger.php View File

@@ -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;
}


Loading…
Cancel
Save