Avoid usage of IOHelper in GlobalSettings
This commit is contained in:
@@ -52,15 +52,13 @@ namespace Umbraco.Core
|
||||
public static ICoreDebug CoreDebug(this Configs configs)
|
||||
=> configs.GetConfig<ICoreDebug>();
|
||||
|
||||
public static void AddCoreConfigs(this Configs configs, IIOHelper ioHelper)
|
||||
public static void AddCoreConfigs(this Configs configs)
|
||||
{
|
||||
var configDir = new DirectoryInfo(ioHelper.MapPath(Constants.SystemDirectories.Config));
|
||||
|
||||
// GridConfig depends on runtime caches, manifest parsers... and cannot be available during composition
|
||||
configs.Add<IGridConfig>(factory => new GridConfig(
|
||||
factory.GetInstance<ILogger>(),
|
||||
factory.GetInstance<AppCaches>(),
|
||||
configDir,
|
||||
new DirectoryInfo(factory.GetInstance<IIOHelper>().MapPath(Constants.SystemDirectories.Config)),
|
||||
factory.GetInstance<IManifestParser>(),
|
||||
factory.GetInstance<IRuntimeState>().Debug));
|
||||
}
|
||||
|
||||
@@ -28,14 +28,15 @@ namespace Umbraco.Core.Configuration
|
||||
return _mvcArea;
|
||||
}
|
||||
|
||||
//TODO Move to IOHelper
|
||||
internal static string GetUmbracoMvcAreaNoCache(this IGlobalSettings globalSettings, IIOHelper ioHelper)
|
||||
{
|
||||
if (globalSettings.Path.IsNullOrWhiteSpace())
|
||||
if (ioHelper.BackOfficePath.IsNullOrWhiteSpace())
|
||||
{
|
||||
throw new InvalidOperationException("Cannot create an MVC Area path without the umbracoPath specified");
|
||||
}
|
||||
|
||||
var path = globalSettings.Path;
|
||||
var path = ioHelper.BackOfficePath;
|
||||
if (path.StartsWith(ioHelper.Root)) // beware of TrimStart, see U4-2518
|
||||
path = path.Substring(ioHelper.Root.Length);
|
||||
return path.TrimStart('~').TrimStart('/').Replace('/', '-').Trim().ToLower();
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
string ReservedPaths { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to umbraco's root directory (/umbraco by default).
|
||||
/// Gets the path to umbraco's root directory.
|
||||
/// </summary>
|
||||
string Path { get; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user