mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/14257] Fix lock acquire in CLI command
PHPBB3-14257
This commit is contained in:
parent
c7ebbcf9f2
commit
8b0f8d7b3c
1 changed files with 21 additions and 23 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue