示例#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";
                sf.Set("sys_use_upload_raw_path", Settings.SYS_USE_UPLOAD_RAW_NAME?"true":"false");
                sf["sys_www_rd"] = Settings.SYS_WWW_RD.ToString();
                sf.Set("sys_force_https", Settings.SYS_FORCE_HTTPS?"true":"false");
                sf["sys_site_map_path"] = Settings.SYS_SITE_MAP_PATH ?? "";
                //虚拟路径
                //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_use_cache", Settings.TPL_USE_CACHE?"true":"false");
                //压缩代码
                sf.Set("tpl_use_compress", Settings.TPL_USE_COMPRESS ? "true" : "false");
                //使用完整路径
                sf.Set("tpl_full_url_path", Settings.TPL_FULL_URL_PATH ? "true" : "false");
                Cms.Template.Reload();
                break;

            //优化
            case "opti":
                //缓存项
                sf.Set("perm_index_cache_second", Settings.PERM_INDEX_CACHE_SECOND.ToString());
                sf.Set("opti_gc_collect_interval", Settings.opti_gc_collect_interval.ToString());
                sf.Set("opti_client_cache_seconds", Settings.Opti_ClientCacheSeconds.ToString());
                break;
            }
            sf.Flush();
            if (prefix == "opti")
            {
                WebConfig.SetDebug(Settings.OPTI_DEBUG_MODE);
            }
        }
示例#2
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":
                //缓存项
                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();
            if (prefix == "opti")
            {
                WebConfig.SetDebug(Settings.Opti_Debug);
            }
        }
示例#3
0
 public static void TurnOffDebug()
 {
     Opti_Debug = !true;
     WebConfig.SetDebug(!true);
 }
示例#4
0
 public static void TurnOnDebug()
 {
     Opti_Debug = true;
     WebConfig.SetDebug(true);
 }
示例#5
0
 public static void TurnOffDebug()
 {
     OPTI_DEBUG_MODE = !true;
     WebConfig.SetDebug(!true);
 }
示例#6
0
 public static void TurnOnDebug()
 {
     OPTI_DEBUG_MODE = true;
     WebConfig.SetDebug(true);
 }