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