aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/console/command/extension/disable.php2
-rw-r--r--phpBB/phpbb/console/command/extension/enable.php2
-rw-r--r--phpBB/phpbb/console/command/extension/purge.php2
-rw-r--r--phpBB/phpbb/extension/manager.php27
4 files changed, 28 insertions, 5 deletions
diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php
index 5f0e74b984..c04848aa01 100644
--- a/phpBB/phpbb/console/command/extension/disable.php
+++ b/phpBB/phpbb/console/command/extension/disable.php
@@ -37,7 +37,7 @@ class disable extends command
$this->manager->disable($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
$output->writeln("<error>Could not disable extension $name</error>");
return 1;
diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php
index 0cdf26d4db..d0d0c9f1cc 100644
--- a/phpBB/phpbb/console/command/extension/enable.php
+++ b/phpBB/phpbb/console/command/extension/enable.php
@@ -37,7 +37,7 @@ class enable extends command
$this->manager->enable($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXTENSION_ENABLE', time(), array($name));
$output->writeln("<info>Successfully enabled extension $name</info>");
diff --git a/phpBB/phpbb/console/command/extension/purge.php b/phpBB/phpbb/console/command/extension/purge.php
index 4e57641d83..841598b90a 100644
--- a/phpBB/phpbb/console/command/extension/purge.php
+++ b/phpBB/phpbb/console/command/extension/purge.php
@@ -37,7 +37,7 @@ class purge extends command
$this->manager->purge($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
$output->writeln("<error>Could not purge extension $name</error>");
return 1;
diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php
index 4130e8455a..580960ca01 100644
--- a/phpBB/phpbb/extension/manager.php
+++ b/phpBB/phpbb/extension/manager.php
@@ -515,7 +515,7 @@ class manager
* @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)
+ public function is_available($name)
{
return file_exists($this->get_extension_path($name, true));
}
@@ -526,12 +526,35 @@ class manager
* @param string $name Extension name to check
* @return bool Depending on whether or not the extension is enabled
*/
- public function enabled($name)
+ public function is_enabled($name)
{
return isset($this->extensions[$name]) && $this->extensions[$name]['ext_active'];
}
/**
+ * Check to see if a given extension is disabled
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is disabled
+ */
+ public function is_disabled($name)
+ {
+ return isset($this->extensions[$name]) && !$this->extensions[$name]['ext_active'];
+ }
+
+ /**
+ * Check to see if a given extension is configured
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is configured
+ * @see all_configured()
+ */
+ public function is_configured($name)
+ {
+ return isset($this->extensions[$name]);
+ }
+
+ /**
* Instantiates a \phpbb\finder.
*
* @param bool $use_all_available Should we load all extensions, or just enabled ones