[ Index ]

PHP Cross Reference of phpBB-3.3.3-deutsch

title

Body

[close]

/phpbb/console/command/cache/ -> purge.php (source)

   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  use Symfony\Component\Console\Style\SymfonyStyle;
  18  
  19  class purge extends \phpbb\console\command\command
  20  {
  21      /** @var \phpbb\cache\driver\driver_interface */
  22      protected $cache;
  23  
  24      /** @var \phpbb\db\driver\driver_interface */
  25      protected $db;
  26  
  27      /** @var \phpbb\auth\auth */
  28      protected $auth;
  29  
  30      /** @var \phpbb\log\log_interface */
  31      protected $log;
  32  
  33      /** @var \phpbb\config\config */
  34      protected $config;
  35  
  36      /**
  37      * Constructor
  38      *
  39      * @param \phpbb\user                            $user    User instance
  40      * @param \phpbb\cache\driver\driver_interface    $cache    Cache instance
  41      * @param \phpbb\db\driver\driver_interface        $db        Database connection
  42      * @param \phpbb\auth\auth                        $auth    Auth instance
  43      * @param \phpbb\log\log_interface                $log    Logger instance
  44      * @param \phpbb\config\config                    $config    Config instance
  45      */
  46  	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)
  47      {
  48          $this->cache = $cache;
  49          $this->db = $db;
  50          $this->auth = $auth;
  51          $this->log = $log;
  52          $this->config = $config;
  53          parent::__construct($user);
  54      }
  55  
  56      /**
  57      * {@inheritdoc}
  58      */
  59  	protected function configure()
  60      {
  61          $this
  62              ->setName('cache:purge')
  63              ->setDescription($this->user->lang('PURGE_CACHE'))
  64          ;
  65      }
  66  
  67      /**
  68      * Executes the command cache:purge.
  69      *
  70      * Purge the cache (including permissions) and increment the asset_version number
  71      *
  72      * @param InputInterface  $input  An InputInterface instance
  73      * @param OutputInterface $output An OutputInterface instance
  74      *
  75      * @return void
  76      */
  77  	protected function execute(InputInterface $input, OutputInterface $output)
  78      {
  79          $this->config->increment('assets_version', 1);
  80          $this->cache->purge();
  81  
  82          // Clear permissions
  83          $this->auth->acl_clear_prefetch();
  84          phpbb_cache_moderators($this->db, $this->cache, $this->auth);
  85  
  86          $this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array());
  87  
  88          $io = new SymfonyStyle($input, $output);
  89          $io->success($this->user->lang('PURGE_CACHE_SUCCESS'));
  90      }
  91  }


Generated: Sun Feb 14 20:08:31 2021 Cross-referenced by PHPXref 0.7.1