1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 20:24:08 +02:00
Files
build
git-tools
phpBB
adm
assets
bin
cache
config
develop
docs
download
files
images
includes
install
language
phpbb
auth
avatar
cache
config
console
command
config
command.php
delete.php
get.php
increment.php
set.php
set_atomic.php
extension
fixup
command.php
application.php
controller
cron
db
di
event
extension
feed
groupposition
hook
lock
log
notification
php
plupload
request
search
template
tree
class_loader.php
content_visibility.php
datetime.php
error_collector.php
filesystem.php
json_response.php
path_helper.php
permissions.php
session.php
symfony_request.php
user.php
user_loader.php
store
styles
.htaccess
app.php
common.php
composer.json
composer.lock
cron.php
faq.php
feed.php
index.php
mcp.php
memberlist.php
posting.php
report.php
search.php
ucp.php
viewforum.php
viewonline.php
viewtopic.php
web.config
tests
travis
.gitignore
.travis.yml
README.md
composer.phar
phpunit.xml.all
phpunit.xml.dist
phpunit.xml.functional
php-phpbb/phpBB/phpbb/console/command/config/increment.php
2013-11-27 14:16:34 +01:00

53 lines
1.3 KiB
PHP

<?php
/**
*
* @package phpBB3
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
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 increment extends command
{
protected function configure()
{
$this
->setName('config:increment')
->setDescription("Sets a configuration option's value")
->addArgument(
'key',
InputArgument::REQUIRED,
"The configuration option's name"
)
->addArgument(
'increment',
InputArgument::REQUIRED,
'Amount to increment by'
)
->addOption(
'dynamic',
'd',
InputOption::VALUE_NONE,
'Set this option if the configuration option changes too frequently to be efficiently cached.'
)
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$key = $input->getArgument('key');
$increment = $input->getArgument('increment');
$use_cache = !$input->getOption('dynamic');
$this->config->increment($key, $increment, $use_cache);
$output->writeln("<info>Successfully incremented config $key</info>");
}
}