aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/extension/manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/extension/manager.php')
-rw-r--r--phpBB/includes/extension/manager.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php
index dac0e5f947..537c19aff8 100644
--- a/phpBB/includes/extension/manager.php
+++ b/phpBB/includes/extension/manager.php
@@ -432,6 +432,28 @@ class phpbb_extension_manager
}
return $disabled;
}
+
+ /**
+ * Check to see if a given extension is available on the filesystem
+ *
+ * @param string $name Extension name to check NOTE: Can be user input
+ * @return bool Depending on whether or not the extension is available
+ */
+ public function available($name)
+ {
+ return file_exists($this->get_extension_path($name, true));
+ }
+
+ /**
+ * Check to see if a given extension is enabled
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is enabled
+ */
+ public function enabled($name)
+ {
+ return isset($this->extensions[$name]) && $this->extensions[$name]['ext_active'];
+ }
/**
* Instantiates a phpbb_extension_finder.