Shorten "Configuration" to "Config" again, since the Wrapper is gone

This commit is contained in:
Philipp Holzer 2020-01-19 21:29:36 +01:00
parent 21640ec5d8
commit cb80108957
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
53 changed files with 183 additions and 179 deletions

View File

@ -136,26 +136,26 @@ namespace Friendica\Addon\samplestorage;
use Friendica\Model\Storage\IStorage; use Friendica\Model\Storage\IStorage;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\L10n; use Friendica\Core\L10n;
class SampleStorageBackend implements IStorage class SampleStorageBackend implements IStorage
{ {
const NAME = 'Sample Storage'; const NAME = 'Sample Storage';
/** @var IConfiguration */ /** @var IConfig */
private $config; private $config;
/** @var L10n */ /** @var L10n */
private $l10n; private $l10n;
/** /**
* SampleStorageBackend constructor. * SampleStorageBackend constructor.
* @param IConfiguration $config The configuration of Friendica * @param IConfig $config The configuration of Friendica
* *
* You can add here every dynamic class as dependency you like and add them to a private field * You can add here every dynamic class as dependency you like and add them to a private field
* Friendica automatically creates these classes and passes them as argument to the constructor * Friendica automatically creates these classes and passes them as argument to the constructor
*/ */
public function __construct(IConfiguration $config, L10n $l10n) public function __construct(IConfig $config, L10n $l10n)
{ {
$this->config = $config; $this->config = $config;
$this->l10n = $l10n; $this->l10n = $l10n;

View File

@ -9,7 +9,7 @@ use Friendica\App\Arguments;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\App\Authentication; use Friendica\App\Authentication;
use Friendica\Core\Config\Cache\ConfigCache; use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\IPConfiguration; use Friendica\Core\Config\IPConfiguration;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
@ -83,7 +83,7 @@ class App
private $currentMobileTheme; private $currentMobileTheme;
/** /**
* @var IConfiguration The config * @var IConfig The config
*/ */
private $config; private $config;
@ -145,7 +145,7 @@ class App
/** /**
* @param Database $database The Friendica Database * @param Database $database The Friendica Database
* @param IConfiguration $config The Configuration * @param IConfig $config The Configuration
* @param App\Mode $mode The mode of this Friendica app * @param App\Mode $mode The mode of this Friendica app
* @param BaseURL $baseURL The full base URL of this Friendica app * @param BaseURL $baseURL The full base URL of this Friendica app
* @param LoggerInterface $logger The current app logger * @param LoggerInterface $logger The current app logger
@ -155,7 +155,7 @@ class App
* @param Core\Process $process The process methods * @param Core\Process $process The process methods
* @param IPConfiguration $pConfig Personal configuration * @param IPConfiguration $pConfig Personal configuration
*/ */
public function __construct(Database $database, IConfiguration $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, Core\Process $process, IPConfiguration $pConfig) public function __construct(Database $database, IConfig $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, Core\Process $process, IPConfiguration $pConfig)
{ {
$this->database = $database; $this->database = $database;
$this->config = $config; $this->config = $config;

View File

@ -8,7 +8,7 @@ namespace Friendica\App;
use Exception; use Exception;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\IPConfiguration; use Friendica\Core\Config\IPConfiguration;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Session; use Friendica\Core\Session;
@ -30,7 +30,7 @@ use Psr\Log\LoggerInterface;
*/ */
class Authentication class Authentication
{ {
/** @var IConfiguration */ /** @var IConfig */
private $config; private $config;
/** @var App\Mode */ /** @var App\Mode */
private $mode; private $mode;
@ -52,17 +52,17 @@ class Authentication
/** /**
* Authentication constructor. * Authentication constructor.
* *
* @param IConfiguration $config * @param IConfig $config
* @param App\Mode $mode * @param App\Mode $mode
* @param App\BaseURL $baseUrl * @param App\BaseURL $baseUrl
* @param L10n $l10n * @param L10n $l10n
* @param Database $dba * @param Database $dba
* @param LoggerInterface $logger * @param LoggerInterface $logger
* @param User\Cookie $cookie * @param User\Cookie $cookie
* @param Session\ISession $session * @param Session\ISession $session
* @param IPConfiguration $pConfig * @param IPConfiguration $pConfig
*/ */
public function __construct(IConfiguration $config, App\Mode $mode, App\BaseURL $baseUrl, L10n $l10n, Database $dba, LoggerInterface $logger, User\Cookie $cookie, Session\ISession $session, IPConfiguration $pConfig) public function __construct(IConfig $config, App\Mode $mode, App\BaseURL $baseUrl, L10n $l10n, Database $dba, LoggerInterface $logger, User\Cookie $cookie, Session\ISession $session, IPConfiguration $pConfig)
{ {
$this->config = $config; $this->config = $config;
$this->mode = $mode; $this->mode = $mode;

View File

@ -2,7 +2,7 @@
namespace Friendica\App; namespace Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -37,7 +37,7 @@ class BaseURL
/** /**
* The Friendica Config * The Friendica Config
* *
* @var IConfiguration * @var IConfig
*/ */
private $config; private $config;
@ -253,10 +253,10 @@ class BaseURL
} }
/** /**
* @param IConfiguration $config The Friendica IConfiguration * @param IConfig $config The Friendica IConfiguration
* @param array $server The $_SERVER array * @param array $server The $_SERVER array
*/ */
public function __construct(IConfiguration $config, array $server) public function __construct(IConfig $config, array $server)
{ {
$this->config = $config; $this->config = $config;
$this->server = $server; $this->server = $server;

View File

@ -149,15 +149,15 @@ class Module
/** /**
* Determine the class of the current module * Determine the class of the current module
* *
* @param Arguments $args The Friendica execution arguments * @param Arguments $args The Friendica execution arguments
* @param Router $router The Friendica routing instance * @param Router $router The Friendica routing instance
* @param Core\Config\IConfiguration $config The Friendica Configuration * @param Core\Config\IConfig $config The Friendica Configuration
* *
* @return Module The determined module of this call * @return Module The determined module of this call
* *
* @throws \Exception * @throws \Exception
*/ */
public function determineClass(Arguments $args, Router $router, Core\Config\IConfiguration $config) public function determineClass(Arguments $args, Router $router, Core\Config\IConfig $config)
{ {
$printNotAllowedAddon = false; $printNotAllowedAddon = false;

View File

@ -7,7 +7,7 @@ use DOMDocument;
use DOMXPath; use DOMXPath;
use Friendica\App; use Friendica\App;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\IPConfiguration; use Friendica\Core\Config\IPConfiguration;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -168,15 +168,15 @@ class Page implements ArrayAccess
* - Infinite scroll data * - Infinite scroll data
* - head.tpl template * - head.tpl template
* *
* @param App $app The Friendica App instance * @param App $app The Friendica App instance
* @param Module $module The loaded Friendica module * @param Module $module The loaded Friendica module
* @param L10n $l10n The l10n language instance * @param L10n $l10n The l10n language instance
* @param IConfiguration $config The Friendica configuration * @param IConfig $config The Friendica configuration
* @param IPConfiguration $pConfig The Friendica personal configuration (for user) * @param IPConfiguration $pConfig The Friendica personal configuration (for user)
* *
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
*/ */
private function initHead(App $app, Module $module, L10n $l10n, IConfiguration $config, IPConfiguration $pConfig) private function initHead(App $app, Module $module, L10n $l10n, IConfig $config, IPConfiguration $pConfig)
{ {
$interval = ((local_user()) ? $pConfig->get(local_user(), 'system', 'update_interval') : 40000); $interval = ((local_user()) ? $pConfig->get(local_user(), 'system', 'update_interval') : 40000);
@ -342,17 +342,17 @@ class Page implements ArrayAccess
/** /**
* Executes the creation of the current page and prints it to the screen * Executes the creation of the current page and prints it to the screen
* *
* @param App $app The Friendica App * @param App $app The Friendica App
* @param BaseURL $baseURL The Friendica Base URL * @param BaseURL $baseURL The Friendica Base URL
* @param Mode $mode The current node mode * @param Mode $mode The current node mode
* @param Module $module The loaded Friendica module * @param Module $module The loaded Friendica module
* @param L10n $l10n The l10n language class * @param L10n $l10n The l10n language class
* @param IConfiguration $config The Configuration of this node * @param IConfig $config The Configuration of this node
* @param IPConfiguration $pconfig The personal/user configuration * @param IPConfiguration $pconfig The personal/user configuration
* *
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
*/ */
public function run(App $app, BaseURL $baseURL, Mode $mode, Module $module, L10n $l10n, IConfiguration $config, IPConfiguration $pconfig) public function run(App $app, BaseURL $baseURL, Mode $mode, Module $module, L10n $l10n, IConfig $config, IPConfiguration $pconfig)
{ {
$moduleName = $module->getName(); $moduleName = $module->getName();

View File

@ -25,7 +25,7 @@ class AutomaticInstallation extends Console
private $configCache; private $configCache;
/** /**
* @var Config\IConfiguration * @var Config\IConfig
*/ */
private $config; private $config;
@ -89,7 +89,7 @@ Examples
HELP; HELP;
} }
public function __construct(App\Mode $appMode, Config\Cache\ConfigCache $configCache, Config\IConfiguration $config, Database $dba, array $argv = null) public function __construct(App\Mode $appMode, Config\Cache\ConfigCache $configCache, Config\IConfig $config, Database $dba, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View File

@ -4,7 +4,7 @@ namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException; use Asika\SimpleConsole\CommandArgsException;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use RuntimeException; use RuntimeException;
/** /**
@ -40,7 +40,7 @@ class Config extends \Asika\SimpleConsole\Console
*/ */
private $appMode; private $appMode;
/** /**
* @var IConfiguration * @var IConfig
*/ */
private $config; private $config;
@ -78,7 +78,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, IConfiguration $config, array $argv = null) public function __construct(App\Mode $appMode, IConfig $config, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View File

@ -3,7 +3,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
/** /**
* Sets maintenance mode for this node * Sets maintenance mode for this node
@ -19,7 +19,7 @@ class Maintenance extends \Asika\SimpleConsole\Console
*/ */
private $appMode; private $appMode;
/** /**
* @var IConfiguration * @var IConfig
*/ */
private $config; private $config;
@ -52,7 +52,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, IConfiguration $config, $argv = null) public function __construct(App\Mode $appMode, IConfig $config, $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View File

@ -3,7 +3,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Update; use Friendica\Core\Update;
@ -24,7 +24,7 @@ class PostUpdate extends \Asika\SimpleConsole\Console
*/ */
private $appMode; private $appMode;
/** /**
* @var IConfiguration * @var IConfig
*/ */
private $config; private $config;
/** /**
@ -46,7 +46,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, IConfiguration $config, L10n $l10n, array $argv = null) public function __construct(App\Mode $appMode, IConfig $config, L10n $l10n, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View File

@ -5,7 +5,7 @@ namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException; use Asika\SimpleConsole\CommandArgsException;
use Asika\SimpleConsole\Console; use Asika\SimpleConsole\Console;
use Console_Table; use Console_Table;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
/** /**
* Manage blocked servers * Manage blocked servers
@ -20,7 +20,7 @@ class ServerBlock extends Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var IConfiguration * @var IConfig
*/ */
private $config; private $config;
@ -49,7 +49,7 @@ HELP;
return $help; return $help;
} }
public function __construct(IConfiguration $config, $argv = null) public function __construct(IConfig $config, $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);
@ -77,9 +77,9 @@ HELP;
/** /**
* Prints the whole list of blocked domains including the reason * Prints the whole list of blocked domains including the reason
* *
* @param IConfiguration $config * @param IConfig $config
*/ */
private function printBlockedServers(IConfiguration $config) private function printBlockedServers(IConfig $config)
{ {
$table = new Console_Table(); $table = new Console_Table();
$table->setHeaders(['Domain', 'Reason']); $table->setHeaders(['Domain', 'Reason']);
@ -93,11 +93,11 @@ HELP;
/** /**
* Adds a server to the blocked list * Adds a server to the blocked list
* *
* @param IConfiguration $config * @param IConfig $config
* *
* @return int The return code (0 = success, 1 = failed) * @return int The return code (0 = success, 1 = failed)
*/ */
private function addBlockedServer(IConfiguration $config) private function addBlockedServer(IConfig $config)
{ {
if (count($this->args) < 2 || count($this->args) > 3) { if (count($this->args) < 2 || count($this->args) > 3) {
throw new CommandArgsException('Add needs a domain and optional a reason.'); throw new CommandArgsException('Add needs a domain and optional a reason.');
@ -145,11 +145,11 @@ HELP;
/** /**
* Removes a server from the blocked list * Removes a server from the blocked list
* *
* @param IConfiguration $config * @param IConfig $config
* *
* @return int The return code (0 = success, 1 = failed) * @return int The return code (0 = success, 1 = failed)
*/ */
private function removeBlockedServer(IConfiguration $config) private function removeBlockedServer(IConfig $config)
{ {
if (count($this->args) !== 2) { if (count($this->args) !== 2) {
throw new CommandArgsException('Remove needs a second parameter.'); throw new CommandArgsException('Remove needs a second parameter.');

View File

@ -2,7 +2,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
/** /**
* Tired of chasing typos and finding them after a commit. * Tired of chasing typos and finding them after a commit.
@ -15,7 +15,7 @@ class Typo extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var IConfiguration * @var IConfig
*/ */
private $config; private $config;
@ -36,7 +36,7 @@ HELP;
return $help; return $help;
} }
public function __construct(IConfiguration $config, array $argv = null) public function __construct(IConfig $config, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View File

@ -1,7 +1,9 @@
<?php <?php
namespace Friendica\Core\Config; namespace Friendica\Core;
use Friendica\Core\Config\Cache;
use Friendica\Core\Config\IConfig;
use Friendica\Model; use Friendica\Model;
/** /**
@ -10,7 +12,7 @@ use Friendica\Model;
* - The Config-Files (loaded into the FileCache @see Cache\ConfigCache) * - The Config-Files (loaded into the FileCache @see Cache\ConfigCache)
* - The Config-DB-Table (per Config-DB-model @see Model\Config\Config) * - The Config-DB-Table (per Config-DB-model @see Model\Config\Config)
*/ */
abstract class Configuration implements IConfiguration abstract class BaseConfig implements IConfig
{ {
/** /**
* @var Cache\ConfigCache * @var Cache\ConfigCache

View File

@ -4,7 +4,7 @@ namespace Friendica\Core\Cache;
use Exception; use Exception;
use Friendica\Core\BaseCache; use Friendica\Core\BaseCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Memcache; use Memcache;
/** /**
@ -26,7 +26,7 @@ class MemcacheCache extends BaseCache implements IMemoryCache
/** /**
* @throws Exception * @throws Exception
*/ */
public function __construct(string $hostname, IConfiguration $config) public function __construct(string $hostname, IConfig $config)
{ {
if (!class_exists('Memcache', false)) { if (!class_exists('Memcache', false)) {
throw new Exception('Memcache class isn\'t available'); throw new Exception('Memcache class isn\'t available');

View File

@ -4,7 +4,7 @@ namespace Friendica\Core\Cache;
use Exception; use Exception;
use Friendica\Core\BaseCache; use Friendica\Core\BaseCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Memcached; use Memcached;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
@ -40,7 +40,7 @@ class MemcachedCache extends BaseCache implements IMemoryCache
* *
* @throws \Exception * @throws \Exception
*/ */
public function __construct(string $hostname, IConfiguration $config, LoggerInterface $logger) public function __construct(string $hostname, IConfig $config, LoggerInterface $logger)
{ {
if (!class_exists('Memcached', false)) { if (!class_exists('Memcached', false)) {
throw new Exception('Memcached class isn\'t available'); throw new Exception('Memcached class isn\'t available');

View File

@ -4,7 +4,7 @@ namespace Friendica\Core\Cache;
use Exception; use Exception;
use Friendica\Core\BaseCache; use Friendica\Core\BaseCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Redis; use Redis;
/** /**
@ -23,7 +23,7 @@ class RedisCache extends BaseCache implements IMemoryCache
/** /**
* @throws Exception * @throws Exception
*/ */
public function __construct(string $hostname, IConfiguration $config) public function __construct(string $hostname, IConfig $config)
{ {
if (!class_exists('Redis', false)) { if (!class_exists('Redis', false)) {
throw new Exception('Redis class isn\'t available'); throw new Exception('Redis class isn\'t available');

View File

@ -5,7 +5,7 @@ namespace Friendica\Core\Config;
/** /**
* Interface for accessing system wide configurations * Interface for accessing system wide configurations
*/ */
interface IConfiguration interface IConfig
{ {
/** /**

View File

@ -2,6 +2,7 @@
namespace Friendica\Core\Config; namespace Friendica\Core\Config;
use Friendica\Core\BaseConfig;
use Friendica\Model; use Friendica\Model;
/** /**
@ -11,7 +12,7 @@ use Friendica\Model;
* Default Configuration type. * Default Configuration type.
* Provides the best performance for pages loading few configuration variables. * Provides the best performance for pages loading few configuration variables.
*/ */
class JitConfiguration extends Configuration class JitConfig extends BaseConfig
{ {
/** /**
* @var array Array of already loaded db values (even if there was no value) * @var array Array of already loaded db values (even if there was no value)

View File

@ -2,6 +2,7 @@
namespace Friendica\Core\Config; namespace Friendica\Core\Config;
use Friendica\Core\BaseConfig;
use Friendica\Model; use Friendica\Model;
/** /**
@ -10,7 +11,7 @@ use Friendica\Model;
* *
* Minimizes the number of database queries to retrieve configuration values at the cost of memory. * Minimizes the number of database queries to retrieve configuration values at the cost of memory.
*/ */
class PreloadConfiguration extends Configuration class PreloadConfig extends BaseConfig
{ {
/** @var bool */ /** @var bool */
private $config_loaded; private $config_loaded;

View File

@ -2,7 +2,7 @@
namespace Friendica\Core; namespace Friendica\Core;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Session\ISession; use Friendica\Core\Session\ISession;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -40,7 +40,7 @@ class L10n
*/ */
private $logger; private $logger;
public function __construct(IConfiguration $config, Database $dba, LoggerInterface $logger, ISession $session, array $server, array $get) public function __construct(IConfig $config, Database $dba, LoggerInterface $logger, ISession $session, array $server, array $get)
{ {
$this->dba = $dba; $this->dba = $dba;
$this->logger = $logger; $this->logger = $logger;

View File

@ -3,7 +3,7 @@
namespace Friendica\Core; namespace Friendica\Core;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
/** /**
@ -28,7 +28,7 @@ final class Process
private $mode; private $mode;
/** /**
* @var IConfiguration * @var IConfig
*/ */
private $config; private $config;
@ -37,7 +37,7 @@ final class Process
*/ */
private $basePath; private $basePath;
public function __construct(LoggerInterface $logger, App\Mode $mode, IConfiguration $config, string $basepath) public function __construct(LoggerInterface $logger, App\Mode $mode, IConfig $config, string $basepath)
{ {
$this->logger = $logger; $this->logger = $logger;
$this->mode = $mode; $this->mode = $mode;

View File

@ -3,7 +3,7 @@
namespace Friendica\Core; namespace Friendica\Core;
use Exception; use Exception;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Model\Storage; use Friendica\Model\Storage;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
@ -35,7 +35,7 @@ class StorageManager
/** @var Database */ /** @var Database */
private $dba; private $dba;
/** @var IConfiguration */ /** @var IConfig */
private $config; private $config;
/** @var LoggerInterface */ /** @var LoggerInterface */
private $logger; private $logger;
@ -47,11 +47,11 @@ class StorageManager
/** /**
* @param Database $dba * @param Database $dba
* @param IConfiguration $config * @param IConfig $config
* @param LoggerInterface $logger * @param LoggerInterface $logger
* @param L10n $l10n * @param L10n $l10n
*/ */
public function __construct(Database $dba, IConfiguration $config, LoggerInterface $logger, L10n $l10n) public function __construct(Database $dba, IConfig $config, LoggerInterface $logger, L10n $l10n)
{ {
$this->dba = $dba; $this->dba = $dba;
$this->config = $config; $this->config = $config;

View File

@ -133,11 +133,11 @@ abstract class DI
} }
/** /**
* @return Core\Config\IConfiguration * @return Core\Config\IConfig
*/ */
public static function config() public static function config()
{ {
return self::$dice->create(Core\Config\IConfiguration::class); return self::$dice->create(Core\Config\IConfig::class);
} }
/** /**

View File

@ -5,7 +5,7 @@ namespace Friendica\Factory;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Cache\ICache; use Friendica\Core\Cache\ICache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
@ -25,7 +25,7 @@ class CacheFactory
const DEFAULT_TYPE = Cache\Type::DATABASE; const DEFAULT_TYPE = Cache\Type::DATABASE;
/** /**
* @var IConfiguration The IConfiguration to read parameters out of the config * @var IConfig The IConfiguration to read parameters out of the config
*/ */
private $config; private $config;
@ -49,7 +49,7 @@ class CacheFactory
*/ */
private $logger; private $logger;
public function __construct(BaseURL $baseURL, IConfiguration $config, Database $dba, Profiler $profiler, LoggerInterface $logger) public function __construct(BaseURL $baseURL, IConfig $config, Database $dba, Profiler $profiler, LoggerInterface $logger)
{ {
$this->hostname = $baseURL->getHostname(); $this->hostname = $baseURL->getHostname();
$this->config = $config; $this->config = $config;

View File

@ -27,14 +27,14 @@ class ConfigFactory
* @param Cache\ConfigCache $configCache The config cache of this adapter * @param Cache\ConfigCache $configCache The config cache of this adapter
* @param ConfigModel $configModel The configuration model * @param ConfigModel $configModel The configuration model
* *
* @return Config\IConfiguration * @return Config\IConfig
*/ */
public function createConfig(Cache\ConfigCache $configCache, ConfigModel $configModel) public function createConfig(Cache\ConfigCache $configCache, ConfigModel $configModel)
{ {
if ($configCache->get('system', 'config_adapter') === 'preload') { if ($configCache->get('system', 'config_adapter') === 'preload') {
$configuration = new Config\PreloadConfiguration($configCache, $configModel); $configuration = new Config\PreloadConfig($configCache, $configModel);
} else { } else {
$configuration = new Config\JitConfiguration($configCache, $configModel); $configuration = new Config\JitConfig($configCache, $configModel);
} }

View File

@ -4,7 +4,7 @@ namespace Friendica\Factory;
use Friendica\Core\Cache\IMemoryCache; use Friendica\Core\Cache\IMemoryCache;
use Friendica\Core\Cache\Type; use Friendica\Core\Cache\Type;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Lock; use Friendica\Core\Lock;
use Friendica\Database\Database; use Friendica\Database\Database;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
@ -24,7 +24,7 @@ class LockFactory
const DEFAULT_DRIVER = 'default'; const DEFAULT_DRIVER = 'default';
/** /**
* @var IConfiguration The configuration to read parameters out of the config * @var IConfig The configuration to read parameters out of the config
*/ */
private $config; private $config;
@ -43,7 +43,7 @@ class LockFactory
*/ */
private $logger; private $logger;
public function __construct(CacheFactory $cacheFactory, IConfiguration $config, Database $dba, LoggerInterface $logger) public function __construct(CacheFactory $cacheFactory, IConfig $config, Database $dba, LoggerInterface $logger)
{ {
$this->cacheFactory = $cacheFactory; $this->cacheFactory = $cacheFactory;
$this->config = $config; $this->config = $config;

View File

@ -2,7 +2,7 @@
namespace Friendica\Factory; namespace Friendica\Factory;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\HTTPException\InternalServerErrorException;
@ -49,14 +49,14 @@ class LoggerFactory
/** /**
* Creates a new PSR-3 compliant logger instances * Creates a new PSR-3 compliant logger instances
* *
* @param Database $database The Friendica Database instance * @param Database $database The Friendica Database instance
* @param IConfiguration $config The config * @param IConfig $config The config
* @param Profiler $profiler The profiler of the app * @param Profiler $profiler The profiler of the app
* @param FileSystem $fileSystem FileSystem utils * @param FileSystem $fileSystem FileSystem utils
* *
* @return LoggerInterface The PSR-3 compliant logger instance * @return LoggerInterface The PSR-3 compliant logger instance
*/ */
public function create(Database $database, IConfiguration $config, Profiler $profiler, FileSystem $fileSystem) public function create(Database $database, IConfig $config, Profiler $profiler, FileSystem $fileSystem)
{ {
if (empty($config->get('system', 'debugging', false))) { if (empty($config->get('system', 'debugging', false))) {
$logger = new VoidLogger(); $logger = new VoidLogger();
@ -137,16 +137,16 @@ class LoggerFactory
* *
* It should never get filled during normal usage of Friendica * It should never get filled during normal usage of Friendica
* *
* @param IConfiguration $config The config * @param IConfig $config The config
* @param Profiler $profiler The profiler of the app * @param Profiler $profiler The profiler of the app
* @param FileSystem $fileSystem FileSystem utils * @param FileSystem $fileSystem FileSystem utils
* *
* @return LoggerInterface The PSR-3 compliant logger instance * @return LoggerInterface The PSR-3 compliant logger instance
* *
* @throws InternalServerErrorException * @throws InternalServerErrorException
* @throws \Exception * @throws \Exception
*/ */
public static function createDev(IConfiguration $config, Profiler $profiler, FileSystem $fileSystem) public static function createDev(IConfig $config, Profiler $profiler, FileSystem $fileSystem)
{ {
$debugging = $config->get('system', 'debugging'); $debugging = $config->get('system', 'debugging');
$stream = $config->get('system', 'dlogfile'); $stream = $config->get('system', 'dlogfile');

View File

@ -5,7 +5,7 @@ namespace Friendica\Factory;
use Friendica\App; use Friendica\App;
use Friendica\Core\Cache\ICache; use Friendica\Core\Cache\ICache;
use Friendica\Core\Cache\Type; use Friendica\Core\Cache\Type;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Session; use Friendica\Core\Session;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\Database; use Friendica\Database\Database;
@ -29,7 +29,7 @@ class SessionFactory
/** /**
* @param App\Mode $mode * @param App\Mode $mode
* @param App\BaseURL $baseURL * @param App\BaseURL $baseURL
* @param IConfiguration $config * @param IConfig $config
* @param Database $dba * @param Database $dba
* @param ICache $cache * @param ICache $cache
* @param LoggerInterface $logger * @param LoggerInterface $logger
@ -37,7 +37,7 @@ class SessionFactory
* *
* @return Session\ISession * @return Session\ISession
*/ */
public function createSession(App\Mode $mode, App\BaseURL $baseURL, IConfiguration $config, Database $dba, ICache $cache, LoggerInterface $logger, Profiler $profiler, array $server = []) public function createSession(App\Mode $mode, App\BaseURL $baseURL, IConfig $config, Database $dba, ICache $cache, LoggerInterface $logger, Profiler $profiler, array $server = [])
{ {
$stamp1 = microtime(true); $stamp1 = microtime(true);
$session = null; $session = null;

View File

@ -6,7 +6,7 @@
namespace Friendica\Model\Storage; namespace Friendica\Model\Storage;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Util\Strings; use Friendica\Util\Strings;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
@ -28,7 +28,7 @@ class Filesystem extends AbstractStorage
// Default base folder // Default base folder
const DEFAULT_BASE_FOLDER = 'storage'; const DEFAULT_BASE_FOLDER = 'storage';
/** @var IConfiguration */ /** @var IConfig */
private $config; private $config;
/** @var string */ /** @var string */
@ -37,11 +37,11 @@ class Filesystem extends AbstractStorage
/** /**
* Filesystem constructor. * Filesystem constructor.
* *
* @param IConfiguration $config * @param IConfig $config
* @param LoggerInterface $logger * @param LoggerInterface $logger
* @param L10n $l10n * @param L10n $l10n
*/ */
public function __construct(IConfiguration $config, LoggerInterface $logger, L10n $l10n) public function __construct(IConfig $config, LoggerInterface $logger, L10n $l10n)
{ {
parent::__construct($l10n, $logger); parent::__construct($l10n, $logger);

View File

@ -3,7 +3,7 @@
namespace Friendica\Model\User; namespace Friendica\Model\User;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
/** /**
* Interacting with the Friendica Cookie of a user * Interacting with the Friendica Cookie of a user
@ -32,7 +32,7 @@ class Cookie
/** @var array The $_COOKIE array */ /** @var array The $_COOKIE array */
private $cookie; private $cookie;
public function __construct(IConfiguration $config, App\BaseURL $baseURL, array $server = [], array $cookie = []) public function __construct(IConfig $config, App\BaseURL $baseURL, array $server = [], array $cookie = [])
{ {
if (!empty($server['REMOTE_ADDR'])) { if (!empty($server['REMOTE_ADDR'])) {
$this->remoteAddr = $server['REMOTE_ADDR']; $this->remoteAddr = $server['REMOTE_ADDR'];

View File

@ -3,7 +3,7 @@
namespace Friendica\Util; namespace Friendica\Util;
use Friendica\Core\Config\Cache\ConfigCache; use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface; use Psr\Container\NotFoundExceptionInterface;
@ -47,9 +47,9 @@ class Profiler implements ContainerInterface
/** /**
* Updates the enabling of the current profiler * Updates the enabling of the current profiler
* *
* @param IConfiguration $config * @param IConfig $config
*/ */
public function update(IConfiguration $config) public function update(IConfig $config)
{ {
$this->enabled = $config->get('system', 'profiler'); $this->enabled = $config->get('system', 'profiler');
$this->rendertime = $config->get('rendertime', 'callstack'); $this->rendertime = $config->get('rendertime', 'callstack');

View File

@ -72,13 +72,13 @@ return [
['determine', [], Dice::CHAIN_CALL], ['determine', [], Dice::CHAIN_CALL],
], ],
], ],
Config\IConfiguration::class => [ Config\IConfig::class => [
'instanceOf' => Factory\ConfigFactory::class, 'instanceOf' => Factory\ConfigFactory::class,
'call' => [ 'call' => [
['createConfig', [], Dice::CHAIN_CALL], ['createConfig', [], Dice::CHAIN_CALL],
], ],
], ],
Config\IPConfiguration::class => [ Config\IPConfiguration::class => [
'instanceOf' => Factory\ConfigFactory::class, 'instanceOf' => Factory\ConfigFactory::class,
'call' => [ 'call' => [
['createPConfig', [], Dice::CHAIN_CALL], ['createPConfig', [], Dice::CHAIN_CALL],

View File

@ -22,7 +22,7 @@ trait AppMockTrait
protected $app; protected $app;
/** /**
* @var MockInterface|Config\IConfiguration The mocked Config Cache * @var MockInterface|Config\IConfig The mocked Config Cache
*/ */
protected $configMock; protected $configMock;
@ -64,9 +64,9 @@ trait AppMockTrait
// Disable the adapter // Disable the adapter
$configModel->shouldReceive('isConnected')->andReturn(false); $configModel->shouldReceive('isConnected')->andReturn(false);
$config = new Config\JitConfiguration($this->configMock, $configModel); $config = new Config\JitConfig($this->configMock, $configModel);
$this->dice->shouldReceive('create') $this->dice->shouldReceive('create')
->with(Config\IConfiguration::class) ->with(Config\IConfig::class)
->andReturn($config); ->andReturn($config);
// Mocking App and most used functions // Mocking App and most used functions

View File

@ -7,7 +7,7 @@ use Friendica\App;
use Friendica\Core\Cache\ICache; use Friendica\Core\Cache\ICache;
use Friendica\Core\Cache\IMemoryCache; use Friendica\Core\Cache\IMemoryCache;
use Friendica\Core\Config\Cache\ConfigCache; use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Lock\ILock; use Friendica\Core\Lock\ILock;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Test\Util\VFSTrait; use Friendica\Test\Util\VFSTrait;
@ -115,10 +115,10 @@ class dependencyCheck extends TestCase
public function testConfiguration() public function testConfiguration()
{ {
/** @var IConfiguration $config */ /** @var IConfig $config */
$config = $this->dice->create(IConfiguration::class); $config = $this->dice->create(IConfig::class);
$this->assertInstanceOf(IConfiguration::class, $config); $this->assertInstanceOf(IConfig::class, $config);
$this->assertNotEmpty($config->get('database', 'username')); $this->assertNotEmpty($config->get('database', 'username'));
} }
@ -133,8 +133,8 @@ class dependencyCheck extends TestCase
public function testDevLogger() public function testDevLogger()
{ {
/** @var IConfiguration $config */ /** @var IConfig $config */
$config = $this->dice->create(IConfiguration::class); $config = $this->dice->create(IConfig::class);
$config->set('system', 'dlogfile', $this->root->url() . '/friendica.log'); $config->set('system', 'dlogfile', $this->root->url() . '/friendica.log');
/** @var LoggerInterface $logger */ /** @var LoggerInterface $logger */

View File

@ -7,7 +7,7 @@ namespace Friendica\Test;
use Dice\Dice; use Dice\Dice;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\IPConfiguration; use Friendica\Core\Config\IPConfiguration;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Session; use Friendica\Core\Session;
@ -47,7 +47,7 @@ class ApiTest extends DatabaseTest
/** @var App */ /** @var App */
protected $app; protected $app;
/** @var IConfiguration */ /** @var IConfig */
protected $config; protected $config;
/** @var Dice */ /** @var Dice */
@ -69,8 +69,8 @@ class ApiTest extends DatabaseTest
/** @var Database $dba */ /** @var Database $dba */
$dba = $this->dice->create(Database::class); $dba = $this->dice->create(Database::class);
/** @var IConfiguration $config */ /** @var IConfig $config */
$this->config = $this->dice->create(IConfiguration::class); $this->config = $this->dice->create(IConfig::class);
$this->config->set('system', 'url', 'http://localhost'); $this->config->set('system', 'url', 'http://localhost');
$this->config->set('system', 'hostname', 'localhost'); $this->config->set('system', 'hostname', 'localhost');

View File

@ -3,7 +3,7 @@
namespace Friendica\Test\src\App; namespace Friendica\Test\src\App;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\LegacyModule; use Friendica\LegacyModule;
use Friendica\Module\HTTPException\PageNotFound; use Friendica\Module\HTTPException\PageNotFound;
use Friendica\Module\WellKnown\HostMeta; use Friendica\Module\WellKnown\HostMeta;
@ -149,7 +149,7 @@ class ModuleTest extends DatabaseTest
*/ */
public function testModuleClass($assert, string $name, string $command, bool $privAdd) public function testModuleClass($assert, string $name, string $command, bool $privAdd)
{ {
$config = \Mockery::mock(IConfiguration::class); $config = \Mockery::mock(IConfig::class);
$config->shouldReceive('get')->with('config', 'private_addons', false)->andReturn($privAdd)->atMost()->once(); $config->shouldReceive('get')->with('config', 'private_addons', false)->andReturn($privAdd)->atMost()->once();
$router = (new App\Router([]))->loadRoutes(include __DIR__ . '/../../../static/routes.config.php'); $router = (new App\Router([]))->loadRoutes(include __DIR__ . '/../../../static/routes.config.php');

View File

@ -5,7 +5,7 @@ namespace Friendica\Test\src\Console;
use Friendica\App; use Friendica\App;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\Console\Config; use Friendica\Console\Config;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Mockery\MockInterface; use Mockery\MockInterface;
class ConfigConsoleTest extends ConsoleTest class ConfigConsoleTest extends ConsoleTest
@ -29,7 +29,7 @@ class ConfigConsoleTest extends ConsoleTest
$this->appMode->shouldReceive('has') $this->appMode->shouldReceive('has')
->andReturn(true); ->andReturn(true);
$this->configMock = \Mockery::mock(IConfiguration::class); $this->configMock = \Mockery::mock(IConfig::class);
} }
function testSetGetKeyValue() function testSetGetKeyValue()

View File

@ -3,7 +3,7 @@
namespace Friendica\Test\src\Console; namespace Friendica\Test\src\Console;
use Friendica\Console\ServerBlock; use Friendica\Console\ServerBlock;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
class ServerBlockConsoleTest extends ConsoleTest class ServerBlockConsoleTest extends ConsoleTest
{ {
@ -22,7 +22,7 @@ class ServerBlockConsoleTest extends ConsoleTest
{ {
parent::setUp(); parent::setUp();
$this->configMock = \Mockery::mock(IConfiguration::class); $this->configMock = \Mockery::mock(IConfig::class);
} }
/** /**

View File

@ -3,7 +3,7 @@
namespace Friendica\Test\src\Core\Cache; namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\MemcacheCache; use Friendica\Core\Cache\MemcacheCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
/** /**
* @requires extension memcache * @requires extension memcache
@ -13,7 +13,7 @@ class MemcacheCacheTest extends MemoryCacheTest
{ {
protected function getInstance() protected function getInstance()
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost'; $host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';

View File

@ -4,7 +4,7 @@
namespace Friendica\Test\src\Core\Cache; namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\MemcachedCache; use Friendica\Core\Cache\MemcachedCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
/** /**
@ -15,7 +15,7 @@ class MemcachedCacheTest extends MemoryCacheTest
{ {
protected function getInstance() protected function getInstance()
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost'; $host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost';

View File

@ -4,7 +4,7 @@
namespace Friendica\Test\src\Core\Cache; namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\RedisCache; use Friendica\Core\Cache\RedisCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
/** /**
* @requires extension redis * @requires extension redis
@ -14,7 +14,7 @@ class RedisCacheTest extends MemoryCacheTest
{ {
protected function getInstance() protected function getInstance()
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$host = $_SERVER['REDIS_HOST'] ?? 'localhost'; $host = $_SERVER['REDIS_HOST'] ?? 'localhost';

View File

@ -3,7 +3,7 @@
namespace Friendica\Test\src\Core\Config; namespace Friendica\Test\src\Core\Config;
use Friendica\Core\Config\Cache\ConfigCache; use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Model\Config\Config as ConfigModel; use Friendica\Model\Config\Config as ConfigModel;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTest;
use Mockery\MockInterface; use Mockery\MockInterface;
@ -17,7 +17,7 @@ abstract class ConfigurationTest extends MockedTest
/** @var ConfigCache */ /** @var ConfigCache */
protected $configCache; protected $configCache;
/** @var IConfiguration */ /** @var IConfig */
protected $testedConfig; protected $testedConfig;
/** /**
@ -46,7 +46,7 @@ abstract class ConfigurationTest extends MockedTest
} }
/** /**
* @return IConfiguration * @return IConfig
*/ */
public abstract function getInstance(); public abstract function getInstance();

View File

@ -2,13 +2,13 @@
namespace Friendica\Test\src\Core\Config; namespace Friendica\Test\src\Core\Config;
use Friendica\Core\Config\JitConfiguration; use Friendica\Core\Config\JitConfig;
class JitConfigurationTest extends ConfigurationTest class JitConfigurationTest extends ConfigurationTest
{ {
public function getInstance() public function getInstance()
{ {
return new JitConfiguration($this->configCache, $this->configModel); return new JitConfig($this->configCache, $this->configModel);
} }
/** /**

View File

@ -2,13 +2,13 @@
namespace Friendica\Test\src\Core\Config; namespace Friendica\Test\src\Core\Config;
use Friendica\Core\Config\PreloadConfiguration; use Friendica\Core\Config\PreloadConfig;
class PreloadConfigurationTest extends ConfigurationTest class PreloadConfigurationTest extends ConfigurationTest
{ {
public function getInstance() public function getInstance()
{ {
return new PreloadConfiguration($this->configCache, $this->configModel); return new PreloadConfig($this->configCache, $this->configModel);
} }
/** /**

View File

@ -4,7 +4,7 @@
namespace Friendica\Test\src\Core\Lock; namespace Friendica\Test\src\Core\Lock;
use Friendica\Core\Cache\MemcacheCache; use Friendica\Core\Cache\MemcacheCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Lock\CacheLock; use Friendica\Core\Lock\CacheLock;
/** /**
@ -15,7 +15,7 @@ class MemcacheCacheLockTest extends LockTest
{ {
protected function getInstance() protected function getInstance()
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost'; $host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';

View File

@ -4,7 +4,7 @@
namespace Friendica\Test\src\Core\Lock; namespace Friendica\Test\src\Core\Lock;
use Friendica\Core\Cache\MemcachedCache; use Friendica\Core\Cache\MemcachedCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Lock\CacheLock; use Friendica\Core\Lock\CacheLock;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
@ -16,7 +16,7 @@ class MemcachedCacheLockTest extends LockTest
{ {
protected function getInstance() protected function getInstance()
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost'; $host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost';

View File

@ -4,7 +4,7 @@
namespace Friendica\Test\src\Core\Lock; namespace Friendica\Test\src\Core\Lock;
use Friendica\Core\Cache\RedisCache; use Friendica\Core\Cache\RedisCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Lock\CacheLock; use Friendica\Core\Lock\CacheLock;
/** /**
@ -15,7 +15,7 @@ class RedisCacheLockTest extends LockTest
{ {
protected function getInstance() protected function getInstance()
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$host = $_SERVER['REDIS_HOST'] ?? 'localhost'; $host = $_SERVER['REDIS_HOST'] ?? 'localhost';

View File

@ -4,8 +4,8 @@ namespace Friendica\Test\src\Core\Lock;
use Dice\Dice; use Dice\Dice;
use Friendica\App; use Friendica\App;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\JitConfiguration; use Friendica\Core\Config\JitConfig;
use Friendica\Core\Lock\SemaphoreLock; use Friendica\Core\Lock\SemaphoreLock;
use Friendica\DI; use Friendica\DI;
use Mockery\MockInterface; use Mockery\MockInterface;
@ -21,12 +21,12 @@ class SemaphoreLockTest extends LockTest
$app->shouldReceive('getHostname')->andReturn('friendica.local'); $app->shouldReceive('getHostname')->andReturn('friendica.local');
$dice->shouldReceive('create')->with(App::class)->andReturn($app); $dice->shouldReceive('create')->with(App::class)->andReturn($app);
$configMock = \Mockery::mock(JitConfiguration::class); $configMock = \Mockery::mock(JitConfig::class);
$configMock $configMock
->shouldReceive('get') ->shouldReceive('get')
->with('system', 'temppath', NULL, false) ->with('system', 'temppath', NULL, false)
->andReturn('/tmp/'); ->andReturn('/tmp/');
$dice->shouldReceive('create')->with(IConfiguration::class)->andReturn($configMock); $dice->shouldReceive('create')->with(IConfig::class)->andReturn($configMock);
// @todo Because "get_temppath()" is using static methods, we have to initialize the BaseObject // @todo Because "get_temppath()" is using static methods, we have to initialize the BaseObject
DI::init($dice); DI::init($dice);

View File

@ -3,8 +3,8 @@
namespace Friendica\Test\src\Core; namespace Friendica\Test\src\Core;
use Dice\Dice; use Dice\Dice;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\PreloadConfiguration; use Friendica\Core\Config\PreloadConfig;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Session\ISession; use Friendica\Core\Session\ISession;
@ -28,7 +28,7 @@ class StorageManagerTest extends DatabaseTest
{ {
/** @var Database */ /** @var Database */
private $dba; private $dba;
/** @var IConfiguration */ /** @var IConfig */
private $config; private $config;
/** @var LoggerInterface */ /** @var LoggerInterface */
private $logger; private $logger;
@ -56,7 +56,7 @@ class StorageManagerTest extends DatabaseTest
$this->dba = new StaticDatabase($configCache, $profiler, $this->logger); $this->dba = new StaticDatabase($configCache, $profiler, $this->logger);
$configModel = new Config($this->dba); $configModel = new Config($this->dba);
$this->config = new PreloadConfiguration($configCache, $configModel); $this->config = new PreloadConfig($configCache, $configModel);
$this->l10n = \Mockery::mock(L10n::class); $this->l10n = \Mockery::mock(L10n::class);
} }

View File

@ -2,7 +2,7 @@
namespace Friendica\Test\src\Model\Storage; namespace Friendica\Test\src\Model\Storage;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Model\Storage\Filesystem; use Friendica\Model\Storage\Filesystem;
use Friendica\Model\Storage\IStorage; use Friendica\Model\Storage\IStorage;
@ -17,7 +17,7 @@ class FilesystemStorageTest extends StorageTest
{ {
use VFSTrait; use VFSTrait;
/** @var MockInterface|IConfiguration */ /** @var MockInterface|IConfig */
protected $config; protected $config;
protected function setUp() protected function setUp()
@ -37,7 +37,7 @@ class FilesystemStorageTest extends StorageTest
/** @var MockInterface|L10n $l10n */ /** @var MockInterface|L10n $l10n */
$l10n = \Mockery::mock(L10n::class)->makePartial(); $l10n = \Mockery::mock(L10n::class)->makePartial();
$this->config = \Mockery::mock(IConfiguration::class); $this->config = \Mockery::mock(IConfig::class);
$this->config->shouldReceive('get') $this->config->shouldReceive('get')
->with('storage', 'filesystem_path', Filesystem::DEFAULT_BASE_FOLDER) ->with('storage', 'filesystem_path', Filesystem::DEFAULT_BASE_FOLDER)
->andReturn($this->root->getChild('storage')->url()); ->andReturn($this->root->getChild('storage')->url());

View File

@ -3,7 +3,7 @@
namespace Friendica\Testsrc\Model\User; namespace Friendica\Testsrc\Model\User;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Model\User\Cookie; use Friendica\Model\User\Cookie;
use Friendica\Test\DatabaseTest; use Friendica\Test\DatabaseTest;
use Friendica\Test\Util\StaticCookie; use Friendica\Test\Util\StaticCookie;
@ -11,7 +11,7 @@ use Mockery\MockInterface;
class CookieTest extends DatabaseTest class CookieTest extends DatabaseTest
{ {
/** @var MockInterface|IConfiguration */ /** @var MockInterface|IConfig */
private $config; private $config;
/** @var MockInterface|BaseURL */ /** @var MockInterface|BaseURL */
private $baseUrl; private $baseUrl;
@ -22,7 +22,7 @@ class CookieTest extends DatabaseTest
parent::setUp(); parent::setUp();
$this->config = \Mockery::mock(IConfiguration::class); $this->config = \Mockery::mock(IConfig::class);
$this->baseUrl = \Mockery::mock(BaseURL::class); $this->baseUrl = \Mockery::mock(BaseURL::class);
} }

View File

@ -2,7 +2,7 @@
namespace Friendica\Test\src\Util; namespace Friendica\Test\src\Util;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTest;
class BaseURLTest extends MockedTest class BaseURLTest extends MockedTest
@ -173,7 +173,7 @@ class BaseURLTest extends MockedTest
*/ */
public function testCheck($server, $input, $assert) public function testCheck($server, $input, $assert)
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']); $configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']);
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']); $configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']);
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']); $configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']);
@ -295,7 +295,7 @@ class BaseURLTest extends MockedTest
*/ */
public function testSave($input, $save, $url) public function testSave($input, $save, $url)
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']); $configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']);
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']); $configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']);
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']); $configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']);
@ -333,7 +333,7 @@ class BaseURLTest extends MockedTest
*/ */
public function testSaveByUrl($input, $save, $url) public function testSaveByUrl($input, $save, $url)
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']); $configMock->shouldReceive('get')->with('config', 'hostname')->andReturn($input['hostname']);
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']); $configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn($input['urlPath']);
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']); $configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($input['sslPolicy']);
@ -409,7 +409,7 @@ class BaseURLTest extends MockedTest
*/ */
public function testGetURL($sslPolicy, $ssl, $url, $assert) public function testGetURL($sslPolicy, $ssl, $url, $assert)
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local'); $configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local');
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test'); $configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test');
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($sslPolicy); $configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($sslPolicy);
@ -467,7 +467,7 @@ class BaseURLTest extends MockedTest
*/ */
public function testCheckRedirectHTTPS($server, $forceSSL, $sslPolicy, $url, $redirect) public function testCheckRedirectHTTPS($server, $forceSSL, $sslPolicy, $url, $redirect)
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local'); $configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local');
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test'); $configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test');
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($sslPolicy); $configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn($sslPolicy);
@ -503,7 +503,7 @@ class BaseURLTest extends MockedTest
*/ */
public function testWrongSave($fail) public function testWrongSave($fail)
{ {
$configMock = \Mockery::mock(IConfiguration::class); $configMock = \Mockery::mock(IConfig::class);
$configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local'); $configMock->shouldReceive('get')->with('config', 'hostname')->andReturn('friendica.local');
$configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test'); $configMock->shouldReceive('get')->with('system', 'urlpath')->andReturn('new/test');
$configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn(BaseURL::DEFAULT_SSL_SCHEME); $configMock->shouldReceive('get')->with('system', 'ssl_policy')->andReturn(BaseURL::DEFAULT_SSL_SCHEME);

View File

@ -3,7 +3,7 @@
namespace Friendica\Test\src\Util; namespace Friendica\Test\src\Util;
use Friendica\Core\Config\Cache\ConfigCache; use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Core\Config\IConfiguration; use Friendica\Core\Config\IConfig;
use Friendica\Test\MockedTest; use Friendica\Test\MockedTest;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
use Mockery\MockInterface; use Mockery\MockInterface;
@ -235,7 +235,7 @@ class ProfilerTest extends MockedTest
$profiler->saveTimestamp(time(), 'network', 'test1'); $profiler->saveTimestamp(time(), 'network', 'test1');
$config = \Mockery::mock(IConfiguration::class); $config = \Mockery::mock(IConfig::class);
$config->shouldReceive('get') $config->shouldReceive('get')
->with('system', 'profiler') ->with('system', 'profiler')
->andReturn(false) ->andReturn(false)