From e6749261f1797cd4bb9b93398ed92ae5d9c32b26 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 27 Nov 2013 14:16:34 +0100 Subject: [ticket/12039] Use an abstract class and some more minor adjustments PHPBB3-12039 --- phpBB/phpbb/console/command/config/get.php | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 phpBB/phpbb/console/command/config/get.php (limited to 'phpBB/phpbb/console/command/config/get.php') diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php new file mode 100644 index 0000000000..aeb40cff16 --- /dev/null +++ b/phpBB/phpbb/console/command/config/get.php @@ -0,0 +1,44 @@ +setName('config:get') + ->setDescription("Gets a configuration option's value") + ->addArgument( + 'key', + InputArgument::REQUIRED, + "The configuration option's name" + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $key = $input->getArgument('key'); + + if (isset($this->config[$key])) + { + $output->writeln("{$this->config[$key]}"); + } + else + { + $output->writeln("Could not get config $key"); + } + } +} -- cgit v1.2.1 From 52c452c768b30fa479e91faee548abf5038f2642 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 8 Jan 2014 23:56:50 +0100 Subject: [ticket/12039] Do not colour returned value in get command PHPBB3-12039 --- phpBB/phpbb/console/command/config/get.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/get.php') diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index aeb40cff16..1f9781ea9c 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -34,7 +34,7 @@ class get extends command if (isset($this->config[$key])) { - $output->writeln("{$this->config[$key]}"); + $output->writeln($this->config[$key]); } else { -- cgit v1.2.1 From a70973ea423fda2a26fc8ff17e6e9c33bee11547 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 9 Jan 2014 00:05:32 +0100 Subject: [ticket/12039] Allow getting the value without a new line at the end PHPBB3-12039 --- phpBB/phpbb/console/command/config/get.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/get.php') diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index 1f9781ea9c..275c82b53f 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -25,6 +25,12 @@ class get extends command InputArgument::REQUIRED, "The configuration option's name" ) + ->addOption( + 'no-newline', + null, + InputOption::VALUE_NONE, + 'Set this option if the value should be printed without a new line at the end.' + ) ; } @@ -32,7 +38,11 @@ class get extends command { $key = $input->getArgument('key'); - if (isset($this->config[$key])) + if (isset($this->config[$key]) && $input->getOption('no-newline')) + { + $output->write($this->config[$key]); + } + elseif (isset($this->config[$key])) { $output->writeln($this->config[$key]); } -- cgit v1.2.1 From a759704b39fc1c1353f865a633759b1369589b67 Mon Sep 17 00:00:00 2001 From: Yuriy Rusko Date: Tue, 27 May 2014 20:18:06 +0200 Subject: [ticket/12594] Remove @package tags and update file headers PHPBB3-12594 --- phpBB/phpbb/console/command/config/get.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/console/command/config/get.php') diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index 275c82b53f..0ed2a12608 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -1,9 +1,13 @@ +* @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; -- cgit v1.2.1 From 413754af1f2d10aae366f8255d0d91ec7e6fd878 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 15 Jun 2014 12:19:24 +0200 Subject: [ticket/12715] Update console command config:* comments PHPBB3-12715 --- phpBB/phpbb/console/command/config/get.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'phpBB/phpbb/console/command/config/get.php') diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index 0ed2a12608..20164f0da1 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -19,6 +19,9 @@ use Symfony\Component\Console\Output\OutputInterface; class get extends command { + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -38,6 +41,17 @@ class get extends command ; } + /** + * 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'); -- cgit v1.2.1 From 09fc008e62453352cb34f4391acda310ea8b41c7 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 15 Jun 2014 21:34:02 +0200 Subject: [ticket/12721] Add Squiz.ControlStructures.ElseIfDeclaration in legacy PHPBB3-12721 --- phpBB/phpbb/console/command/config/get.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/get.php') diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index 20164f0da1..ee8c65110e 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -60,7 +60,7 @@ 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]); } -- cgit v1.2.1 From 4092b63be39453f9a7ce4f985217099ab10aae90 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 23 Jul 2014 00:35:09 +0530 Subject: [ticket/12656] Use lang keys for CLI command descriptions PHPBB3-12656 --- phpBB/phpbb/console/command/config/get.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/get.php') diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index ee8c65110e..9734833d23 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -26,7 +26,7 @@ class get extends command { $this ->setName('config:get') - ->setDescription("Gets a configuration option's value") + ->setDescription($this->user->lang('CLI_DESCRIPTION_GET_CONFIG')) ->addArgument( 'key', InputArgument::REQUIRED, -- cgit v1.2.1 From c81438e1f85633dd770fcddd8e332b278338732f Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 23 Jul 2014 01:23:44 +0530 Subject: [ticket/12656] Use lang keys for all CLI strings PHPBB3-12656 --- phpBB/phpbb/console/command/config/get.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/console/command/config/get.php') diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index 9734833d23..9c03b49a3d 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -30,13 +30,13 @@ class get extends command ->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') ) ; } @@ -66,7 +66,7 @@ class get extends command } else { - $output->writeln("Could not get config $key"); + $output->writeln('' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . ''); } } } -- cgit v1.2.1