diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-02-09 01:03:17 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-02-09 01:04:47 +0100 |
commit | 5ccd6b0c7a2952f01b636e7319ed8ae4be8faa77 (patch) | |
tree | ca5b56d4ef1a00cd82001cff7711d10da36f9231 /phpBB/includes | |
parent | b222030ca78f8eb980baffeec793723978e75c3a (diff) | |
download | forums-5ccd6b0c7a2952f01b636e7319ed8ae4be8faa77.tar forums-5ccd6b0c7a2952f01b636e7319ed8ae4be8faa77.tar.gz forums-5ccd6b0c7a2952f01b636e7319ed8ae4be8faa77.tar.bz2 forums-5ccd6b0c7a2952f01b636e7319ed8ae4be8faa77.tar.xz forums-5ccd6b0c7a2952f01b636e7319ed8ae4be8faa77.zip |
[ticket/10614] Tweak list output, show state, purge cache, handle missing exts
PHPBB3-10614
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/extension/manager.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 438578e7e7..b7f76d0400 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -132,6 +132,12 @@ class phpbb_extension_manager */ public function enable_step($name) { + $ext_path = $this->get_extension_path($name); + if (!file_exists($ext_path)) + { + throw new InvalidArgumentException('The provided extension does not exist.'); + } + // ignore extensions that are already enabled if (isset($this->extensions[$name]) && $this->extensions[$name]['ext_active']) { @@ -152,7 +158,7 @@ class phpbb_extension_manager ); $this->extensions[$name] = $extension_data; - $this->extensions[$name]['ext_path'] = $this->get_extension_path($extension_data['ext_name']); + $this->extensions[$name]['ext_path'] = $ext_path; ksort($this->extensions); $sql = 'UPDATE ' . $this->extension_table . ' @@ -195,6 +201,12 @@ class phpbb_extension_manager */ public function disable_step($name) { + $ext_path = $this->get_extension_path($name); + if (!file_exists($ext_path)) + { + throw new InvalidArgumentException('The provided extension does not exist.'); + } + // ignore extensions that are already disabled if (!isset($this->extensions[$name]) || !$this->extensions[$name]['ext_active']) { @@ -262,6 +274,12 @@ class phpbb_extension_manager */ public function purge_step($name) { + $ext_path = $this->get_extension_path($name); + if (!file_exists($ext_path)) + { + throw new InvalidArgumentException('The provided extension does not exist.'); + } + // ignore extensions that do not exist if (!isset($this->extensions[$name])) { |