public static void LoadSetting()
        {
            Version = typeof(Kooboo.Data.Models.WebSite).Assembly.GetName().Version;

            RootPath       = TryRootPath();
            IsOnlineServer = GetBool("IsOnlineServer");

            CmsLang = ConfigurationManager.AppSettings.Get("CmsLang");

            string quotavalue = ConfigurationManager.AppSettings.Get("QuotaControl");

            if (string.IsNullOrEmpty(quotavalue))
            {
                QuotaControl = true;
            }
            else
            {
                QuotaControl = GetBool("QuotaControl");
            }

            Global           = new GlobalInfo();
            Global.EnableLog = GetBool("Log");

            Global.LogPath = System.IO.Path.Combine(RootPath, "logs");

            IOHelper.EnsureDirectoryExists(Global.LogPath);

            if (IsOnlineServer)
            {
                MaxVisitorLogRead = 3000;
            }
            else
            {
                MaxVisitorLogRead = 10000;
            }

            // users
            SetUser();

            _accountApiUrl = ConfigurationManager.AppSettings.Get("AccountApiUrl");
            _themeurl      = ConfigurationManager.AppSettings.Get("ThemeUrl");

            // for some servers that does not have hostfile.
            if (!System.IO.File.Exists(Kooboo.Data.Hosts.WindowsHost.HostFile))
            {
                DefaultLocalHost = "localkooboo.com";
            }

            _serversetting = null; // reset server setting.

            KscriptConfig = KscriptConfigReader.GetConfig();
        }
示例#2
0
        public static void LoadSetting()
        {
            ModulePath = Path.Combine(AppContext.BaseDirectory, "modules");
            if (!Directory.Exists(ModulePath))
            {
                Directory.CreateDirectory(ModulePath);
            }
            var modulesHash = GetModulesHash();

            Version = typeof(Kooboo.Data.Models.WebSite).Assembly.GetName().Version;
            var build    = Version.Build + modulesHash.Take(8).Sum(s => s);
            var revision = Version.Revision + modulesHash.Skip(8).Sum(s => s);

            Version = new Version(Version.Major, Version.Minor, build, revision);

            RootPath = PathUtility.TryRootPath();

            IsOnlineServer = GetBool("IsOnlineServer");

            CmsLang = ConfigurationManager.AppSettings.Get("CmsLang");

            string quotavalue = ConfigurationManager.AppSettings.Get("QuotaControl");

            if (string.IsNullOrEmpty(quotavalue))
            {
                QuotaControl = true;
            }
            else
            {
                QuotaControl = GetBool("QuotaControl");
            }

            Global           = new GlobalInfo();
            Global.EnableLog = GetBool("Log");

            Global.LogPath = System.IO.Path.Combine(RootPath, "logs");

            IOHelper.EnsureDirectoryExists(Global.LogPath);

            if (IsOnlineServer)
            {
                MaxVisitorLogRead = 3000;
            }
            else
            {
                MaxVisitorLogRead = 10000;
            }

            // users
            SetUser();

            _accountApiUrl = ConfigurationManager.AppSettings.Get("AccountApiUrl");
            _themeurl      = ConfigurationManager.AppSettings.Get("ThemeUrl");

            // for some servers that does not have hostfile.
            if (!System.IO.File.Exists(Kooboo.Data.Hosts.WindowsHost.HostFile))
            {
                DefaultLocalHost = "localkooboo.com";
            }

            _serversetting = null; // reset server setting.

            KscriptConfig = KscriptConfigReader.GetConfig();

            DisableMail = GetBool("DisableMail");
        }