[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/console/command/config/ -> delete.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\config;
  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 delete extends command
  20  {
  21      /**
  22      * {@inheritdoc}
  23      */
  24  	protected function configure()
  25      {
  26          $this
  27              ->setName('config:delete')
  28              ->setDescription($this->user->lang('CLI_DESCRIPTION_DELETE_CONFIG'))
  29              ->addArgument(
  30                  'key',
  31                  InputArgument::REQUIRED,
  32                  $this->user->lang('CLI_CONFIG_OPTION_NAME')
  33              )
  34          ;
  35      }
  36  
  37      /**
  38      * Executes the command config:delete.
  39      *
  40      * Removes a configuration option
  41      *
  42      * @param InputInterface  $input  An InputInterface instance
  43      * @param OutputInterface $output An OutputInterface instance
  44      *
  45      * @return null
  46      * @see \phpbb\config\config::delete()
  47      */
  48  	protected function execute(InputInterface $input, OutputInterface $output)
  49      {
  50          $key = $input->getArgument('key');
  51  
  52          if (isset($this->config[$key]))
  53          {
  54              $this->config->delete($key);
  55  
  56              $output->writeln('<info>' . $this->user->lang('CLI_CONFIG_DELETE_SUCCESS', $key) . '</info>');
  57          }
  58          else
  59          {
  60              $output->writeln('<error>' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . '</error>');
  61          }
  62      }
  63  }


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