V15/task/cleanup obsolete (#17433)

* Replace obsolete UserGroup Alias consts to key equivalent in tests

* Update use of usergroup alias consts to key equivalent in IsSystemgroup extension method

* Obsolete (internally) unused helper function which purpose doesn't even seem true

* Prepped EmbedProviders for proper removal of non async methods and unneeded proxy methods

* Remove obsoleted UmbracoPath and updated internal references

* Corrected  mistake and updated unittets

* Update usergroup tests that use aliases for "system" groups

* Replace more uses of globalsettings.UmbracoPath

* Remove GetDateType by key non async

* Cleanup some usages of hostingEnvironment.MapPathContentRoot

* More easy obsoletion cleanup

* Small Typeload cleanup

* More obsolete removal

* Deploy obsoletion cleanup

* Remove obsolete methods from OEmbedProviderBase.cs

---------

Co-authored-by: Zeegaan <skrivdetud@gmail.com>
This commit is contained in:
Sven Geusens
2024-11-07 12:20:22 +01:00
committed by GitHub
parent 669c585ac4
commit e7eb14d310
75 changed files with 436 additions and 916 deletions

View File

@@ -1,23 +1,48 @@
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Hosting;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Extensions;
using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment;
namespace Umbraco.Cms.Infrastructure.ModelsBuilder;
public sealed class ModelsGenerationError
{
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IHostEnvironment _hostEnvironment;
private ModelsBuilderSettings _config;
/// <summary>
/// Initializes a new instance of the <see cref="ModelsGenerationError" /> class.
/// </summary>
[Obsolete("Use a not obsoleted constructor instead. Scheduled for removal in v16")]
public ModelsGenerationError(IOptionsMonitor<ModelsBuilderSettings> config, IHostingEnvironment hostingEnvironment)
{
_config = config.CurrentValue;
_hostingEnvironment = hostingEnvironment;
config.OnChange(x => _config = x);
_hostEnvironment = StaticServiceProvider.Instance.GetRequiredService<IHostEnvironment>();
}
/// <summary>
/// Initializes a new instance of the <see cref="ModelsGenerationError" /> class.
/// </summary>
[Obsolete("Use a not obsoleted constructor instead. Scheduled for removal in v16")]
public ModelsGenerationError(
IOptionsMonitor<ModelsBuilderSettings> config,
IHostingEnvironment hostingEnvironment,
IHostEnvironment hostEnvironment)
{
_config = config.CurrentValue;
config.OnChange(x => _config = x);
_hostEnvironment = hostEnvironment;
}
public ModelsGenerationError(IOptionsMonitor<ModelsBuilderSettings> config, IHostEnvironment hostEnvironment)
{
_config = config.CurrentValue;
_hostEnvironment = hostEnvironment;
config.OnChange(x => _config = x);
}
@@ -73,7 +98,7 @@ public sealed class ModelsGenerationError
private string? GetErrFile()
{
var modelsDirectory = _config.ModelsDirectoryAbsolute(_hostingEnvironment);
var modelsDirectory = _config.ModelsDirectoryAbsolute(_hostEnvironment);
if (!Directory.Exists(modelsDirectory))
{
return null;