From 71dacf474e0cc733f139263d7f916278d6429ab5 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Fri, 19 Feb 2021 14:10:56 +0100 Subject: [PATCH] Remove obsolete configuration references --- .../Configuration/Models/GlobalSettings.cs | 9 -- src/Umbraco.Core/Constants-AppSettings.cs | 152 ------------------ .../PublishedMediaCache.cs | 17 +- 3 files changed, 3 insertions(+), 175 deletions(-) delete mode 100644 src/Umbraco.Core/Constants-AppSettings.cs diff --git a/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs b/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs index ada191a46b..45abc39268 100644 --- a/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs @@ -24,15 +24,6 @@ namespace Umbraco.Cms.Core.Configuration.Models /// public string ReservedPaths { get; set; } = StaticReservedPaths; - /// - /// Gets or sets a value for the configuration status. - /// - /// - /// TODO: https://github.com/umbraco/Umbraco-CMS/issues/4238 - stop having version in web.config appSettings - /// TODO: previously this would throw on set, but presumably we can't do that if we do still want this in config. - /// - public string ConfigurationStatus { get; set; } - /// /// Gets or sets a value for the timeout in minutes. /// diff --git a/src/Umbraco.Core/Constants-AppSettings.cs b/src/Umbraco.Core/Constants-AppSettings.cs deleted file mode 100644 index 1fd3720bb9..0000000000 --- a/src/Umbraco.Core/Constants-AppSettings.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; - -namespace Umbraco.Cms.Core -{ - public static partial class Constants - { - /// - /// Specific web.config AppSetting keys for Umbraco.Core application - /// - public static class AppSettings - { - // TODO: Are these all obsolete in netcore now? - - public const string MainDomLock = "Umbraco.Core.MainDom.Lock"; - - // TODO: Kill me - still used in Umbraco.Core.IO.SystemFiles:27 - [Obsolete("We need to kill this appsetting as we do not use XML content cache umbraco.config anymore due to NuCache")] - public const string ContentXML = "Umbraco.Core.ContentXML"; //umbracoContentXML - - /// - /// TODO: FILL ME IN - /// - public const string RegisterType = "Umbraco.Core.RegisterType"; - - /// - /// This is used for a unit test in PublishedMediaCache - /// - public const string PublishedMediaCacheSeconds = "Umbraco.Core.PublishedMediaCacheSeconds"; - - /// - /// TODO: FILL ME IN - /// - public const string AssembliesAcceptingLoadExceptions = "Umbraco.Core.AssembliesAcceptingLoadExceptions"; - - /// - /// This will return the version number of the currently installed umbraco instance - /// - /// - /// Umbraco will automatically set & modify this value when installing & upgrading - /// - public const string ConfigurationStatus = "Umbraco.Core.ConfigurationStatus"; - - /// - /// The path to umbraco's root directory (/umbraco by default). - /// - public const string UmbracoPath = "Umbraco.Core.Path"; - - /// - /// Gets the path to umbraco's icons directory (/umbraco/assets/icons by default). - /// - public const string IconsPath = "Umbraco.Icons.Path"; - - /// - /// The reserved urls from web.config. - /// - public const string ReservedUrls = "Umbraco.Core.ReservedUrls"; - - /// - /// The path of the stylesheet folder. - /// - public const string UmbracoCssPath = "Umbraco.Web.CssPath"; - - /// - /// The path of script folder. - /// - public const string UmbracoScriptsPath = "Umbraco.Core.ScriptsPath"; - - /// - /// The path of media folder. - /// - public const string UmbracoMediaPath = "Umbraco.Core.MediaPath"; - - /// - /// The reserved paths from web.config - /// - public const string ReservedPaths = "Umbraco.Core.ReservedPaths"; - - /// - /// Set the timeout for the Umbraco backoffice in minutes - /// - public const string TimeOutInMinutes = "Umbraco.Core.TimeOutInMinutes"; - - /// - /// The number of days to check for a new version of Umbraco - /// - /// - /// Default is set to 7. Setting this to 0 will never check - /// This is used to help track statistics - /// - public const string VersionCheckPeriod = "Umbraco.Core.VersionCheckPeriod"; - - /// - /// This is the location type to store temporary files such as cache files or other localized files for a given machine - /// - /// - /// Currently used for the xml cache file and the plugin cache files - /// - public const string LocalTempStorage = "Umbraco.Core.LocalTempStorage"; - - /// - /// The default UI language of the backoffice such as 'en-US' - /// - public const string DefaultUILanguage = "Umbraco.Core.DefaultUILanguage"; - - /// - /// A true/false value indicating whether umbraco should hide top level nodes from generated URLs. - /// - public const string HideTopLevelNodeFromPath = "Umbraco.Core.HideTopLevelNodeFromPath"; - - /// - /// A true or false indicating whether umbraco should force a secure (https) connection to the backoffice. - /// - public const string UseHttps = "Umbraco.Core.UseHttps"; - - /// - /// TODO: FILL ME IN - /// - public const string DisableElectionForSingleServer = "Umbraco.Core.DisableElectionForSingleServer"; - - /// - /// Gets the path to the razor file used when no published content is available. - /// - public const string NoNodesViewPath = "Umbraco.Core.NoNodesViewPath"; - - /// - /// Debug specific web.config AppSetting keys for Umbraco - /// - /// - /// Do not use these keys in a production environment - /// - public static class Debug - { - /// - /// When set to true, Scope logs the stack trace for any scope that gets disposed without being completed. - /// this helps troubleshooting rogue scopes that we forget to complete - /// - public const string LogUncompletedScopes = "Umbraco.Core.Debug.LogUncompletedScopes"; - - /// - /// When set to true, the Logger creates a mini dump of w3wp in ~/App_Data/MiniDump whenever it logs - /// an error due to a ThreadAbortException that is due to a timeout. - /// - public const string DumpOnTimeoutThreadAbort = "Umbraco.Core.Debug.DumpOnTimeoutThreadAbort"; - - /// - /// TODO: FILL ME IN - /// - public const string DatabaseFactoryServerVersion = "Umbraco.Core.Debug.DatabaseFactoryServerVersion"; - } - } - } -} diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs index 8536c2ce33..0db61264ee 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Configuration; using System.IO; @@ -636,19 +636,8 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache private static void InitializeCacheConfig() { - var value = ConfigurationManager.AppSettings[Constants.AppSettings.PublishedMediaCacheSeconds]; - int seconds; - if (int.TryParse(value, out seconds) == false) - seconds = PublishedMediaCacheTimespanSeconds; - if (seconds > 0) - { - _publishedMediaCacheEnabled = true; - _publishedMediaCacheTimespan = TimeSpan.FromSeconds(seconds); - } - else - { - _publishedMediaCacheEnabled = false; - } + _publishedMediaCacheEnabled = true; + _publishedMediaCacheTimespan = TimeSpan.FromSeconds(PublishedMediaCacheTimespanSeconds); } internal IPublishedContent CreateFromCacheValues(CacheValues cacheValues)