diff options
author | Oliver Schramm <oliver.schramm97@gmail.com> | 2015-10-25 02:31:22 +0200 |
---|---|---|
committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2015-10-25 02:32:19 +0200 |
commit | 8b0f8d7b3cf7e7687f11c2fc0a15d4919c91b6c1 (patch) | |
tree | c1cb036587ff2ee86bfd5264232ee497dd5e3c59 /phpBB/phpbb/console | |
parent | c7ebbcf9f2bf8670ac219fd919f6ee37c5aeb37f (diff) | |
download | forums-8b0f8d7b3cf7e7687f11c2fc0a15d4919c91b6c1.tar forums-8b0f8d7b3cf7e7687f11c2fc0a15d4919c91b6c1.tar.gz forums-8b0f8d7b3cf7e7687f11c2fc0a15d4919c91b6c1.tar.bz2 forums-8b0f8d7b3cf7e7687f11c2fc0a15d4919c91b6c1.tar.xz forums-8b0f8d7b3cf7e7687f11c2fc0a15d4919c91b6c1.zip |
[ticket/14257] Fix lock acquire in CLI command
PHPBB3-14257
Diffstat (limited to 'phpBB/phpbb/console')
-rw-r--r-- | phpBB/phpbb/console/command/reparser/reparse.php | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php index e77b384d8e..6fac3db854 100644 --- a/phpBB/phpbb/console/command/reparser/reparse.php +++ b/phpBB/phpbb/console/command/reparser/reparse.php @@ -174,36 +174,34 @@ class reparse extends \phpbb\console\command\command if (!$this->reparse_lock->acquire()) { - $this->load_resume_data(); + throw new runtime_exception('REPARSE_LOCK_ERROR', array(), null, 1); + } - $name = $input->getArgument('reparser-name'); - if (isset($name)) + $this->load_resume_data(); + + $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" - if (!isset($this->reparsers[$name])) - { - $name = 'text_reparser.' . $name; - } - $this->reparse($name); + $name = 'text_reparser.' . $name; } - else + $this->reparse($name); + } + else + { + foreach ($this->reparsers as $name => $service) { - foreach ($this->reparsers as $name => $service) - { - $this->reparse($name); - } + $this->reparse($name); } + } - $this->io->success($this->user->lang('CLI_REPARSER_REPARSE_SUCCESS')); + $this->io->success($this->user->lang('CLI_REPARSER_REPARSE_SUCCESS')); - $this->reparse_lock->release(); + $this->reparse_lock->release(); - return 0; - } - else - { - throw new runtime_exception('REPARSE_LOCK_ERROR', array(), null, 1); - } + return 0; } /** |