1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/10614] Tweak list output, show state, purge cache, handle missing exts

PHPBB3-10614
This commit is contained in:
Igor Wiedler
2012-02-09 01:03:17 +01:00
parent b222030ca7
commit 5ccd6b0c7a
2 changed files with 38 additions and 11 deletions

View File

@@ -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]))
{