From e9f5f136467281f40691a443a55fc10119e20c79 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Sat, 4 Oct 2014 09:56:38 +1000 Subject: [PATCH] Closes #660 --- modules/system/classes/PluginManager.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index 9c6a5ad7b..3d33ae706 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -446,4 +446,17 @@ class PluginManager return true; } + /** + * Check if a plugin exists and is enabled. + * @param string $id Plugin identifier, eg: Namespace.PluginName + * @return boolean + */ + public static function pluginExists($id) + { + $instance = static::instance(); + return (!$instance->findByIdentifier($id) || $instance->isDisabled($id)) + ? false + : true; + } + } \ No newline at end of file