typecho/typecho · error · Typecho\Widget\Exception

无法禁用插件

Error message

无法禁用插件

What it means

Error "无法禁用插件" thrown in typecho/typecho.

Source

Thrown at var/Widget/Plugins/Edit.php:229

        /** 获取已启用插件 */
        $plugins = Plugin::export();
        $activatedPlugins = $plugins['activated'];
        $pluginFileExist = true;

        try {
            /** 获取插件入口 */
            [$pluginFileName, $className] = Plugin::portal($pluginName, $this->options->pluginDir);
        } catch (Plugin\Exception $e) {
            $pluginFileExist = false;

            if (!isset($activatedPlugins[$pluginName])) {
                throw $e;
            }
        }

        /** 判断实例化是否成功 */
        if (!isset($activatedPlugins[$pluginName])) {
            throw new Exception(_t('无法禁用插件'), 500);
        }

        if ($pluginFileExist) {

            /** 载入插件 */
            require_once $pluginFileName;

            /** 判断实例化是否成功 */
            if (
                !isset($activatedPlugins[$pluginName]) || !class_exists($className)
                || !method_exists($className, 'deactivate')
            ) {
                throw new Exception(_t('无法禁用插件'), 500);
            }

            try {
                $result = call_user_func([$className, 'deactivate']);
            } catch (Plugin\Exception $e) {

View on GitHub (pinned to 56f4c6f339)

When it happens

Trigger: Thrown at var/Widget/Plugins/Edit.php:229 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of typecho/typecho@56f4c6f339 (2026-08-21). Data as JSON: /api/errors/d40b8f39401aa10b. Report an issue: GitHub.