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
*
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
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
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
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
public function get($uid, $cat, $key)
{
if (!$this->isConnected()) {
- return null;
+ return '!<unset>!';
}
$pconfig = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $key]);
public function get($cat, $key)
{
if (!$this->isConnected()) {
- return null;
+ return '!<unset>!';
}
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $key]);
public function get($uid, $cat, $key)
{
if (!$this->isConnected()) {
- return null;
+ return '!<unset>!';
}
if (!$this->config_loaded) {
*
* @param LoggerInterface $logger The Logger instance of this Application
*/
- public static function init($logger)
+ public static function init(LoggerInterface $logger)
{
self::$logger = $logger;
}
*
* @param LoggerInterface $logger The Logger instance of this Application
*/
- public static function setDevLogger($logger)
+ public static function setDevLogger(LoggerInterface $logger)
{
self::$devLogger = $logger;
}