MediaFileSystem created with reflection due to chicken and egg situation with registration

This commit is contained in:
Lars-Erik Aabech
2018-09-02 22:56:55 +02:00
committed by Lars-Erik Aabech
parent ee654d0896
commit 97318ace1d
7 changed files with 16 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Logging;
@@ -19,12 +20,12 @@ namespace Umbraco.Core.IO
[FileSystemProvider("media")]
public class MediaFileSystem : FileSystemWrapper
{
public MediaFileSystem(IFileSystem wrapped, IContentSection contentConfig, IMediaPathScheme mediaPathScheme, ILogger logger)
public MediaFileSystem(IFileSystem wrapped)
: base(wrapped)
{
ContentConfig = contentConfig;
Logger = logger;
MediaPathScheme = mediaPathScheme;
ContentConfig = Current.Container.GetInstance<IContentSection>();
Logger = Current.Container.GetInstance<ILogger>();
MediaPathScheme = Current.Container.GetInstance<IMediaPathScheme>();
MediaPathScheme.Initialize(this);
UploadAutoFillProperties = new UploadAutoFillProperties(this, Logger, ContentConfig);