From 06ecb62abd5b1bee7ec25094e56968e28d2a29bf Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Tue, 6 May 2014 16:50:18 +0200 Subject: [ticket/12507] Add console command to purge the cache PHPBB3-12507 --- phpBB/phpbb/console/command/cache/purge.php | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 phpBB/phpbb/console/command/cache/purge.php (limited to 'phpBB/phpbb/console/command/cache') diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php new file mode 100644 index 0000000000..017bdc5144 --- /dev/null +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -0,0 +1,62 @@ +cache = $cache; + $this->db = $db; + $this->auth = $auth; + $this->log = $log; + $this->user = $user; + $this->user->add_lang(array('acp/common')); + parent::__construct(); + } + + protected function configure() + { + $this + ->setName('cache:purge') + ->setDescription('Purge the cache.') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->cache->purge(); + + // Clear permissions + $this->auth->acl_clear_prefetch(); + phpbb_cache_moderators($this->db, $this->cache, $this->auth); + + $this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array()); + + $output->writeln($this->user->lang('PURGE_CACHE_SUCCESS')); + } +} -- cgit v1.2.1 From f2471878a6f7ea2f6fd243520709f693e4260da7 Mon Sep 17 00:00:00 2001 From: n-aleha Date: Fri, 9 May 2014 00:30:09 +0300 Subject: [ticket/12476] Increase assets also from acp_styles and phpbbcli Increase assets also from "ACP > Styles > Purge Cache" and phpbbcli PHPBB3-12476 --- phpBB/phpbb/console/command/cache/purge.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/cache') 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 -- cgit v1.2.1 From 5dacd7ff5ba7826a1831f6b243fc3c5e8fb2ce0e Mon Sep 17 00:00:00 2001 From: n-aleha Date: Fri, 9 May 2014 00:54:20 +0300 Subject: [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(-) (limited to 'phpBB/phpbb/console/command/cache') 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; -- cgit v1.2.1 From a759704b39fc1c1353f865a633759b1369589b67 Mon Sep 17 00:00:00 2001 From: Yuriy Rusko Date: Tue, 27 May 2014 20:18:06 +0200 Subject: [ticket/12594] Remove @package tags and update file headers PHPBB3-12594 --- phpBB/phpbb/console/command/cache/purge.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/console/command/cache') diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 013183cb35..1e2adaeb4d 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -1,9 +1,13 @@ +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. * */ namespace phpbb\console\command\cache; -- cgit v1.2.1 From 6c9518ea3232d02605ea4bd57e1bf56a91d05855 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 4 Jun 2014 14:47:00 +0200 Subject: [ticket/12655] Don't require acp/common again in the commands PHPBB3-12655 --- phpBB/phpbb/console/command/cache/purge.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/phpbb/console/command/cache') diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 1e2adaeb4d..50953185a4 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -43,7 +43,6 @@ class purge extends \phpbb\console\command\command $this->log = $log; $this->user = $user; $this->config = $config; - $this->user->add_lang(array('acp/common')); parent::__construct(); } -- cgit v1.2.1 From 48b19ac37c8494f798f101f1964c6eb9996c2165 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 15 Jun 2014 12:18:55 +0200 Subject: [ticket/12715] Update console command cache:purge comments PHPBB3-12715 --- phpBB/phpbb/console/command/cache/purge.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'phpBB/phpbb/console/command/cache') diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 50953185a4..379d2aa1ca 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -35,6 +35,16 @@ class purge extends \phpbb\console\command\command /** @var \phpbb\config\config */ protected $config; + /** + * Constructor + * + * @param \phpbb\cache\driver\driver_interface $cache Cache instance + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param \phpbb\auth\auth $auth Auth instance + * @param \phpbb\log\log $log Logger instance + * @param \phpbb\user $user User instance + * @param \phpbb\config\config $config Config instance + */ 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; @@ -46,6 +56,9 @@ class purge extends \phpbb\console\command\command parent::__construct(); } + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -54,6 +67,16 @@ class purge extends \phpbb\console\command\command ; } + /** + * Executes the command cache:purge. + * + * Purge the cache (including permissions) and increment the asset_version number + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + */ protected function execute(InputInterface $input, OutputInterface $output) { $this->config->increment('assets_version', 1); -- cgit v1.2.1 From 07ce29c081c8bbd24a5094d89346be33dda583c5 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 17 Jul 2014 17:19:36 +0200 Subject: [ticket/12656] Pass user object into all console commands. PHPBB3-12656 --- phpBB/phpbb/console/command/cache/purge.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'phpBB/phpbb/console/command/cache') diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 379d2aa1ca..8c51d1b5a8 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -29,31 +29,27 @@ class purge extends \phpbb\console\command\command /** @var \phpbb\log\log */ protected $log; - /** @var \phpbb\user */ - protected $user; - /** @var \phpbb\config\config */ protected $config; /** * Constructor * + * @param \phpbb\user $user User instance * @param \phpbb\cache\driver\driver_interface $cache Cache instance * @param \phpbb\db\driver\driver_interface $db Database connection * @param \phpbb\auth\auth $auth Auth instance * @param \phpbb\log\log $log Logger instance - * @param \phpbb\user $user User instance * @param \phpbb\config\config $config Config instance */ - 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) + public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\config\config $config) { $this->cache = $cache; $this->db = $db; $this->auth = $auth; $this->log = $log; - $this->user = $user; $this->config = $config; - parent::__construct(); + parent::__construct($user); } /** -- cgit v1.2.1 From 4092b63be39453f9a7ce4f985217099ab10aae90 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 23 Jul 2014 00:35:09 +0530 Subject: [ticket/12656] Use lang keys for CLI command descriptions PHPBB3-12656 --- phpBB/phpbb/console/command/cache/purge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/cache') diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 8c51d1b5a8..ec8229200c 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -59,7 +59,7 @@ class purge extends \phpbb\console\command\command { $this ->setName('cache:purge') - ->setDescription('Purge the cache.') + ->setDescription($this->user->lang('PURGE_CACHE')) ; } -- cgit v1.2.1 From 4a76763a8a404a04f141825f572ff65620f400c4 Mon Sep 17 00:00:00 2001 From: LEZY Thomas Date: Wed, 4 Jun 2014 16:24:33 +0200 Subject: [ticket/12657] Add a test file for base case PHPBB3-12657 --- phpBB/phpbb/console/command/cache/purge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/console/command/cache') diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index ec8229200c..d0c2ef6f72 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -26,7 +26,7 @@ class purge extends \phpbb\console\command\command /** @var \phpbb\auth\auth */ protected $auth; - /** @var \phpbb\log\log */ + /** @var \phpbb\log\log_interface */ protected $log; /** @var \phpbb\config\config */ @@ -42,7 +42,7 @@ class purge extends \phpbb\console\command\command * @param \phpbb\log\log $log Logger instance * @param \phpbb\config\config $config Config instance */ - public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\config\config $config) + public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\config\config $config) { $this->cache = $cache; $this->db = $db; -- cgit v1.2.1