Merge branch 'netcore/dev' into netcore/feature/AB4687-move-healthchecks-from-web

This commit is contained in:
elitsa
2020-01-27 15:11:51 +01:00
7 changed files with 116 additions and 110 deletions
+10 -6
View File
@@ -10,25 +10,27 @@ namespace Umbraco.Composing
{
public static class Current
{
private static bool _initialized;
private static ILogger _logger = new NullLogger();
private static Configs _configs;
private static IIOHelper _ioHelper;
private static IHostingEnvironment _hostingEnvironment;
private static IBackOfficeInfo _backOfficeInfo;
private static IProfiler _profiler;
public static ILogger Logger => EnsureInitialized(_logger);
public static Configs Configs => EnsureInitialized(_configs);
public static IIOHelper IOHelper => EnsureInitialized(_ioHelper);
public static IHostingEnvironment HostingEnvironment => EnsureInitialized(_hostingEnvironment);
public static IBackOfficeInfo BackOfficeInfo => EnsureInitialized(_backOfficeInfo);
public static IProfiler Profiler => EnsureInitialized(_profiler);
public static bool IsInitialized { get; private set; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static T EnsureInitialized<T>(T returnValue)
where T : class
{
if (returnValue is null && !_initialized)
if (returnValue is null && !IsInitialized)
throw new InvalidOperationException("Current cannot be used before initialize");
return returnValue;
}
@@ -38,9 +40,10 @@ namespace Umbraco.Composing
Configs configs,
IIOHelper ioHelper,
IHostingEnvironment hostingEnvironment,
IBackOfficeInfo backOfficeInfo)
IBackOfficeInfo backOfficeInfo,
IProfiler profiler)
{
if (_initialized)
if (IsInitialized)
{
throw new InvalidOperationException("Current cannot be initialized more than once");
}
@@ -50,8 +53,9 @@ namespace Umbraco.Composing
_ioHelper = ioHelper ?? throw new ArgumentNullException(nameof(ioHelper));
_hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
_backOfficeInfo = backOfficeInfo ?? throw new ArgumentNullException(nameof(backOfficeInfo));
_profiler = profiler ?? throw new ArgumentNullException(nameof(profiler));
_initialized = true;
IsInitialized = true;
}
}
}
@@ -7,7 +7,7 @@ namespace Umbraco.ModelsBuilder.Embedded
/// </summary>
/// <remarks>And therefore it should not be generated.</remarks>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class ImplementPropertyTypeAttribute : Attribute
public class ImplementPropertyTypeAttribute : Attribute
{
public ImplementPropertyTypeAttribute(string alias)
{
@@ -17,7 +17,7 @@ namespace Umbraco.Web
/// <summary>
/// Gets the value of a property.
/// </summary>
public static TValue Value<TModel, TValue>(this TModel model, Expression<Func<TModel, TValue>> property, string culture = null, string segment = null, Fallback fallback = default, TValue defaultValue = default)
public static TValue ValueFor<TModel, TValue>(this TModel model, Expression<Func<TModel, TValue>> property, string culture = null, string segment = null, Fallback fallback = default, TValue defaultValue = default)
where TModel : IPublishedElement
{
var alias = GetAlias(model, property);
+73 -64
View File
@@ -1099,9 +1099,9 @@
"dev": true
},
"angular": {
"version": "1.7.5",
"resolved": "https://registry.npmjs.org/angular/-/angular-1.7.5.tgz",
"integrity": "sha512-760183yxtGzni740IBTieNuWLtPNAoMqvmC0Z62UoU0I3nqk+VJuO3JbQAXOyvo3Oy/ZsdNQwrSTh/B0OQZjNw=="
"version": "1.7.9",
"resolved": "https://registry.npmjs.org/angular/-/angular-1.7.9.tgz",
"integrity": "sha512-5se7ZpcOtu0MBFlzGv5dsM1quQDoDeUTwZrWjGtTNA7O88cD8TEk5IEKCTDa3uECV9XnvKREVUr7du1ACiWGFQ=="
},
"angular-animate": {
"version": "1.7.5",
@@ -9266,9 +9266,9 @@
}
},
"npm": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/npm/-/npm-6.12.0.tgz",
"integrity": "sha512-juj5VkB3/k+PWbJUnXD7A/8oc8zLusDnK/sV9PybSalsbOVOTIp5vSE0rz5rQ7BsmUgQS47f/L2GYQnWXaKgnQ==",
"version": "6.13.6",
"resolved": "https://registry.npmjs.org/npm/-/npm-6.13.6.tgz",
"integrity": "sha512-NomC08kv7HIl1FOyLOe9Hp89kYsOsvx52huVIJ7i8hFW8Xp65lDwe/8wTIrh9q9SaQhA8hTrfXPh3BEL3TmMpw==",
"requires": {
"JSONStream": "^1.3.5",
"abbrev": "~1.1.1",
@@ -9276,12 +9276,12 @@
"ansistyles": "~0.1.3",
"aproba": "^2.0.0",
"archy": "~1.0.0",
"bin-links": "^1.1.3",
"bin-links": "^1.1.6",
"bluebird": "^3.5.5",
"byte-size": "^5.0.1",
"cacache": "^12.0.3",
"call-limit": "^1.1.1",
"chownr": "^1.1.2",
"chownr": "^1.1.3",
"ci-info": "^2.0.0",
"cli-columns": "^3.1.2",
"cli-table3": "^0.5.1",
@@ -9297,9 +9297,9 @@
"find-npm-prefix": "^1.0.2",
"fs-vacuum": "~1.2.10",
"fs-write-stream-atomic": "~1.0.10",
"gentle-fs": "^2.2.1",
"gentle-fs": "^2.3.0",
"glob": "^7.1.4",
"graceful-fs": "^4.2.2",
"graceful-fs": "^4.2.3",
"has-unicode": "~2.0.1",
"hosted-git-info": "^2.8.5",
"iferr": "^1.0.2",
@@ -9312,7 +9312,7 @@
"is-cidr": "^3.0.0",
"json-parse-better-errors": "^1.0.2",
"lazy-property": "~1.0.0",
"libcipm": "^4.0.4",
"libcipm": "^4.0.7",
"libnpm": "^3.0.1",
"libnpmaccess": "^3.0.2",
"libnpmhook": "^5.0.3",
@@ -9346,25 +9346,25 @@
"npm-install-checks": "^3.0.2",
"npm-lifecycle": "^3.1.4",
"npm-package-arg": "^6.1.1",
"npm-packlist": "^1.4.4",
"npm-packlist": "^1.4.7",
"npm-pick-manifest": "^3.0.2",
"npm-profile": "^4.0.2",
"npm-registry-fetch": "^4.0.0",
"npm-registry-fetch": "^4.0.2",
"npm-user-validate": "~1.0.0",
"npmlog": "~4.1.2",
"once": "~1.4.0",
"opener": "^1.5.1",
"osenv": "^0.1.5",
"pacote": "^9.5.8",
"pacote": "^9.5.12",
"path-is-inside": "~1.0.2",
"promise-inflight": "~1.0.1",
"qrcode-terminal": "^0.12.0",
"query-string": "^6.8.2",
"qw": "~1.0.1",
"read": "~1.0.7",
"read-cmd-shim": "^1.0.4",
"read-cmd-shim": "^1.0.5",
"read-installed": "~4.0.3",
"read-package-json": "^2.1.0",
"read-package-json": "^2.1.1",
"read-package-tree": "^5.3.1",
"readable-stream": "^3.4.0",
"readdir-scoped-modules": "^1.1.0",
@@ -9379,7 +9379,7 @@
"sorted-union-stream": "~2.1.3",
"ssri": "^6.0.1",
"stringify-package": "^1.0.1",
"tar": "^4.4.12",
"tar": "^4.4.13",
"text-table": "~0.2.0",
"tiny-relative-date": "^1.3.0",
"uid-number": "0.0.6",
@@ -9387,7 +9387,7 @@
"unique-filename": "^1.1.1",
"unpipe": "~1.0.0",
"update-notifier": "^2.5.0",
"uuid": "^3.3.2",
"uuid": "^3.3.3",
"validate-npm-package-license": "^3.0.4",
"validate-npm-package-name": "~3.0.0",
"which": "^1.3.1",
@@ -9535,13 +9535,14 @@
}
},
"bin-links": {
"version": "1.1.3",
"version": "1.1.6",
"bundled": true,
"requires": {
"bluebird": "^3.5.3",
"cmd-shim": "^3.0.0",
"gentle-fs": "^2.0.1",
"gentle-fs": "^2.3.0",
"graceful-fs": "^4.1.15",
"npm-normalize-package-bin": "^1.0.0",
"write-file-atomic": "^2.3.0"
}
},
@@ -9633,7 +9634,7 @@
}
},
"chownr": {
"version": "1.1.2",
"version": "1.1.3",
"bundled": true
},
"ci-info": {
@@ -10194,7 +10195,7 @@
},
"dependencies": {
"minipass": {
"version": "2.8.6",
"version": "2.9.0",
"bundled": true,
"requires": {
"safe-buffer": "^5.1.2",
@@ -10290,11 +10291,12 @@
"bundled": true
},
"gentle-fs": {
"version": "2.2.1",
"version": "2.3.0",
"bundled": true,
"requires": {
"aproba": "^1.1.2",
"chownr": "^1.1.2",
"cmd-shim": "^3.0.3",
"fs-vacuum": "^1.2.10",
"graceful-fs": "^4.1.11",
"iferr": "^0.1.5",
@@ -10376,7 +10378,7 @@
}
},
"graceful-fs": {
"version": "4.2.2",
"version": "4.2.3",
"bundled": true
},
"har-schema": {
@@ -10436,7 +10438,7 @@
}
},
"https-proxy-agent": {
"version": "2.2.2",
"version": "2.2.4",
"bundled": true,
"requires": {
"agent-base": "^4.3.0",
@@ -10462,7 +10464,7 @@
"bundled": true
},
"ignore-walk": {
"version": "3.0.1",
"version": "3.0.3",
"bundled": true,
"requires": {
"minimatch": "^3.0.4"
@@ -10676,7 +10678,7 @@
}
},
"libcipm": {
"version": "4.0.4",
"version": "4.0.7",
"bundled": true,
"requires": {
"bin-links": "^1.1.2",
@@ -10945,14 +10947,14 @@
}
},
"make-fetch-happen": {
"version": "5.0.0",
"version": "5.0.2",
"bundled": true,
"requires": {
"agentkeepalive": "^3.4.1",
"cacache": "^12.0.0",
"http-cache-semantics": "^3.8.1",
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^2.2.1",
"https-proxy-agent": "^2.2.3",
"lru-cache": "^5.1.1",
"mississippi": "^3.0.0",
"node-fetch-npm": "^2.0.2",
@@ -10998,27 +11000,23 @@
"version": "0.0.8",
"bundled": true
},
"minipass": {
"version": "2.3.3",
"minizlib": {
"version": "1.3.3",
"bundled": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
"minipass": "^2.9.0"
},
"dependencies": {
"yallist": {
"version": "3.0.2",
"bundled": true
"minipass": {
"version": "2.9.0",
"bundled": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
}
}
}
},
"minizlib": {
"version": "1.2.2",
"bundled": true,
"requires": {
"minipass": "^2.2.1"
}
},
"mississippi": {
"version": "3.0.0",
"bundled": true,
@@ -11143,8 +11141,11 @@
}
},
"npm-bundled": {
"version": "1.0.6",
"bundled": true
"version": "1.1.1",
"bundled": true,
"requires": {
"npm-normalize-package-bin": "^1.0.1"
}
},
"npm-cache-filename": {
"version": "1.0.2",
@@ -11175,6 +11176,10 @@
"version": "1.2.1",
"bundled": true
},
"npm-normalize-package-bin": {
"version": "1.0.1",
"bundled": true
},
"npm-package-arg": {
"version": "6.1.1",
"bundled": true,
@@ -11186,7 +11191,7 @@
}
},
"npm-packlist": {
"version": "1.4.4",
"version": "1.4.7",
"bundled": true,
"requires": {
"ignore-walk": "^3.0.1",
@@ -11212,7 +11217,7 @@
}
},
"npm-registry-fetch": {
"version": "4.0.0",
"version": "4.0.2",
"bundled": true,
"requires": {
"JSONStream": "^1.3.4",
@@ -11220,7 +11225,14 @@
"figgy-pudding": "^3.4.1",
"lru-cache": "^5.1.1",
"make-fetch-happen": "^5.0.0",
"npm-package-arg": "^6.1.0"
"npm-package-arg": "^6.1.0",
"safe-buffer": "^5.2.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.0",
"bundled": true
}
}
},
"npm-run-path": {
@@ -11337,7 +11349,7 @@
}
},
"pacote": {
"version": "9.5.8",
"version": "9.5.12",
"bundled": true,
"requires": {
"bluebird": "^3.5.3",
@@ -11354,6 +11366,7 @@
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",
"normalize-package-data": "^2.4.0",
"npm-normalize-package-bin": "^1.0.0",
"npm-package-arg": "^6.1.0",
"npm-packlist": "^1.1.12",
"npm-pick-manifest": "^3.0.0",
@@ -11372,7 +11385,7 @@
},
"dependencies": {
"minipass": {
"version": "2.3.5",
"version": "2.9.0",
"bundled": true,
"requires": {
"safe-buffer": "^5.1.2",
@@ -11572,7 +11585,7 @@
}
},
"read-cmd-shim": {
"version": "1.0.4",
"version": "1.0.5",
"bundled": true,
"requires": {
"graceful-fs": "^4.1.2"
@@ -11592,14 +11605,14 @@
}
},
"read-package-json": {
"version": "2.1.0",
"version": "2.1.1",
"bundled": true,
"requires": {
"glob": "^7.1.1",
"graceful-fs": "^4.1.2",
"json-parse-better-errors": "^1.0.1",
"normalize-package-data": "^2.0.0",
"slash": "^1.0.0"
"npm-normalize-package-bin": "^1.0.0"
}
},
"read-package-tree": {
@@ -11752,24 +11765,20 @@
"version": "3.0.2",
"bundled": true
},
"slash": {
"version": "1.0.0",
"bundled": true
},
"slide": {
"version": "1.1.6",
"bundled": true
},
"smart-buffer": {
"version": "4.0.2",
"version": "4.1.0",
"bundled": true
},
"socks": {
"version": "2.3.2",
"version": "2.3.3",
"bundled": true,
"requires": {
"ip": "^1.1.5",
"smart-buffer": "4.0.2"
"ip": "1.1.5",
"smart-buffer": "^4.1.0"
}
},
"socks-proxy-agent": {
@@ -11984,7 +11993,7 @@
}
},
"tar": {
"version": "4.4.12",
"version": "4.4.13",
"bundled": true,
"requires": {
"chownr": "^1.1.1",
@@ -11997,7 +12006,7 @@
},
"dependencies": {
"minipass": {
"version": "2.8.6",
"version": "2.9.0",
"bundled": true,
"requires": {
"safe-buffer": "^5.1.2",
@@ -12159,7 +12168,7 @@
}
},
"uuid": {
"version": "3.3.2",
"version": "3.3.3",
"bundled": true
},
"validate-npm-package-license": {
+2 -2
View File
@@ -11,7 +11,7 @@
},
"dependencies": {
"ace-builds": "1.4.2",
"angular": "1.7.5",
"angular": "1.7.9",
"angular-animate": "1.7.5",
"angular-aria": "1.7.5",
"angular-chart.js": "^1.1.1",
@@ -39,7 +39,7 @@
"moment": "2.22.2",
"ng-file-upload": "12.2.13",
"nouislider": "14.1.1",
"npm": "6.12.0",
"npm": "6.13.6",
"signalr": "2.4.0",
"spectrum-colorpicker": "1.8.0",
"tinymce": "4.9.2",
+3 -10
View File
@@ -112,12 +112,6 @@
<PackageReference Include="System.ComponentModel.Annotations" Version="4.6.0" />
<PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<ProjectReference Include="..\Umbraco.TestData\Umbraco.TestData.csproj">
<Project>{fb5676ed-7a69-492c-b802-e7b24144c0fc}</Project>
<Name>Umbraco.TestData</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Abstractions\Umbraco.Abstractions.csproj">
<Project>{29aa69d9-b597-4395-8d42-43b1263c240a}</Project>
@@ -131,10 +125,6 @@
<Project>{52ac0ba8-a60e-4e36-897b-e8b97a54ed1c}</Project>
<Name>Umbraco.ModelsBuilder.Embedded</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.TestData\Umbraco.TestData.csproj">
<Project>{fb5676ed-7a69-492c-b802-e7b24144c0fc}</Project>
<Name>Umbraco.TestData</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web\Umbraco.Web.csproj">
<Project>{651e1350-91b6-44b7-bd60-7207006d7003}</Project>
<Name>Umbraco.Web</Name>
@@ -357,6 +347,9 @@
<DevelopmentServerPort>9000</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:9000/</IISUrl>
<DevelopmentServerPort>8700</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:8700</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
+26 -26
View File
@@ -23,43 +23,36 @@ namespace Umbraco.Web
{
private IRuntime _runtime;
private readonly ILogger _logger;
private readonly Configs _configs;
private readonly IIOHelper _ioHelper;
private readonly IProfiler _profiler;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IBackOfficeInfo _backOfficeInfo;
private IFactory _factory;
protected UmbracoApplicationBase()
{
var configFactory = new ConfigsFactory();
var hostingSettings = configFactory.HostingSettings;
var coreDebug = configFactory.CoreDebug;
if (!Umbraco.Composing.Current.IsInitialized)
{
var configFactory = new ConfigsFactory();
_hostingEnvironment = new AspNetHostingEnvironment(hostingSettings);
_ioHelper = new IOHelper(_hostingEnvironment);
_configs = configFactory.Create(_ioHelper);
var hostingSettings = configFactory.HostingSettings;
var coreDebug = configFactory.CoreDebug;
_profiler = new LogProfiler(_logger);
var hostingEnvironment = new AspNetHostingEnvironment(hostingSettings);
var ioHelper = new IOHelper(hostingEnvironment);
var configs = configFactory.Create(ioHelper);
_logger = SerilogLogger.CreateWithDefaultConfiguration(_hostingEnvironment, new AspNetSessionIdResolver(), () => _factory?.GetInstance<IRequestCache>(), coreDebug, _ioHelper, new FrameworkMarchal());
_backOfficeInfo = new AspNetBackOfficeInfo(_configs.Global(), _ioHelper, _configs.Settings(), _logger);
var logger = SerilogLogger.CreateWithDefaultConfiguration(hostingEnvironment, new AspNetSessionIdResolver(), () => _factory?.GetInstance<IRequestCache>(), coreDebug, ioHelper, new FrameworkMarchal());
var backOfficeInfo = new AspNetBackOfficeInfo(configs.Global(), ioHelper, configs.Settings(), logger);
var profiler = new LogProfiler(logger);
Umbraco.Composing.Current.Initialize(logger, configs, ioHelper, hostingEnvironment, backOfficeInfo, profiler);
}
Umbraco.Composing.Current.Initialize(_logger, _configs, _ioHelper, _hostingEnvironment, _backOfficeInfo);
}
protected UmbracoApplicationBase(ILogger logger, Configs configs, IIOHelper ioHelper, IProfiler profiler, IHostingEnvironment hostingEnvironment, IBackOfficeInfo backOfficeInfo)
{
_logger = logger;
_configs = configs;
_ioHelper = ioHelper;
_profiler = profiler;
_hostingEnvironment = hostingEnvironment;
_backOfficeInfo = backOfficeInfo;
Umbraco.Composing.Current.Initialize(_logger, _configs, _ioHelper, _hostingEnvironment, _backOfficeInfo);
if (!Umbraco.Composing.Current.IsInitialized)
{
Umbraco.Composing.Current.Initialize(logger, configs, ioHelper, hostingEnvironment, backOfficeInfo, profiler);
}
}
@@ -105,13 +98,20 @@ namespace Umbraco.Web
// ******** THIS IS WHERE EVERYTHING BEGINS ********
var globalSettings = _configs.Global();
var globalSettings = Umbraco.Composing.Current.Configs.Global();
var umbracoVersion = new UmbracoVersion(globalSettings);
// create the register for the application, and boot
// the boot manager is responsible for registrations
var register = GetRegister(globalSettings);
_runtime = GetRuntime(_configs, umbracoVersion, _ioHelper, _logger, _profiler, _hostingEnvironment, _backOfficeInfo);
_runtime = GetRuntime(
Umbraco.Composing.Current.Configs,
umbracoVersion,
Umbraco.Composing.Current.IOHelper,
Umbraco.Composing.Current.Logger,
Umbraco.Composing.Current.Profiler,
Umbraco.Composing.Current.HostingEnvironment,
Umbraco.Composing.Current.BackOfficeInfo);
_factory =_runtime.Boot(register);
}