/** * 加载所有安装了的 theme,一般只有 manage 系统才需要这个功能 * * @param string $system */ public static function loadInstallTheme($system) { $installThemeArray = ThemeHelper::getInstallThemeArray(); if (empty($installThemeArray)) { return; } foreach ($installThemeArray as $installTheme) { $instance = static::loadPluginInstance($installTheme); if (!$instance) { printLog('theme [' . $installTheme . '] does not exist', 'PLUGIN', \Core\Log\Base::ERROR); continue; } //调用插件的 load 方法做初始化 if (true !== $instance->pluginLoad($system)) { // 如果加载失败,就不要做后面的操作了 printLog('theme [' . $installTheme . '] load failed', 'PLUGIN', \Core\Log\Base::ERROR); unset($instance); continue; } global $f3; if ($f3->get('DEBUG')) { printLog('load theme [' . $installTheme . '] success', 'PLUGIN', \Core\Log\Base::DEBUG); } // 把插件放入到列表中 static::$pluginInstanceArray[$installTheme] = $instance; unset($instance); } }