diff options
Diffstat (limited to 'phpBB/phpbb/console/command/config/get.php')
-rw-r--r-- | phpBB/phpbb/console/command/config/get.php | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index 275c82b53f..9c03b49a3d 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -1,9 +1,13 @@ <?php /** * -* @package phpBB3 -* @copyright (c) 2013 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. * */ namespace phpbb\console\command\config; @@ -15,25 +19,39 @@ use Symfony\Component\Console\Output\OutputInterface; class get extends command { + /** + * {@inheritdoc} + */ protected function configure() { $this ->setName('config:get') - ->setDescription("Gets a configuration option's value") + ->setDescription($this->user->lang('CLI_DESCRIPTION_GET_CONFIG')) ->addArgument( 'key', InputArgument::REQUIRED, - "The configuration option's name" + $this->user->lang('CLI_CONFIG_OPTION_NAME') ) ->addOption( 'no-newline', null, InputOption::VALUE_NONE, - 'Set this option if the value should be printed without a new line at the end.' + $this->user->lang('CLI_CONFIG_PRINT_WITHOUT_NEWLINE') ) ; } + /** + * Executes the command config:get. + * + * Retrieves a configuration value. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::offsetGet() + */ protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('key'); @@ -42,13 +60,13 @@ class get extends command { $output->write($this->config[$key]); } - elseif (isset($this->config[$key])) + else if (isset($this->config[$key])) { $output->writeln($this->config[$key]); } else { - $output->writeln("<error>Could not get config $key</error>"); + $output->writeln('<error>' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . '</error>'); } } } |