mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-18 15:41:26 +02:00
[ticket/13700] Add method for initializing config after cache purge
PHPBB3-13700
This commit is contained in:
@@ -49,6 +49,13 @@ class db extends \phpbb\config\config
|
|||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
$this->table = $table;
|
$this->table = $table;
|
||||||
|
|
||||||
|
$this->initialise($cache);
|
||||||
|
|
||||||
|
parent::__construct($this->config);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initialise(\phpbb\cache\driver\driver_interface $cache)
|
||||||
|
{
|
||||||
if (($config = $cache->get('config')) !== false)
|
if (($config = $cache->get('config')) !== false)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT config_name, config_value
|
$sql = 'SELECT config_name, config_value
|
||||||
@@ -84,7 +91,7 @@ class db extends \phpbb\config\config
|
|||||||
$cache->put('config', $cached_config);
|
$cache->put('config', $cached_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::__construct($config);
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -58,6 +58,10 @@ class migrate extends \phpbb\console\command\db\migration_command
|
|||||||
$this->migrator->create_migrations_table();
|
$this->migrator->create_migrations_table();
|
||||||
|
|
||||||
$this->cache->purge();
|
$this->cache->purge();
|
||||||
|
if ($this->config instanceof \phpbb\config\db)
|
||||||
|
{
|
||||||
|
$this->config->initialise($this->cache->get_driver());
|
||||||
|
}
|
||||||
|
|
||||||
$this->load_migrations();
|
$this->load_migrations();
|
||||||
$orig_version = $this->config['version'];
|
$orig_version = $this->config['version'];
|
||||||
|
Reference in New Issue
Block a user