[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Summary view] [Print] [Text view]
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 use Symfony\Component\Console\Style\SymfonyStyle; 20 21 class increment extends command 22 { 23 /** 24 * {@inheritdoc} 25 */ 26 protected function configure() 27 { 28 $this 29 ->setName('config:increment') 30 ->setDescription($this->user->lang('CLI_DESCRIPTION_INCREMENT_CONFIG')) 31 ->addArgument( 32 'key', 33 InputArgument::REQUIRED, 34 $this->user->lang('CLI_CONFIG_OPTION_NAME') 35 ) 36 ->addArgument( 37 'increment', 38 InputArgument::REQUIRED, 39 $this->user->lang('CLI_CONFIG_INCREMENT_BY') 40 ) 41 ->addOption( 42 'dynamic', 43 'd', 44 InputOption::VALUE_NONE, 45 $this->user->lang('CLI_CONFIG_CANNOT_CACHED') 46 ) 47 ; 48 } 49 50 /** 51 * Executes the command config:increment. 52 * 53 * Increments an integer configuration value. 54 * 55 * @param InputInterface $input An InputInterface instance 56 * @param OutputInterface $output An OutputInterface instance 57 * 58 * @return void 59 * @see \phpbb\config\config::increment() 60 */ 61 protected function execute(InputInterface $input, OutputInterface $output) 62 { 63 $io = new SymfonyStyle($input, $output); 64 65 $key = $input->getArgument('key'); 66 $increment = $input->getArgument('increment'); 67 $use_cache = !$input->getOption('dynamic'); 68 69 $this->config->increment($key, $increment, $use_cache); 70 71 $io->success($this->user->lang('CLI_CONFIG_INCREMENT_SUCCESS', $key)); 72 } 73 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |