[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/console/command/config/ -> increment.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\Input\InputOption;
  18  use Symfony\Component\Console\Output\OutputInterface;
  19  
  20  class increment extends command
  21  {
  22      /**
  23      * {@inheritdoc}
  24      */
  25  	protected function configure()
  26      {
  27          $this
  28              ->setName('config:increment')
  29              ->setDescription($this->user->lang('CLI_DESCRIPTION_INCREMENT_CONFIG'))
  30              ->addArgument(
  31                  'key',
  32                  InputArgument::REQUIRED,
  33                  $this->user->lang('CLI_CONFIG_OPTION_NAME')
  34              )
  35              ->addArgument(
  36                  'increment',
  37                  InputArgument::REQUIRED,
  38                  $this->user->lang('CLI_CONFIG_INCREMENT_BY')
  39              )
  40              ->addOption(
  41                  'dynamic',
  42                  'd',
  43                  InputOption::VALUE_NONE,
  44                  $this->user->lang('CLI_CONFIG_CANNOT_CACHED')
  45              )
  46          ;
  47      }
  48  
  49      /**
  50      * Executes the command config:increment.
  51      *
  52      * Increments an integer configuration value.
  53      *
  54      * @param InputInterface  $input  An InputInterface instance
  55      * @param OutputInterface $output An OutputInterface instance
  56      *
  57      * @return null
  58      * @see \phpbb\config\config::increment()
  59      */
  60  	protected function execute(InputInterface $input, OutputInterface $output)
  61      {
  62          $key = $input->getArgument('key');
  63          $increment = $input->getArgument('increment');
  64          $use_cache = !$input->getOption('dynamic');
  65  
  66          $this->config->increment($key, $increment, $use_cache);
  67  
  68          $output->writeln('<info>' . $this->user->lang('CLI_CONFIG_INCREMENT_SUCCESS', $key) . '</info>');
  69      }
  70  }


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