[ Index ] |
PHP Cross Reference of phpBB-3.1.12-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of the phpBB Forum Software package. 5 * 6 * @copyright (c) phpBB Limited <https://www.phpbb.com> 7 * @license GNU General Public License, version 2 (GPL-2.0) 8 * 9 * For full copyright and license information, please see 10 * the docs/CREDITS.txt file. 11 * 12 */ 13 namespace phpbb\console\command\cache; 14 15 use Symfony\Component\Console\Input\InputInterface; 16 use Symfony\Component\Console\Output\OutputInterface; 17 18 class purge extends \phpbb\console\command\command 19 { 20 /** @var \phpbb\cache\driver\driver_interface */ 21 protected $cache; 22 23 /** @var \phpbb\db\driver\driver_interface */ 24 protected $db; 25 26 /** @var \phpbb\auth\auth */ 27 protected $auth; 28 29 /** @var \phpbb\log\log_interface */ 30 protected $log; 31 32 /** @var \phpbb\config\config */ 33 protected $config; 34 35 /** 36 * Constructor 37 * 38 * @param \phpbb\user $user User instance 39 * @param \phpbb\cache\driver\driver_interface $cache Cache instance 40 * @param \phpbb\db\driver\driver_interface $db Database connection 41 * @param \phpbb\auth\auth $auth Auth instance 42 * @param \phpbb\log\log $log Logger instance 43 * @param \phpbb\config\config $config Config instance 44 */ 45 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) 46 { 47 $this->cache = $cache; 48 $this->db = $db; 49 $this->auth = $auth; 50 $this->log = $log; 51 $this->config = $config; 52 parent::__construct($user); 53 } 54 55 /** 56 * {@inheritdoc} 57 */ 58 protected function configure() 59 { 60 $this 61 ->setName('cache:purge') 62 ->setDescription($this->user->lang('PURGE_CACHE')) 63 ; 64 } 65 66 /** 67 * Executes the command cache:purge. 68 * 69 * Purge the cache (including permissions) and increment the asset_version number 70 * 71 * @param InputInterface $input An InputInterface instance 72 * @param OutputInterface $output An OutputInterface instance 73 * 74 * @return null 75 */ 76 protected function execute(InputInterface $input, OutputInterface $output) 77 { 78 $this->config->increment('assets_version', 1); 79 $this->cache->purge(); 80 81 // Clear permissions 82 $this->auth->acl_clear_prefetch(); 83 phpbb_cache_moderators($this->db, $this->cache, $this->auth); 84 85 $this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array()); 86 87 $output->writeln($this->user->lang('PURGE_CACHE_SUCCESS')); 88 } 89 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Jan 11 00:25:41 2018 | Cross-referenced by PHPXref 0.7.1 |