示例#1
0
        /// <summary>
        /// 更新资料
        /// </summary>
        /// <param name="prefix"></param>
        private static void UpdateKeys(string prefix)
        {
            switch (prefix)
            {
            case "sys":
                sf["license_name"]          = Settings.License_NAME;
                sf["license_key"]           = Settings.License_KEY;
                sf["server_static_enabled"] = Settings.SERVER_STATIC_ENABLED ? "true" : "false";
                sf["server_static"]         = Settings.SERVER_STATIC;
                sf["server_upgrade"]        = Settings.SERVER_UPGRADE;
                sf["sys_admin_tag"]         = Settings.SYS_ADMIN_TAG;
                sf["sys_encode_conf"]       = Settings.SYS_ENCODE_CONF_FILE ? "true" : "false";
                sf["sql_profile_trace"]     = Settings.SQL_PROFILE_TRACE ? "true" : "false";

                //301跳转

                sf["sys_autowww"] = Settings.SYS_AUTOWWW ? "true" : "false";

                //虚拟路径
                //if (!sf.Contains("sys_virthpath"))
                //{
                //    sf.Set("sys_virthpath", Settings.SYS_VIRTHPATH);
                //}
                //else
                //{
                //    sf["sys_virthpath"] = Settings.SYS_VIRTHPATH;
                //}
                break;

            case "db":
                sf["db_prefix"] = Settings.DB_PREFIX;
                break;

            case "tpl":

                //压缩代码
                sf.Set("tpl_usecompress", Settings.TPL_UseCompress ? "true" : "false");
                //使用完整路径
                sf.Set("tpl_usefullpath", Settings.TPL_UseFullPath ? "true" : "false");


                Cms.Template.Register();

                break;

            //优化
            case "opti":

                WebConfig.SetDebug(Settings.Opti_Debug);

                //缓存项
                sf.Set("opti_IndexCacheSeconds", Settings.Opti_IndexCacheSeconds.ToString());
                sf.Set("Opti_GC_Collect_Interval", Settings.Opti_GC_Collect_Interval.ToString());
                sf.Set("opti_ClientCacheSeconds", Settings.Opti_ClientCacheSeconds.ToString());
                break;
            }

            sf.Flush();
        }
示例#2
0
 public static void TurnOffDebug()
 {
     Opti_Debug = !true;
     WebConfig.SetDebug(!true);
 }
示例#3
0
 public static void TurnOnDebug()
 {
     Opti_Debug = true;
     WebConfig.SetDebug(true);
 }