Merge branch 'netcore/feature/abstract-systemdirectories' into netcore/feature/AB3594_move_exsiting_configuration_to_own_project
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
namespace Umbraco.Core.IO
|
||||
{
|
||||
@@ -34,11 +35,12 @@ namespace Umbraco.Core.IO
|
||||
#region Constructor
|
||||
|
||||
// DI wants a public ctor
|
||||
public FileSystems(IFactory container, ILogger logger, IIOHelper ioHelper)
|
||||
public FileSystems(IFactory container, ILogger logger, IIOHelper ioHelper, IGlobalSettings globalSettings)
|
||||
{
|
||||
_container = container;
|
||||
_logger = logger;
|
||||
_ioHelper = ioHelper;
|
||||
_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
// for tests only, totally unsafe
|
||||
@@ -124,8 +126,8 @@ namespace Umbraco.Core.IO
|
||||
{
|
||||
var macroPartialFileSystem = new PhysicalFileSystem(Constants.SystemDirectories.MacroPartials);
|
||||
var partialViewsFileSystem = new PhysicalFileSystem(Constants.SystemDirectories.PartialViews);
|
||||
var stylesheetsFileSystem = new PhysicalFileSystem(_ioHelper.Css);
|
||||
var scriptsFileSystem = new PhysicalFileSystem(_ioHelper.Scripts);
|
||||
var stylesheetsFileSystem = new PhysicalFileSystem(_globalSettings.UmbracoCssPath);
|
||||
var scriptsFileSystem = new PhysicalFileSystem(_globalSettings.UmbracoScriptsPath);
|
||||
var mvcViewsFileSystem = new PhysicalFileSystem(Constants.SystemDirectories.MvcViews);
|
||||
|
||||
_macroPartialFileSystem = new ShadowWrapper(macroPartialFileSystem, "macro-partials", IsScoped);
|
||||
@@ -149,6 +151,7 @@ namespace Umbraco.Core.IO
|
||||
#region Providers
|
||||
|
||||
private readonly Dictionary<Type, string> _paths = new Dictionary<Type, string>();
|
||||
private IGlobalSettings _globalSettings;
|
||||
|
||||
// internal for tests
|
||||
internal IReadOnlyDictionary<Type, string> Paths => _paths;
|
||||
|
||||
@@ -12,13 +12,8 @@ namespace Umbraco.Core.IO
|
||||
{
|
||||
public class IOHelper : IIOHelper
|
||||
{
|
||||
private readonly IGlobalSettings _globalSettings;
|
||||
internal static IIOHelper Default { get; } = new IOHelper(new GlobalSettings());
|
||||
internal static IIOHelper Default { get; } = new IOHelper();
|
||||
|
||||
public IOHelper(IGlobalSettings globalSettings)
|
||||
{
|
||||
_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value forcing Umbraco to consider it is non-hosted.
|
||||
@@ -292,15 +287,6 @@ namespace Umbraco.Core.IO
|
||||
return path.EnsurePathIsApplicationRootPrefixed();
|
||||
}
|
||||
|
||||
|
||||
public string Media => _globalSettings.UmbracoMediaPath;
|
||||
|
||||
public string Scripts => _globalSettings.UmbracoScriptsPath;
|
||||
|
||||
public string Css => _globalSettings.UmbracoCssPath;
|
||||
|
||||
public string Umbraco => _globalSettings.UmbracoPath;
|
||||
|
||||
private string _root;
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user