diff options
| author | javiexin <javiexin@gmail.com> | 2017-02-15 23:51:08 +0100 |
|---|---|---|
| committer | javiexin <javiexin@gmail.com> | 2017-02-15 23:51:08 +0100 |
| commit | 7646280d518a4f637ec267fadb5e563f5b149512 (patch) | |
| tree | 406378324c059a8f4bd7b085010aa0c5f36fbbeb /phpBB/includes | |
| parent | b9189ec325c20b6b058a2f4928152a253f04ae6c (diff) | |
| download | forums-7646280d518a4f637ec267fadb5e563f5b149512.tar forums-7646280d518a4f637ec267fadb5e563f5b149512.tar.gz forums-7646280d518a4f637ec267fadb5e563f5b149512.tar.bz2 forums-7646280d518a4f637ec267fadb5e563f5b149512.tar.xz forums-7646280d518a4f637ec267fadb5e563f5b149512.zip | |
[ticket/15011] All errors on metadata throw exceptions
There is inconsistency in the way error are treated in metadata_manager.
Some method return false on error, others throw exception. With this,
the usage is homogeneus, and the uses of these are also adapted.
Using same ticket as it is the same issue, solved in a different way.
PHPBB3-15011
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 5a2ded91e2..bc8d6263f6 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -141,14 +141,13 @@ class acp_extensions break; case 'enable_pre': - if (!$md_manager->validate_dir()) + try { - trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + $md_manager->validate_enable(); } - - if (!$md_manager->validate_enable()) + catch (\phpbb\extension\exception $e) { - trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($e . adm_back_link($this->u_action), E_USER_WARNING); } $extension = $phpbb_extension_manager->get_extension($ext_name); @@ -172,14 +171,13 @@ class acp_extensions break; case 'enable': - if (!$md_manager->validate_dir()) + try { - trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + $md_manager->validate_enable(); } - - if (!$md_manager->validate_enable()) + catch (\phpbb\extension\exception $e) { - trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($e . adm_back_link($this->u_action), E_USER_WARNING); } $extension = $phpbb_extension_manager->get_extension($ext_name); |
