Config FollowUp
- New Configuration (Config is now only holding the instance) - New PConfiguration (PConfig is now only holding the instance) - Config & PConfig-Adapter don't need "ConfigCache" anymore - DB-Connection is now outside App->reload() for better dependency-chaining
This commit is contained in:
parent
c36a0eabdb
commit
eafcf3592d
59 changed files with 1754 additions and 1038 deletions
70
src/Core/Config/Cache/IPConfigCache.php
Normal file
70
src/Core/Config/Cache/IPConfigCache.php
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Core\Config\Cache;
|
||||
|
||||
/**
|
||||
* The interface for a user-specific config cache
|
||||
*/
|
||||
interface IPConfigCache
|
||||
{
|
||||
/**
|
||||
* Tries to load the specified configuration array into the user specific config array.
|
||||
* Doesn't overwrite previously set values by default to prevent default config files to supersede DB Config.
|
||||
*
|
||||
* @param int $uid
|
||||
* @param array $config
|
||||
*/
|
||||
function loadP($uid, array $config);
|
||||
|
||||
/**
|
||||
* Retrieves a value from the user config cache
|
||||
*
|
||||
* @param int $uid User Id
|
||||
* @param string $cat Config category
|
||||
* @param string $key Config key
|
||||
*
|
||||
* @return string The value of the config entry or '!<unset>!' if not set
|
||||
*/
|
||||
function getP($uid, $cat, $key = null);
|
||||
|
||||
/**
|
||||
* Sets a value in the user config cache
|
||||
*
|
||||
* Accepts raw output from the pconfig table
|
||||
*
|
||||
* @param int $uid User Id
|
||||
* @param string $cat Config category
|
||||
* @param string $key Config key
|
||||
* @param mixed $value Value to set
|
||||
*/
|
||||
function setP($uid, $cat, $key, $value);
|
||||
|
||||
/**
|
||||
* Deletes a value from the user config cache
|
||||
*
|
||||
* @param int $uid User Id
|
||||
* @param string $cat Config category
|
||||
* @param string $key Config key
|
||||
*
|
||||
* @return bool true, if deleted
|
||||
*/
|
||||
function deleteP($uid, $cat, $key);
|
||||
|
||||
|
||||
/**
|
||||
* Checks if a value is set in the user config cache.
|
||||
*
|
||||
* @param int $uid User Id
|
||||
* @param string $cat Config category
|
||||
* @param string $key Config key
|
||||
* @return bool
|
||||
*/
|
||||
function hasP($uid, $cat, $key = null);
|
||||
|
||||
/**
|
||||
* Returns the whole configuration cache
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getAll();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue