From cfc0c9bcf9cc08f19b0f3234bbf1d5d32519c821 Mon Sep 17 00:00:00 2001 From: n-aleha Date: Thu, 8 May 2014 23:16:10 +0300 Subject: [PATCH 1/3] [ticket/12476] Increase asset version on cache purge Increace the asset version when purging the cache from "ACP > General" PHPBB3-12476 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 9c1613e24a..74ea095496 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -349,7 +349,7 @@ class acp_main break; case 'purge_cache': - global $cache; + $config->increment('assets_version', 1); $cache->purge(); // Clear permissions From f2471878a6f7ea2f6fd243520709f693e4260da7 Mon Sep 17 00:00:00 2001 From: n-aleha Date: Fri, 9 May 2014 00:30:09 +0300 Subject: [PATCH 2/3] [ticket/12476] Increase assets also from acp_styles and phpbbcli Increase assets also from "ACP > Styles > Purge Cache" and phpbbcli PHPBB3-12476 --- phpBB/config/console.yml | 1 + phpBB/includes/acp/acp_styles.php | 1 + phpBB/phpbb/console/command/cache/purge.php | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml index 1340d9c0d7..d32befa15e 100644 --- a/phpBB/config/console.yml +++ b/phpBB/config/console.yml @@ -7,6 +7,7 @@ services: - @auth - @log - @user + - @config tags: - { name: console.command } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 3f9d21f56c..7b277da9f9 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -146,6 +146,7 @@ class acp_styles { global $db, $cache, $auth; + $this->config->increment('assets_version', 1); $this->cache->purge(); // Clear permissions diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 017bdc5144..9c880a859f 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -28,13 +28,17 @@ class purge extends \phpbb\console\command\command /** @var \phpbb\user */ protected $user; - function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user) + /** @var \phpbb\config\config */ + protected $config; + + function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user, \phpbb\config\config $config) { $this->cache = $cache; $this->db = $db; $this->auth = $auth; $this->log = $log; $this->user = $user; + $this->config = $config; $this->user->add_lang(array('acp/common')); parent::__construct(); } @@ -49,6 +53,7 @@ class purge extends \phpbb\console\command\command protected function execute(InputInterface $input, OutputInterface $output) { + $this->config->increment('assets_version', 1); $this->cache->purge(); // Clear permissions From 5dacd7ff5ba7826a1831f6b243fc3c5e8fb2ce0e Mon Sep 17 00:00:00 2001 From: n-aleha Date: Fri, 9 May 2014 00:54:20 +0300 Subject: [PATCH 3/3] [ticket/12476] Label the constructor as public Label the the constructor as public. PHPBB3-12476 --- phpBB/phpbb/console/command/cache/purge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 9c880a859f..013183cb35 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -31,7 +31,7 @@ class purge extends \phpbb\console\command\command /** @var \phpbb\config\config */ protected $config; - function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user, \phpbb\config\config $config) + public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user, \phpbb\config\config $config) { $this->cache = $cache; $this->db = $db;