[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/console/command/extension/ -> enable.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  
  19  class enable extends command
  20  {
  21  	protected function configure()
  22      {
  23          $this
  24              ->setName('extension:enable')
  25              ->setDescription($this->user->lang('CLI_DESCRIPTION_ENABLE_EXTENSION'))
  26              ->addArgument(
  27                  'extension-name',
  28                  InputArgument::REQUIRED,
  29                  $this->user->lang('CLI_EXTENSION_NAME')
  30              )
  31          ;
  32      }
  33  
  34  	protected function execute(InputInterface $input, OutputInterface $output)
  35      {
  36          $name = $input->getArgument('extension-name');
  37          $this->manager->enable($name);
  38          $this->manager->load_extensions();
  39  
  40          if ($this->manager->is_enabled($name))
  41          {
  42              $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name));
  43              $output->writeln('<info>' . $this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name) . '</info>');
  44              return 0;
  45          }
  46          else
  47          {
  48              $output->writeln('<error>' . $this->user->lang('CLI_EXTENSION_ENABLE_FAILURE', $name) . '</error>');
  49              return 1;
  50          }
  51      }
  52  }


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1