Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Bjarke Berg
2020-10-01 08:15:34 +02:00
parent 81e2ebda96
commit 74f8c6fb74
3 changed files with 8 additions and 9 deletions

View File

@@ -30,7 +30,6 @@ namespace Umbraco.Composing
public static IProfiler Profiler => EnsureInitialized(_profiler);
public static SecuritySettings SecuritySettings => EnsureInitialized(_securitySettings);
public static GlobalSettings GlobalSettings => EnsureInitialized(_globalSettings);
public static ILoggerFactory LoggerFactory => EnsureInitialized(_loggerFactory);
public static bool IsInitialized { get; internal set; }
@@ -45,7 +44,6 @@ namespace Umbraco.Composing
public static void Initialize(
ILogger<object> logger,
ILoggerFactory loggerFactory,
SecuritySettings securitySettings,
GlobalSettings globalSettings,
IIOHelper ioHelper,
@@ -59,7 +57,6 @@ namespace Umbraco.Composing
}
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
_ioHelper = ioHelper ?? throw new ArgumentNullException(nameof(ioHelper));
_hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
_backOfficeInfo = backOfficeInfo ?? throw new ArgumentNullException(nameof(backOfficeInfo));

View File

@@ -89,7 +89,6 @@ namespace Umbraco.Core.Composing
// after cross wiring, configure "Current"
Current.Initialize(
_container.GetInstance<ILogger<object>>(),
_container.GetInstance<ILoggerFactory>(),
_container.GetInstance<IOptions<SecuritySettings>>().Value,
_container.GetInstance<IOptions<GlobalSettings>>().Value,
_container.GetInstance<IIOHelper>(),

View File

@@ -36,9 +36,11 @@ namespace Umbraco.Web
/// </summary>
public abstract class UmbracoApplicationBase : HttpApplication
{
private readonly ILogger<UmbracoApplicationBase> _logger;
private readonly SecuritySettings _securitySettings;
private readonly GlobalSettings _globalSettings;
private readonly ConnectionStrings _connectionStrings;
private readonly IIOHelper _ioHelper;
private IRuntime _runtime;
private IFactory _factory;
private ILoggerFactory _loggerFactory;
@@ -61,7 +63,6 @@ namespace Umbraco.Web
var backOfficeInfo = new AspNetBackOfficeInfo(globalSettings, ioHelper, _loggerFactory.CreateLogger<AspNetBackOfficeInfo>(), Options.Create(webRoutingSettings));
var profiler = GetWebProfiler(hostingEnvironment);
Umbraco.Composing.Current.Initialize(NullLogger<object>.Instance,
_loggerFactory,
securitySettings,
globalSettings,
ioHelper, hostingEnvironment, backOfficeInfo, profiler);
@@ -87,15 +88,17 @@ namespace Umbraco.Web
protected UmbracoApplicationBase(ILogger<UmbracoApplicationBase> logger, ILoggerFactory loggerFactory, SecuritySettings securitySettings, GlobalSettings globalSettings, ConnectionStrings connectionStrings, IIOHelper ioHelper, IProfiler profiler, IHostingEnvironment hostingEnvironment, IBackOfficeInfo backOfficeInfo)
{
_logger = logger;
_securitySettings = securitySettings;
_globalSettings = globalSettings;
_connectionStrings = connectionStrings;
_ioHelper = ioHelper;
_loggerFactory = loggerFactory;
if (!Umbraco.Composing.Current.IsInitialized)
{
Logger = logger;
Umbraco.Composing.Current.Initialize(logger, _loggerFactory, securitySettings, globalSettings, ioHelper, hostingEnvironment, backOfficeInfo, profiler);
Umbraco.Composing.Current.Initialize(logger, securitySettings, globalSettings, ioHelper, hostingEnvironment, backOfficeInfo, profiler);
}
}
@@ -187,9 +190,9 @@ namespace Umbraco.Web
_globalSettings,
_connectionStrings,
umbracoVersion,
Umbraco.Composing.Current.IOHelper,
Umbraco.Composing.Current.Logger,
Umbraco.Composing.Current.LoggerFactory,
_ioHelper,
_logger,
_loggerFactory,
Umbraco.Composing.Current.Profiler,
Umbraco.Composing.Current.HostingEnvironment,
Umbraco.Composing.Current.BackOfficeInfo);