[ Index ]

PHP Cross Reference of phpBB-3.3.11-deutsch

title

Body

[close]

/phpbb/console/command/extension/ -> 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\extension;
  14  
  15  use Symfony\Component\Console\Input\InputArgument;
  16  use Symfony\Component\Console\Input\InputInterface;
  17  use Symfony\Component\Console\Output\OutputInterface;
  18  use Symfony\Component\Console\Style\SymfonyStyle;
  19  
  20  class purge extends command
  21  {
  22  	protected function configure()
  23      {
  24          $this
  25              ->setName('extension:purge')
  26              ->setDescription($this->user->lang('CLI_DESCRIPTION_PURGE_EXTENSION'))
  27              ->addArgument(
  28                  'extension-name',
  29                  InputArgument::REQUIRED,
  30                  $this->user->lang('CLI_EXTENSION_NAME')
  31              )
  32          ;
  33      }
  34  
  35  	protected function execute(InputInterface $input, OutputInterface $output)
  36      {
  37          $io = new SymfonyStyle($input, $output);
  38  
  39          $name = $input->getArgument('extension-name');
  40          $this->manager->purge($name);
  41          $this->manager->load_extensions();
  42  
  43          if ($this->manager->is_enabled($name))
  44          {
  45              $io->error($this->user->lang('CLI_EXTENSION_PURGE_FAILURE', $name));
  46              return 1;
  47          }
  48          else
  49          {
  50              $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_PURGE', time(), array($name));
  51              $this->check_apcu_cache($io);
  52              $io->success($this->user->lang('CLI_EXTENSION_PURGE_SUCCESS', $name));
  53              return 0;
  54          }
  55      }
  56  }


Generated: Sat Nov 4 14:26:03 2023 Cross-referenced by PHPXref 0.7.1