[ticket/14257] Fix lock acquire in CLI command

PHPBB3-14257
This commit is contained in:
Oliver Schramm 2015-10-25 02:31:22 +02:00
parent c7ebbcf9f2
commit 8b0f8d7b3c

View file

@ -174,36 +174,34 @@ class reparse extends \phpbb\console\command\command
if (!$this->reparse_lock->acquire()) if (!$this->reparse_lock->acquire())
{ {
$this->load_resume_data(); throw new runtime_exception('REPARSE_LOCK_ERROR', array(), null, 1);
}
$name = $input->getArgument('reparser-name'); $this->load_resume_data();
if (isset($name))
$name = $input->getArgument('reparser-name');
if (isset($name))
{
// Allow "post_text" to be an alias for "text_reparser.post_text"
if (!isset($this->reparsers[$name]))
{ {
// Allow "post_text" to be an alias for "text_reparser.post_text" $name = 'text_reparser.' . $name;
if (!isset($this->reparsers[$name]))
{
$name = 'text_reparser.' . $name;
}
$this->reparse($name);
} }
else $this->reparse($name);
{
foreach ($this->reparsers as $name => $service)
{
$this->reparse($name);
}
}
$this->io->success($this->user->lang('CLI_REPARSER_REPARSE_SUCCESS'));
$this->reparse_lock->release();
return 0;
} }
else else
{ {
throw new runtime_exception('REPARSE_LOCK_ERROR', array(), null, 1); foreach ($this->reparsers as $name => $service)
{
$this->reparse($name);
}
} }
$this->io->success($this->user->lang('CLI_REPARSER_REPARSE_SUCCESS'));
$this->reparse_lock->release();
return 0;
} }
/** /**