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/includes/acp | |
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/includes/acp')
-rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 16 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 3 |
2 files changed, 12 insertions, 7 deletions
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index ec88a4a392..5b9ee6c53e 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -11,6 +11,8 @@ * */ +use phpbb\exception\exception_interface; + /** * @ignore */ @@ -92,7 +94,7 @@ class acp_extensions { $md_manager->get_metadata('all'); } - catch (\phpbb\extension\exception $e) + catch (exception_interface $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); trigger_error($message, E_USER_WARNING); @@ -320,11 +322,13 @@ class acp_extensions $template->assign_block_vars('updates_available', $version_data); } } - catch (\RuntimeException $e) + catch (exception_interface $e) { + $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); + $template->assign_vars(array( 'S_VERSIONCHECK_STATUS' => $e->getCode(), - 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '', + 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== 'VERSIONCHECK_FAIL') ? $message : '', )); } @@ -367,7 +371,7 @@ class acp_extensions $enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true; $enabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')); } - catch (\phpbb\extension\exception $e) + catch (exception_interface $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); $this->template->assign_block_vars('disabled', array( @@ -425,7 +429,7 @@ class acp_extensions $disabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true; $disabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')); } - catch (\phpbb\extension\exception $e) + catch (exception_interface $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); $this->template->assign_block_vars('disabled', array( @@ -486,7 +490,7 @@ class acp_extensions $available_extension_meta_data[$name]['S_VERSIONCHECK'] = true; $available_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')); } - catch (\phpbb\extension\exception $e) + catch (exception_interface $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); $this->template->assign_block_vars('disabled', array( diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index fe9657aecb..8dec7c69bd 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -450,9 +450,10 @@ class acp_main } catch (\RuntimeException $e) { + $message = call_user_func_array(array($user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); $template->assign_vars(array( 'S_VERSIONCHECK_FAIL' => true, - 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '', + 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== 'VERSIONCHECK_FAIL') ? $message : '', )); } } |