mirror of
https://github.com/friendica/friendica
synced 2025-04-26 16:30:12 +00:00
Adding descriptions
This commit is contained in:
parent
f3da5b3a2f
commit
bc73d4bd2b
6 changed files with 41 additions and 18 deletions
|
@ -2,6 +2,13 @@
|
|||
|
||||
namespace Friendica\Core\Config;
|
||||
|
||||
/**
|
||||
* The Friendica config cache for the application
|
||||
* Initial, all *.config.php files are loaded into this cache with the
|
||||
* ConfigCacheLoader ( @see ConfigCacheLoader )
|
||||
*
|
||||
* Is used for further caching operations too (depending on the ConfigAdapter )
|
||||
*/
|
||||
class ConfigCache implements IConfigCache, IPConfigCache
|
||||
{
|
||||
/**
|
||||
|
@ -12,12 +19,15 @@ class ConfigCache implements IConfigCache, IPConfigCache
|
|||
*/
|
||||
public $config;
|
||||
|
||||
public function __construct($config = [], $overwrite = false)
|
||||
/**
|
||||
* @param array $config A initial config array
|
||||
*/
|
||||
public function __construct($config = [])
|
||||
{
|
||||
$this->config = [];
|
||||
|
||||
if (isset($config)) {
|
||||
$this->loadConfigArray($config, $overwrite);
|
||||
$this->loadConfigArray($config, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,15 +2,29 @@
|
|||
|
||||
namespace Friendica\Core\Config;
|
||||
|
||||
/**
|
||||
* The ConfigCacheLoader loads config-files and stores them in a ConfigCache ( @see ConfigCache )
|
||||
*
|
||||
* It is capable of loading the following config files:
|
||||
* - *.config.php (current)
|
||||
* - *.ini.php (deprecated)
|
||||
* - *.htconfig.php (deprecated)
|
||||
*/
|
||||
class ConfigCacheLoader
|
||||
{
|
||||
/**
|
||||
* The Sub directory of the config-files
|
||||
* @var string
|
||||
*/
|
||||
const SUBDIRECTORY = '/config/';
|
||||
|
||||
private $baseDir;
|
||||
private $configDir;
|
||||
|
||||
public function __construct($baseDir)
|
||||
{
|
||||
$this->baseDir = $baseDir;
|
||||
$this->configDir = $baseDir . '/config/';
|
||||
$this->configDir = $baseDir . self::SUBDIRECTORY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace Friendica\Core\Config;
|
||||
|
||||
/**
|
||||
* The interface for a system-wide ConfigCache
|
||||
*/
|
||||
interface IConfigCache
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace Friendica\Core\Config;
|
||||
|
||||
/**
|
||||
* The interface for a user-specific config cache
|
||||
*/
|
||||
interface IPConfigCache
|
||||
{
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue