Shorten "PConfiguration" to "PConfig" again, since the Wrapper is gone

This commit is contained in:
nupplaPhil 2020-01-19 22:23:44 +01:00
parent cb80108957
commit d5a473abda
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
41 changed files with 219 additions and 216 deletions

View file

@ -15,7 +15,7 @@ use Friendica\Model;
abstract class BaseConfig implements IConfig
{
/**
* @var Cache\ConfigCache
* @var Cache
*/
protected $configCache;
@ -25,10 +25,10 @@ abstract class BaseConfig implements IConfig
protected $configModel;
/**
* @param Cache\ConfigCache $configCache The configuration cache (based on the config-files)
* @param Model\Config\Config $configModel The configuration model
* @param Cache $configCache The configuration cache (based on the config-files)
* @param Model\Config\Config $configModel The configuration model
*/
public function __construct(Cache\ConfigCache $configCache, Model\Config\Config $configModel)
public function __construct(Cache $configCache, Model\Config\Config $configModel)
{
$this->configCache = $configCache;
$this->configModel = $configModel;

View file

@ -1,7 +1,9 @@
<?php
namespace Friendica\Core\Config;
namespace Friendica\Core;
use Friendica\Core\PConfig\Cache;
use Friendica\Core\PConfig\IPConfig;
use Friendica\Model;
/**
@ -11,10 +13,10 @@ use Friendica\Model;
* The configuration cache (@see Cache\PConfigCache) is used for temporary caching of database calls. This will
* increase the performance.
*/
abstract class PConfiguration implements IPConfiguration
abstract class BasePConfig implements IPConfig
{
/**
* @var Cache\PConfigCache
* @var Cache
*/
protected $configCache;
@ -24,10 +26,10 @@ abstract class PConfiguration implements IPConfiguration
protected $configModel;
/**
* @param Cache\PConfigCache $configCache The configuration cache
* @param Model\Config\PConfig $configModel The configuration model
* @param Cache $configCache The configuration cache
* @param Model\Config\PConfig $configModel The configuration model
*/
public function __construct(Cache\PConfigCache $configCache, Model\Config\PConfig $configModel)
public function __construct(Cache $configCache, Model\Config\PConfig $configModel)
{
$this->configCache = $configCache;
$this->configModel = $configModel;
@ -36,7 +38,7 @@ abstract class PConfiguration implements IPConfiguration
/**
* Returns the Config Cache
*
* @return Cache\PConfigCache
* @return Cache
*/
public function getCache()
{

View file

@ -1,6 +1,6 @@
<?php
namespace Friendica\Core\Config\Cache;
namespace Friendica\Core\Config;
use ParagonIE\HiddenString\HiddenString;
@ -9,7 +9,7 @@ use ParagonIE\HiddenString\HiddenString;
* Initial, all *.config.php files are loaded into this cache with the
* ConfigFileLoader ( @see ConfigFileLoader )
*/
class ConfigCache
class Cache
{
/**
* @var array

View file

@ -11,9 +11,7 @@ interface IConfig
/**
* Loads all configuration values of family into a cached storage.
*
* All configuration values of the system are stored in the cache ( @see ConfigCache )
*
* @param string $cat The category of the configuration value
* All configuration values of the system are stored in the cache ( @param string $cat The category of the configuration value
*
* @return void
*/
@ -67,7 +65,7 @@ interface IConfig
/**
* Returns the Config Cache
*
* @return Cache\ConfigCache
* @return Cache
*/
function getCache();
}

View file

@ -20,10 +20,10 @@ class JitConfig extends BaseConfig
private $db_loaded;
/**
* @param Cache\ConfigCache $configCache The configuration cache (based on the config-files)
* @param Cache $configCache The configuration cache (based on the config-files)
* @param Model\Config\Config $configModel The configuration model
*/
public function __construct(Cache\ConfigCache $configCache, Model\Config\Config $configModel)
public function __construct(Cache $configCache, Model\Config\Config $configModel)
{
parent::__construct($configCache, $configModel);
$this->db_loaded = [];

View file

@ -17,10 +17,10 @@ class PreloadConfig extends BaseConfig
private $config_loaded;
/**
* @param Cache\ConfigCache $configCache The configuration cache (based on the config-files)
* @param Cache $configCache The configuration cache (based on the config-files)
* @param Model\Config\Config $configModel The configuration model
*/
public function __construct(Cache\ConfigCache $configCache, Model\Config\Config $configModel)
public function __construct(Cache $configCache, Model\Config\Config $configModel)
{
parent::__construct($configCache, $configModel);
$this->config_loaded = false;

View file

@ -6,7 +6,7 @@ namespace Friendica\Core;
use DOMDocument;
use Exception;
use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Core\Config\Cache;
use Friendica\Database\Database;
use Friendica\Database\DBStructure;
use Friendica\DI;
@ -129,12 +129,12 @@ class Installer
* - Creates `config/local.config.php`
* - Installs Database Structure
*
* @param ConfigCache $configCache The config cache with all config relevant information
* @param Cache $configCache The config cache with all config relevant information
*
* @return bool true if the config was created, otherwise false
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function createConfig(ConfigCache $configCache)
public function createConfig(Cache $configCache)
{
$basepath = $configCache->get('system', 'basepath');
@ -618,12 +618,12 @@ class Installer
/**
* Setup the default cache for a new installation
*
* @param ConfigCache $configCache The configuration cache
* @param string $basePath The determined basepath
* @param Cache $configCache The configuration cache
* @param string $basePath The determined basepath
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function setUpCache(ConfigCache $configCache, $basePath)
public function setUpCache(Cache $configCache, $basePath)
{
$configCache->set('config', 'php_path' , $this->getPHPPath());
$configCache->set('system', 'basepath' , $basePath);

View file

@ -1,13 +1,13 @@
<?php
namespace Friendica\Core\Config\Cache;
namespace Friendica\Core\PConfig;
use ParagonIE\HiddenString\HiddenString;
/**
* The Friendica config cache for users
*/
class PConfigCache
class Cache
{
/**
* @var array

View file

@ -1,11 +1,11 @@
<?php
namespace Friendica\Core\Config;
namespace Friendica\Core\PConfig;
/**
* Interface for accessing user specific configurations
*/
interface IPConfiguration
interface IPConfig
{
/**
@ -17,7 +17,7 @@ interface IPConfiguration
* @param string $cat The category of the configuration value
*
* @return void
* @see PConfigCache
* @see Cache
*
*/
function load(int $uid, string $cat = 'config');
@ -76,7 +76,7 @@ interface IPConfiguration
/**
* Returns the Config Cache
*
* @return Cache\PConfigCache
* @return Cache
*/
function getCache();
}

View file

@ -1,7 +1,8 @@
<?php
namespace Friendica\Core\Config;
namespace Friendica\Core\PConfig;
use Friendica\Core\BasePConfig;
use Friendica\Model;
/**
@ -11,7 +12,7 @@ use Friendica\Model;
* Default Configuration type.
* Provides the best performance for pages loading few configuration variables.
*/
class JitPConfiguration extends PConfiguration
class JitPConfig extends BasePConfig
{
/**
* @var array Array of already loaded db values (even if there was no value)
@ -19,10 +20,10 @@ class JitPConfiguration extends PConfiguration
private $db_loaded;
/**
* @param Cache\PConfigCache $configCache The configuration cache
* @param Cache $configCache The configuration cache
* @param Model\Config\PConfig $configModel The configuration model
*/
public function __construct(Cache\PConfigCache $configCache, Model\Config\PConfig $configModel)
public function __construct(Cache $configCache, Model\Config\PConfig $configModel)
{
parent::__construct($configCache, $configModel);
$this->db_loaded = [];

View file

@ -1,7 +1,8 @@
<?php
namespace Friendica\Core\Config;
namespace Friendica\Core\PConfig;
use Friendica\Core\BasePConfig;
use Friendica\Model;
/**
@ -10,16 +11,16 @@ use Friendica\Model;
*
* Minimizes the number of database queries to retrieve configuration values at the cost of memory.
*/
class PreloadPConfiguration extends PConfiguration
class PreloadPConfig extends BasePConfig
{
/** @var array */
private $config_loaded;
/**
* @param Cache\PConfigCache $configCache The configuration cache
* @param Cache $configCache The configuration cache
* @param Model\Config\PConfig $configModel The configuration model
*/
public function __construct(Cache\PConfigCache $configCache, Model\Config\PConfig $configModel)
public function __construct(Cache $configCache, Model\Config\PConfig $configModel)
{
parent::__construct($configCache, $configModel);
$this->config_loaded = [];