From d5743f008d9221f4199570fb0a6cb63d0cf88038 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 26 Nov 2013 18:11:54 +0100 Subject: [ticket/12039] Add config:* to the command line interface tool PHPBB3-12039 --- phpBB/phpbb/console/command/config/delete.php | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 phpBB/phpbb/console/command/config/delete.php (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php new file mode 100644 index 0000000000..1f397904ca --- /dev/null +++ b/phpBB/phpbb/console/command/config/delete.php @@ -0,0 +1,56 @@ +config = $config; + + parent::__construct(); + } + + protected function configure() + { + $this + ->setName('config:delete') + ->setDescription('Sets a configuration option\'s value') + ->addArgument( + 'config-key', + InputArgument::REQUIRED, + 'The configuration option\'s name' + ) + ->addArgument( + 'use-cache', + InputArgument::OPTIONAL, + 'Whether this variable should be cached or if it changes too frequently to be efficiently cached.', + true + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $key = $input->getArgument('config-key'); + $use_cache = $input->getArgument('use-cache'); + $use_cache = (strtolower($use_cache) !== 'false' && $use_cache); + + $this->config->delete($key, $use_cache); + + $output->writeln("Successfully deleted config $key"); + } +} -- cgit v1.2.1 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/delete.php | 31 ++++++--------------------- 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index 1f397904ca..2b53f27098 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -10,46 +10,29 @@ namespace phpbb\console\command\config; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class delete extends \phpbb\console\command\command +class delete extends command { - /** @var \phpbb\config\config */ - protected $config; - - function __construct(\phpbb\config\config $config) - { - $this->config = $config; - - parent::__construct(); - } - protected function configure() { $this ->setName('config:delete') - ->setDescription('Sets a configuration option\'s value') + ->setDescription("Sets a configuration option's value") ->addArgument( - 'config-key', + 'key', InputArgument::REQUIRED, - 'The configuration option\'s name' - ) - ->addArgument( - 'use-cache', - InputArgument::OPTIONAL, - 'Whether this variable should be cached or if it changes too frequently to be efficiently cached.', - true + "The configuration option's name" ) ; } protected function execute(InputInterface $input, OutputInterface $output) { - $key = $input->getArgument('config-key'); - $use_cache = $input->getArgument('use-cache'); - $use_cache = (strtolower($use_cache) !== 'false' && $use_cache); + $key = $input->getArgument('key'); - $this->config->delete($key, $use_cache); + $this->config->delete($key); $output->writeln("Successfully deleted config $key"); } -- cgit v1.2.1 From de727b80e285970c0e770c8597c6b56adb513a4d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 27 Nov 2013 15:16:40 +0100 Subject: [ticket/12039] Fix option descriptions PHPBB3-12039 --- phpBB/phpbb/console/command/config/delete.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index 2b53f27098..af3d189445 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -19,7 +19,7 @@ class delete extends command { $this ->setName('config:delete') - ->setDescription("Sets a configuration option's value") + ->setDescription("Deletes a configuration option") ->addArgument( 'key', InputArgument::REQUIRED, -- cgit v1.2.1 From 98200161fc642ce447395a4b8db3b1a3c674c734 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 26 Dec 2013 19:03:43 +0100 Subject: [ticket/12039] Update command descriptions PHPBB3-12039 --- phpBB/phpbb/console/command/config/delete.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index af3d189445..5dbeeff20f 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -19,7 +19,7 @@ class delete extends command { $this ->setName('config:delete') - ->setDescription("Deletes a configuration option") + ->setDescription('Deletes a configuration option') ->addArgument( 'key', InputArgument::REQUIRED, -- cgit v1.2.1 From 5d89c283f0dfbce0f615432671628d9d10736334 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 8 Jan 2014 23:59:46 +0100 Subject: [ticket/12039] Do not print success message when config did not exist PHPBB3-12039 --- phpBB/phpbb/console/command/config/delete.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index 5dbeeff20f..9a2d00561d 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -32,8 +32,15 @@ class delete extends command { $key = $input->getArgument('key'); - $this->config->delete($key); + if (isset($this->config[$key])) + { + $this->config->delete($key); - $output->writeln("Successfully deleted config $key"); + $output->writeln("Successfully deleted config $key"); + } + else + { + $output->writeln("Config $key does not exist"); + } } } -- 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/delete.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index 9a2d00561d..e29afdbf82 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.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/delete.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index e29afdbf82..1310bb18b4 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -14,11 +14,13 @@ namespace phpbb\console\command\config; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class delete extends command { + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -32,6 +34,17 @@ class delete extends command ; } + /** + * Executes the command config:delete. + * + * Removes a configuration option + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::delete() + */ protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('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/delete.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index 1310bb18b4..2fca8f6831 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -25,7 +25,7 @@ class delete extends command { $this ->setName('config:delete') - ->setDescription('Deletes a configuration option') + ->setDescription($this->user->lang('CLI_DESCRIPTION_DELETE_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/delete.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index 2fca8f6831..7923afd182 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -29,7 +29,7 @@ class delete extends command ->addArgument( 'key', InputArgument::REQUIRED, - "The configuration option's name" + $this->user->lang('CLI_CONFIG_OPTION_NAME') ) ; } @@ -53,11 +53,11 @@ class delete extends command { $this->config->delete($key); - $output->writeln("Successfully deleted config $key"); + $output->writeln('' . $this->user->lang('CLI_CONFIG_DELETE_SUCCESS', $key) . ''); } else { - $output->writeln("Config $key does not exist"); + $output->writeln('' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . '''); } } } -- cgit v1.2.1 From 653185610873e4629ffc929ace2b72e2fe41704d Mon Sep 17 00:00:00 2001 From: Dhruv Date: Thu, 24 Jul 2014 01:12:40 +0530 Subject: [ticket/12656] Fix typo PHPBB3-12656 --- phpBB/phpbb/console/command/config/delete.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/config/delete.php') diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index 7923afd182..efd276d7e3 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -57,7 +57,7 @@ class delete extends command } else { - $output->writeln('' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . '''); + $output->writeln('' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . ''); } } } -- cgit v1.2.1