From fe5203e20eba8af3c1c9230d2acf0f5e73fc17b2 Mon Sep 17 00:00:00 2001 From: Eltrac Koalar Date: Fri, 19 Aug 2022 00:11:56 +0800 Subject: =?UTF-8?q?:stars:=20Perf:=20=E5=AE=8C=E5=85=A8=E9=87=8D=E5=86=99?= =?UTF-8?q?=E4=BA=86=E8=AF=84=E8=AE=BA=E5=8C=BA=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Utils.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libs/Utils.php') 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); + } } -- cgit v1.2.3