mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-15 12:05:21 +02:00
[ticket/11768] Invalidate the text_formatter cache whenever a style is installed
The acp_styles module purges the cache every time a style is uninstalled, modified or made default, but it does not purge the cache when a new style is installed. Here we invalidate the text_formatter cache (not purge the whole cache) so that new styles take effect immediately. PHPBB3-11768
This commit is contained in:
parent
1a133d5487
commit
ec77ff7838
@ -53,6 +53,9 @@ class acp_styles
|
|||||||
/** @var \phpbb\auth\auth */
|
/** @var \phpbb\auth\auth */
|
||||||
protected $auth;
|
protected $auth;
|
||||||
|
|
||||||
|
/** @var \phpbb\textformatter\cache */
|
||||||
|
protected $text_formatter_cache;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $phpbb_root_path;
|
protected $phpbb_root_path;
|
||||||
|
|
||||||
@ -61,7 +64,7 @@ class acp_styles
|
|||||||
|
|
||||||
public function main($id, $mode)
|
public function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config;
|
global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config, $phpbb_container;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
@ -69,6 +72,7 @@ class acp_styles
|
|||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
|
$this->text_formatter_cache = $phpbb_container->get('text_formatter.cache');
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = $phpEx;
|
$this->php_ext = $phpEx;
|
||||||
@ -216,6 +220,12 @@ class acp_styles
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Invalidate the text formatter's cache for the new styles to take effect
|
||||||
|
if (!empty($installed_names))
|
||||||
|
{
|
||||||
|
$this->text_formatter_cache->invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
// Show message
|
// Show message
|
||||||
if (!count($messages))
|
if (!count($messages))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user