Merge pull request #4249 from umbraco/temp8-remove-unused-filesystem-config

V8 Remove unused filesystemproviders.config
This commit is contained in:
Shannon Deminick
2019-01-30 17:37:38 +11:00
committed by GitHub
17 changed files with 16 additions and 278 deletions
@@ -2,7 +2,6 @@
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<configSections xdt:Transform="InsertIfMissing" />
<configSections>
<section name="FileSystemProviders" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<section name="ExamineLuceneIndexSets" type="Umbraco.Examine.Config.IndexSets, Umbraco.Examine" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="SetAttributes(type,requirePermission)" />
<sectionGroup name="applicationSettings" xdt:Locator="Match(name)">
@@ -11,7 +10,6 @@
<sectionGroup name="system.web.webPages.razor" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<sectionGroup name="umbracoConfiguration" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing">
<section name="settings" type="Umbraco.Core.Configuration.UmbracoSettings.UmbracoSettingsSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
<section name="FileSystemProviders" type="Umbraco.Core.Configuration.FileSystemProvidersSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
<section name="dashBoard" type="Umbraco.Core.Configuration.Dashboard.DashboardSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
<section name="HealthChecks" type="Umbraco.Core.Configuration.HealthChecks.HealthChecksSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
</sectionGroup>
@@ -27,13 +25,10 @@
<umbracoConfiguration xdt:Transform="InsertIfMissing">
<settings configSource="config\umbracoSettings.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
<FileSystemProviders configSource="config\FileSystemProviders.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
<dashBoard configSource="config\Dashboard.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
<HealthChecks configSource="config\HealthChecks.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
</umbracoConfiguration>
<FileSystemProviders xdt:Transform="Remove" />
<system.data xdt:Transform="InsertIfMissing">
<DbProviderFactories xdt:Transform="InsertIfMissing">
<remove invariant="System.Data.SqlServerCe.4.0" xdt:Locator="Match(invariant)" xdt:Transform="InsertIfMissing" />
@@ -1,67 +0,0 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace Umbraco.Core.Configuration
{
public class FileSystemProviderElement : ConfigurationElement, IFileSystemProviderElement
{
private const string ALIAS_KEY = "alias";
private const string TYPE_KEY = "type";
private const string PARAMETERS_KEY = "Parameters";
[ConfigurationProperty(ALIAS_KEY, IsKey = true, IsRequired = true)]
public string Alias
{
get
{
return ((string)(base[ALIAS_KEY]));
}
}
[ConfigurationProperty(TYPE_KEY, IsKey = false, IsRequired = true)]
public string Type
{
get
{
return ((string)(base[TYPE_KEY]));
}
}
[ConfigurationProperty(PARAMETERS_KEY, IsDefaultCollection = true, IsRequired = false)]
public KeyValueConfigurationCollection Parameters
{
get
{
return ((KeyValueConfigurationCollection)(base[PARAMETERS_KEY]));
}
}
string IFileSystemProviderElement.Alias
{
get { return Alias; }
}
string IFileSystemProviderElement.Type
{
get { return Type; }
}
private IDictionary<string, string> _params;
IDictionary<string, string> IFileSystemProviderElement.Parameters
{
get
{
if (_params != null) return _params;
_params = new Dictionary<string, string>();
foreach (KeyValueConfigurationElement element in Parameters)
{
_params.Add(element.Key, element.Value);
}
return _params;
}
}
}
}
@@ -1,43 +0,0 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace Umbraco.Core.Configuration
{
[ConfigurationCollection(typeof(FileSystemProviderElement), AddItemName = "Provider")]
public class FileSystemProviderElementCollection : ConfigurationElementCollection, IEnumerable<IFileSystemProviderElement>
{
protected override ConfigurationElement CreateNewElement()
{
return new FileSystemProviderElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((FileSystemProviderElement)(element)).Alias;
}
public new FileSystemProviderElement this[string key]
{
get
{
return (FileSystemProviderElement)BaseGet(key);
}
}
IEnumerator<IFileSystemProviderElement> IEnumerable<IFileSystemProviderElement>.GetEnumerator()
{
for (var i = 0; i < Count; i++)
{
yield return BaseGet(i) as IFileSystemProviderElement;
}
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
@@ -1,30 +0,0 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace Umbraco.Core.Configuration
{
public class FileSystemProvidersSection : ConfigurationSection, IFileSystemProvidersSection
{
[ConfigurationProperty("", IsDefaultCollection = true, IsRequired = true)]
public FileSystemProviderElementCollection Providers
{
get { return ((FileSystemProviderElementCollection)(base[""])); }
}
private IDictionary<string, IFileSystemProviderElement> _providers;
IDictionary<string, IFileSystemProviderElement> IFileSystemProvidersSection.Providers
{
get
{
if (_providers != null) return _providers;
_providers = Providers.ToDictionary(x => x.Alias, x => x);
return _providers;
}
}
}
}
@@ -1,11 +0,0 @@
using System.Collections.Generic;
namespace Umbraco.Core.Configuration
{
public interface IFileSystemProviderElement
{
string Alias { get; }
string Type { get; }
IDictionary<string, string> Parameters { get; }
}
}
@@ -1,9 +0,0 @@
using System.Collections.Generic;
namespace Umbraco.Core.Configuration
{
public interface IFileSystemProvidersSection
{
IDictionary<string, IFileSystemProviderElement> Providers { get; }
}
}
@@ -7,6 +7,10 @@ namespace Umbraco.Core.Sync
/// <summary>
/// A registrar that stores registered server nodes in the database.
/// </summary>
/// <remarks>
/// This is the default registrar which determines a server's role by using a master election process.
/// The master election process doesn't occur until just after startup so this election process doesn't really affect the primary startup phase.
/// </remarks>
public sealed class DatabaseServerRegistrar : IServerRegistrar
{
private readonly Lazy<IServerRegistrationService> _registrationService;
+10 -2
View File
@@ -3,6 +3,14 @@ using System.Collections.Generic;
namespace Umbraco.Core.Sync
{
/// <summary>
/// Can be used when Umbraco is definitely not operating in a Load Balanced scenario to micro-optimize some startup performance
/// </summary>
/// <remarks>
/// The micro optimization is specifically to avoid a DB query just after the app starts up to determine the <see cref="ServerRole"/>
/// which by default is done with master election by a database query. The master election process doesn't occur until just after startup
/// so this micro optimization doesn't really affect the primary startup phase.
/// </remarks>
public class SingleServerRegistrar : IServerRegistrar
{
private readonly IRuntimeState _runtime;
@@ -13,7 +21,7 @@ namespace Umbraco.Core.Sync
public SingleServerRegistrar(IRuntimeState runtime)
{
_runtime = runtime;
_registrations = new Lazy<IServerAddress[]>(() => new[] { new ServerAddressImpl(_runtime.ApplicationUrl.ToString()) });
_registrations = new Lazy<IServerAddress[]>(() => new IServerAddress[] { new ServerAddressImpl(_runtime.ApplicationUrl.ToString()) });
}
public ServerRole GetCurrentServerRole()
@@ -23,7 +31,7 @@ namespace Umbraco.Core.Sync
public string GetCurrentServerUmbracoApplicationUrl()
{
return _runtime.ApplicationUrl.ToString();
return _runtime.ApplicationUrl?.ToString();
}
private class ServerAddressImpl : IServerAddress
-5
View File
@@ -211,9 +211,6 @@
<Compile Include="ConfigsExtensions.cs" />
<Compile Include="Configuration\Configs.cs" />
<Compile Include="Configuration\CoreDebug.cs" />
<Compile Include="Configuration\FileSystemProviderElement.cs" />
<Compile Include="Configuration\FileSystemProviderElementCollection.cs" />
<Compile Include="Configuration\FileSystemProvidersSection.cs" />
<Compile Include="Configuration\GlobalSettings.cs" />
<Compile Include="Configuration\GlobalSettingsExtensions.cs" />
<Compile Include="Configuration\Grid\GridConfig.cs" />
@@ -235,8 +232,6 @@
<Compile Include="Configuration\HealthChecks\NotificationMethodsElementCollection.cs" />
<Compile Include="Configuration\HealthChecks\NotificationMethodSettingsElement.cs" />
<Compile Include="Configuration\HealthChecks\NotificationMethodSettingsElementCollection.cs" />
<Compile Include="Configuration\IFileSystemProviderElement.cs" />
<Compile Include="Configuration\IFileSystemProvidersSection.cs" />
<Compile Include="Configuration\IGlobalSettings.cs" />
<Compile Include="Configuration\InnerTextConfigurationElement.cs" />
<Compile Include="Configuration\LocalTempStorage.cs" />
-50
View File
@@ -1,58 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="umbracoConfiguration">
<section name="FileSystemProviders" type="Umbraco.Core.Configuration.FileSystemProvidersSection, Umbraco.Core" requirePermission="false"/>
</sectionGroup>
</configSections>
<umbracoConfiguration>
<FileSystemProviders>
<Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="Media\"/>
<add key="rootUrl" value="/Media/"/>
</Parameters>
</Provider>
<!-- Macros -->
<Provider alias="macros" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="App_Data\Macros"/>
<add key="rootUrl" value="/Macros/"/>
</Parameters>
</Provider>
<!-- Scripts -->
<Provider alias="scripts" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="scripts\"/>
<add key="rootUrl" value="/scripts/"/>
</Parameters>
</Provider>
<!-- Stylesheets -->
<Provider alias="stylesheets" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="css\"/>
<add key="rootUrl" value="/css/"/>
</Parameters>
</Provider>
<!-- Templates -->
<Provider alias="masterpages" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="masterpages\"/>
<add key="rootUrl" value="/masterpages/"/>
</Parameters>
</Provider>
<Provider alias="views" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="views\"/>
<add key="rootUrl" value="/views/"/>
</Parameters>
</Provider>
</FileSystemProviders>
</umbracoConfiguration>
<appSettings>
<add key="umbracoConfigurationStatus" value="6.0.0"/>
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd,~/.well-known" />
@@ -1,25 +0,0 @@
using System;
using System.Configuration;
using System.Linq;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
namespace Umbraco.Tests.Configurations
{
[TestFixture]
public class FileSystemProviderTests
{
[Test]
public void Can_Get_Media_Provider()
{
var config = (FileSystemProvidersSection)ConfigurationManager.GetSection("umbracoConfiguration/FileSystemProviders");
var providerConfig = config.Providers["media"];
Assert.That(providerConfig, Is.Not.Null);
Assert.That(providerConfig.Parameters.AllKeys.Any(), Is.True);
}
}
}
-1
View File
@@ -294,7 +294,6 @@
<Compile Include="Cache\HttpRequestAppCacheTests.cs" />
<Compile Include="Cache\WebCachingAppCacheTests.cs" />
<Compile Include="Cache\RuntimeAppCacheTests.cs" />
<Compile Include="Configurations\FileSystemProviderTests.cs" />
<Compile Include="Configurations\UmbracoSettings\ContentElementDefaultTests.cs" />
<Compile Include="Configurations\UmbracoSettings\ContentElementTests.cs" />
<Compile Include="Configurations\UmbracoSettings\LoggingElementDefaultTests.cs" />
-4
View File
@@ -177,9 +177,6 @@
<Content Include="Config\imageprocessor\cache.config">
<SubType>Designer</SubType>
</Content>
<None Include="Config\FileSystemProviders.Release.config">
<DependentUpon>FileSystemProviders.config</DependentUpon>
</None>
<None Include="Config\EmbeddedMedia.Release.config">
<DependentUpon>EmbeddedMedia.config</DependentUpon>
</None>
@@ -302,7 +299,6 @@
<Content Include="Config\umbracoSettings.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Config\FileSystemProviders.config" />
<Content Include="Config\EmbeddedMedia.config" />
<Content Include="Config\BackOfficeTours\getting-started.json" />
</ItemGroup>
@@ -1,11 +0,0 @@
<?xml version="1.0"?>
<FileSystemProviders>
<!-- Media -->
<Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="virtualRoot" value="~/media/" />
</Parameters>
</Provider>
</FileSystemProviders>
@@ -1,11 +0,0 @@
<?xml version="1.0"?>
<FileSystemProviders>
<!-- Media -->
<Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="virtualRoot" value="~/media/" />
</Parameters>
</Provider>
</FileSystemProviders>
-2
View File
@@ -12,7 +12,6 @@
<sectionGroup name="umbracoConfiguration">
<section name="settings" type="Umbraco.Core.Configuration.UmbracoSettings.UmbracoSettingsSection, Umbraco.Core" requirePermission="false" />
<section name="FileSystemProviders" type="Umbraco.Core.Configuration.FileSystemProvidersSection, Umbraco.Core" requirePermission="false" />
<section name="HealthChecks" type="Umbraco.Core.Configuration.HealthChecks.HealthChecksSection, Umbraco.Core" requirePermission="false" />
</sectionGroup>
@@ -25,7 +24,6 @@
<umbracoConfiguration>
<settings configSource="config\umbracoSettings.config" />
<FileSystemProviders configSource="config\FileSystemProviders.config" />
<HealthChecks configSource="config\HealthChecks.config" />
</umbracoConfiguration>
@@ -100,8 +100,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
var originPublished = origin.PublishedContent;
DraftContent = new PublishedContent(this, originDraft, umbracoContextAccessor);
PublishedContent = new PublishedContent(this, originPublished, umbracoContextAccessor);
DraftContent = originDraft == null ? null : new PublishedContent(this, originDraft, umbracoContextAccessor);
PublishedContent = originPublished == null ? null : new PublishedContent(this, originPublished, umbracoContextAccessor);
DraftModel = DraftContent?.CreateModel();
PublishedModel = PublishedContent?.CreateModel();