* @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;
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 set_atomic extends command
{
protected function configure()
{
$this
->setName('config:set-atomic')
->setDescription("Sets a configuration option's value only if the old matches the current value.")
->addArgument(
'key',
InputArgument::REQUIRED,
"The configuration option's name"
)
->addArgument(
'old',
InputArgument::REQUIRED,
'Current configuration value, use 0 and 1 to specify boolean values'
)
->addArgument(
'new',
InputArgument::REQUIRED,
'New configuration value, use 0 and 1 to specify boolean values'
)
->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');
$old_value = $input->getArgument('old');
$new_value = $input->getArgument('new');
$use_cache = !$input->getOption('dynamic');
if ($this->config->set_atomic($key, $old_value, $new_value, $use_cache))
{
$output->writeln("Successfully set config $key");
return 0;
}
else
{
$output->writeln("Could not set config $key");
return 1;
}
}
}
:;(ȧ,:TXS]bu1>3G!u)]^t)r[?lQj_!HB6G}xrMJKrnhϫ7s\_*29@{P[ uQh ;h SÏvr775ɭ.HBlWsK[1LUYZ ^5;cp>
5łyAџBFQM1EDx$Nj ΗHdR;&&솵(vse0Jge]S\}IHӬH'A拰YeVON_oF{Q:tg[A[3rv^kGnC=܉ #u~G;̅MZ.7ZyS uY\(ϓQa. PYPNjlrsZc(O#s4N.{RwcJfaQgs
d6
sJkLl _?4fN@X$ҭ6yDHl @>bmg$^YsTN"wfK5Zr\_/)C7A8PV[ω4TPou$07Z HL}1@xfݿKA^/5Pπm+@T3LJN@ƋLt5\*wU'u)KNh\œ|g-үWZHk*!F
L'֘,$B6܌Rwz^zJzk[P &[=ѤUcW} mEGL=H(] ԑФHn ڳ`+E~}fOA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