Bugfixing PConfig
This commit is contained in:
parent
8b70ae6d46
commit
f3da5b3a2f
4 changed files with 10 additions and 8 deletions
|
@ -375,7 +375,7 @@ class App
|
|||
$adapterType = $this->config->get('system', 'config_adapter');
|
||||
$adapter = ConfigFactory::createConfig($adapterType, $this->config);
|
||||
Core\Config::setAdapter($adapter);
|
||||
$adapterP = ConfigFactory::createConfig($adapterType, $this->config);
|
||||
$adapterP = ConfigFactory::createPConfig($adapterType, $this->config);
|
||||
Core\PConfig::setAdapter($adapterP);
|
||||
Core\Config::load();
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ class ConfigCache implements IConfigCache, IPConfigCache
|
|||
|
||||
if (isset($this->config[$uid][$cat][$key])) {
|
||||
$return = $this->config[$uid][$cat][$key];
|
||||
} elseif ($key == null && isset($this->config[$uid][$cat])) {
|
||||
} elseif ($key === null && isset($this->config[$uid][$cat])) {
|
||||
$return = $this->config[$uid][$cat];
|
||||
}
|
||||
|
||||
|
|
|
@ -23,13 +23,15 @@ class PreloadPConfigAdapter implements IPConfigAdapter
|
|||
private $config;
|
||||
|
||||
/**
|
||||
* @param int $uid The UID of the current user
|
||||
* @param IPConfigCache $config The config cache of this adapter
|
||||
* @param int $uid The UID of the current user
|
||||
*/
|
||||
public function __construct($uid, $config)
|
||||
public function __construct($config, $uid = null)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->load($uid, 'config');
|
||||
if (isset($uid)) {
|
||||
$this->load($uid, 'config');
|
||||
}
|
||||
}
|
||||
|
||||
public function load($uid, $family)
|
||||
|
|
|
@ -36,15 +36,15 @@ class ConfigFactory
|
|||
|
||||
/**
|
||||
* @param string $type The adapter type
|
||||
* @param int $uid The UID of the current user
|
||||
* @param Config\IPConfigCache $config The config cache of this adapter
|
||||
* @param int $uid The UID of the current user
|
||||
*
|
||||
* @return Config\IPConfigAdapter
|
||||
*/
|
||||
public static function createPConfig($type, $uid, $config)
|
||||
public static function createPConfig($type, $config, $uid = null)
|
||||
{
|
||||
if ($type == 'preload') {
|
||||
return new Config\PreloadPConfigAdapter($uid, $config);
|
||||
return new Config\PreloadPConfigAdapter($config, $uid);
|
||||
} else {
|
||||
return new Config\JITPConfigAdapter($config);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue