* Information about the last HTTP error that occurred. * ERROR.code is the HTTP status code. * ERROR.title contains a brief description of the error. * ERROR.text provides greater detail. For HTTP 500 errors, use ERROR.trace to retrieve the stack trace. */ $code = $f3->get('ERROR.code'); RouteHelper::reRoute(null, '/'); }); } // ---------------------------------------- 4. 加载显示主题 -------------------------------------- // 为 Manage 设置网站的 WebRootBase,这样在 Manage 中就可以对相应网站做操作 $systemUrlBase = ManageThemePlugin::getSystemUrlBase(PluginHelper::SYSTEM_MOBILE); if (empty($systemUrlBase) || $systemUrlBase['base'] != $f3->get('sysConfig[webroot_url_prefix]')) { ManageThemePlugin::saveSystemUrlBase(PluginHelper::SYSTEM_MOBILE, '移动', '棒主妇移动端网站', $f3->get('sysConfig[webroot_url_prefix]')); } $themeIntance = ThemeHelper::loadSystemTheme(ThemeHelper::SYSTEM_MOBILE_THEME); if (!$themeIntance) { die('没有正确设置 ' . ThemeHelper::SYSTEM_MOBILE_THEME . ' 主题'); } // 调用主题自己的初始化方法 $themeLoadRet = $themeIntance->pluginLoad(PluginHelper::SYSTEM_MOBILE); if (true !== $themeLoadRet) { die(ThemeHelper::SYSTEM_MOBILE_THEME . ' 主题无法初始化:' . $themeLoadRet); } // 调用主题的 action $themeActionRet = $themeIntance->pluginAction(PluginHelper::SYSTEM_MOBILE); if (true !== $themeActionRet) { die(ThemeHelper::SYSTEM_MOBILE_THEME . ' 主题无法加载:' . $themeActionRet); } // ---------------------------------------- 5. 加载系统插件 -------------------------------------- // 这里我们加载额外的插件
// 调试模式下,弄一个 fileLogger 方便查看所有的日志输出 $fileLogger = new \Core\Log\File(\Core\Helper\Utility\Time::localTimeStr('Y-m-d') . '.supplier.debug.log'); $logger->addLogger($fileLogger); // 把 smarty 的一些错误警告关闭,不然会影响我们的调试 Smarty::muteExpectedErrors(); // 使用自定义的调试框架 if ($f3->get('USERDEBUG')) { require_once PROTECTED_PATH . '/Framework/Debug/BzfDebug.php'; // 开启 debug 功能 BzfDebug::enableDebug(); // 开启 Smarty Web Log BzfDebug::enableSmartyWebLog(); } } // ---------------------------------------- 4. 加载显示主题 -------------------------------------- $themeIntance = ThemeHelper::loadSystemTheme(ThemeHelper::SYSTEM_SUPPLIER_THEME); if (!$themeIntance) { die('没有正确设置 ' . ThemeHelper::SYSTEM_SUPPLIER_THEME . ' 主题'); } // 调用主题自己的初始化方法 $themeLoadRet = $themeIntance->pluginLoad(PluginHelper::SYSTEM_SUPPLIER); if (true !== $themeLoadRet) { die(ThemeHelper::SYSTEM_SUPPLIER_THEME . ' 主题无法初始化:' . $themeLoadRet); } // 调用主题的 action $themeActionRet = $themeIntance->pluginAction(PluginHelper::SYSTEM_SUPPLIER); if (true !== $themeActionRet) { die(ThemeHelper::SYSTEM_SUPPLIER_THEME . ' 主题无法加载:' . $themeActionRet); } // ---------------------------------------- 5. 加载系统插件 -------------------------------------- // 这里我们加载额外的插件
*/ $code = $f3->get('ERROR.code'); if (404 == intval($code)) { RouteHelper::reRoute(null, '/Error/E404?url=' . urlencode(RouteHelper::getFullURL())); } else { RouteHelper::reRoute(null, '/'); } }); } // ---------------------------------------- 4. 加载显示主题 ----------------------------------- // 为 Manage 设置网站的 WebRootBase,这样在 Manage 中就可以对相应网站做操作 $systemUrlBase = ManageThemePlugin::getSystemUrlBase(PluginHelper::SYSTEM_SHOP); if (empty($systemUrlBase) || $systemUrlBase['base'] != $f3->get('sysConfig[webroot_url_prefix]')) { ManageThemePlugin::saveSystemUrlBase(PluginHelper::SYSTEM_SHOP, '商城', '棒主妇商城', $f3->get('sysConfig[webroot_url_prefix]')); } $themeIntance = ThemeHelper::loadSystemTheme(ThemeHelper::SYSTEM_SHOP_THEME); if (!$themeIntance) { die('没有正确设置 ' . ThemeHelper::SYSTEM_SHOP_THEME . ' 主题'); } // 调用主题自己的初始化方法 $themeLoadRet = $themeIntance->pluginLoad(PluginHelper::SYSTEM_SHOP); if (true !== $themeLoadRet) { die(ThemeHelper::SYSTEM_SHOP_THEME . ' 主题无法初始化:' . $themeLoadRet); } // 调用主题的 action $themeActionRet = $themeIntance->pluginAction(PluginHelper::SYSTEM_SHOP); if (true !== $themeActionRet) { die(ThemeHelper::SYSTEM_SHOP_THEME . ' 主题无法加载:' . $themeActionRet); } // ---------------------------------------- 5. 加载系统插件 -------------------------------------- // 在这里启动插件体系架构