diff options
author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-08-24 12:33:32 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2016-12-03 16:37:35 +0100 |
commit | 8481bd4e1831e3f9911263957637f4095fb088b0 (patch) | |
tree | 38f1b70929abfa155cea422172e6301a1ed03d2a /phpBB/phpbb/console/command | |
parent | 376042d845a18058d93d289a1227096794da06d2 (diff) | |
download | forums-8481bd4e1831e3f9911263957637f4095fb088b0.tar forums-8481bd4e1831e3f9911263957637f4095fb088b0.tar.gz forums-8481bd4e1831e3f9911263957637f4095fb088b0.tar.bz2 forums-8481bd4e1831e3f9911263957637f4095fb088b0.tar.xz forums-8481bd4e1831e3f9911263957637f4095fb088b0.zip |
[ticket/12610] Use exception_interface
PHPBB3-12610
Diffstat (limited to 'phpBB/phpbb/console/command')
-rw-r--r-- | phpBB/phpbb/console/command/update/check.php | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/phpBB/phpbb/console/command/update/check.php b/phpBB/phpbb/console/command/update/check.php index 0ef3c970ac..982c86bf8c 100644 --- a/phpBB/phpbb/console/command/update/check.php +++ b/phpBB/phpbb/console/command/update/check.php @@ -13,6 +13,7 @@ namespace phpbb\console\command\update; +use phpbb\exception\exception_interface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; @@ -116,18 +117,9 @@ class check extends \phpbb\console\command\command */ protected function check_ext(InputInterface $input, OutputInterface $output, $stability, $recheck, $ext_name) { - try - { - $ext_manager = $this->phpbb_container->get('ext.manager'); - $md_manager = $ext_manager->create_extension_metadata_manager($ext_name, null); - $updates_available = $ext_manager->version_check($md_manager, $recheck, false, $stability); - } - catch (\RuntimeException $e) - { - $output->writeln('<error>' . $e->getMessage() . '</error>'); - - return 2; - } + $ext_manager = $this->phpbb_container->get('ext.manager'); + $md_manager = $ext_manager->create_extension_metadata_manager($ext_name, null); + $updates_available = $ext_manager->version_check($md_manager, $recheck, false, $stability); $metadata = $md_manager->get_metadata('all'); if ($input->getOption('verbose')) @@ -178,16 +170,7 @@ class check extends \phpbb\console\command\command $version_helper = $this->phpbb_container->get('version_helper'); $version_helper->force_stability($stability); - try - { - $updates_available = $version_helper->get_suggested_updates($recheck); - } - catch (\RuntimeException $e) - { - $output->writeln('<error>' . $this->user->lang('VERSIONCHECK_FAIL') . '</error>'); - - return 2; - } + $updates_available = $version_helper->get_suggested_updates($recheck); if ($input->getOption('verbose')) { @@ -258,6 +241,11 @@ class check extends \phpbb\console\command\command $message .= ' | '; } } + catch (exception_interface $e) + { + $exception_message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); + $message .= ('<error>' . $exception_message . '</error>'); + } catch (\RuntimeException $e) { $message .= ('<error>' . $e->getMessage() . '</error>'); |