summaryrefslogtreecommitdiff
path: root/libs/Utils.php
diff options
context:
space:
mode:
Diffstat (limited to 'libs/Utils.php')
-rw-r--r--libs/Utils.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/Utils.php b/libs/Utils.php
index 98ac6a7..36675db 100644
--- a/libs/Utils.php
+++ b/libs/Utils.php
@@ -31,4 +31,16 @@ class Utils
{
Helper::options()->themeUrl($path);
}
+
+ /**
+ * 判断插件是否可用
+ *
+ * @return bool
+ */
+ public static function isPluginAvailable($name)
+ {
+ $plugins = Typecho_Plugin::export();
+ $plugins = $plugins['activated'];
+ return is_array($plugins) && array_key_exists($name, $plugins);
+ }
}