Injecting the abstraction whenever necessary
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
redirectUrl = Url.Action("AuthorizeUpgrade", "BackOffice")
|
||||
});
|
||||
}
|
||||
@Html.BareMinimumServerVariablesScript(Url, externalLoginUrl, Model.Features, Model.GlobalSettings, Model.UmbracoVersion, Model.UmbracoSettingsSection, Model.IOHelper, Model.TreeCollection, Model.HttpContextAccessor, Model.HostingEnvironment, Model.RuntimeSettings)
|
||||
@Html.BareMinimumServerVariablesScript(Url, externalLoginUrl, Model.Features, Model.GlobalSettings, Model.UmbracoVersion, Model.UmbracoSettingsSection, Model.IOHelper, Model.TreeCollection, Model.HttpContextAccessor, Model.HostingEnvironment, Model.RuntimeSettings, Current.RuntimeMinifier)
|
||||
|
||||
<script type="text/javascript">
|
||||
document.angularReady = function (app) {
|
||||
|
||||
@@ -110,14 +110,14 @@
|
||||
on-login="hideLoginScreen()">
|
||||
</umb-login>
|
||||
|
||||
@Html.BareMinimumServerVariablesScript(Url, Url.Action("ExternalLogin", "BackOffice", new { area = ViewData.GetUmbracoPath() }), Model.Features, Model.GlobalSettings, Model.UmbracoVersion, Model.UmbracoSettingsSection, Model.IOHelper, Model.TreeCollection, Model.HttpContextAccessor, Model.HostingEnvironment, Model.RuntimeSettings)
|
||||
@Html.BareMinimumServerVariablesScript(Url, Url.Action("ExternalLogin", "BackOffice", new { area = ViewData.GetUmbracoPath() }), Model.Features, Model.GlobalSettings, Model.UmbracoVersion, Model.UmbracoSettingsSection, Model.IOHelper, Model.TreeCollection, Model.HttpContextAccessor, Model.HostingEnvironment, Model.RuntimeSettings, Current.RuntimeMinifier)
|
||||
|
||||
<script>
|
||||
|
||||
document.angularReady = function(app) {
|
||||
@Html.AngularValueExternalLoginInfoScript(ViewData.GetExternalSignInError())
|
||||
@Html.AngularValueResetPasswordCodeInfoScript(ViewData["PasswordResetCode"])
|
||||
@Html.AngularValueTinyMceAssets()
|
||||
@Html.AngularValueTinyMceAssets(Current.RuntimeMinifier)
|
||||
|
||||
//required for the noscript trick
|
||||
document.getElementById("mainwrapper").style.display = "inherit";
|
||||
|
||||
@@ -14,6 +14,7 @@ using Umbraco.Core.Mapping;
|
||||
using Umbraco.Core.PackageActions;
|
||||
using Umbraco.Core.Packaging;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Core.Scoping;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
@@ -119,6 +120,9 @@ namespace Umbraco.Web.Composing
|
||||
public static IUmbracoComponentRenderer UmbracoComponentRenderer
|
||||
=> Factory.GetInstance<IUmbracoComponentRenderer>();
|
||||
|
||||
public static IRuntimeMinifier RuntimeMinifier
|
||||
=> Factory.GetInstance<IRuntimeMinifier>();
|
||||
|
||||
public static DistributedCache DistributedCache
|
||||
=> Factory.GetInstance<DistributedCache>();
|
||||
|
||||
@@ -187,7 +191,7 @@ namespace Umbraco.Web.Composing
|
||||
set
|
||||
{
|
||||
if (value.Implements<IRenderController>() == false)
|
||||
throw new ArgumentException($"Type {value.FullName} does not implement {typeof (IRenderController).FullName}.", nameof(value));
|
||||
throw new ArgumentException($"Type {value.FullName} does not implement {typeof(IRenderController).FullName}.", nameof(value));
|
||||
_defaultRenderMvcControllerType = value;
|
||||
}
|
||||
}
|
||||
@@ -200,7 +204,7 @@ namespace Umbraco.Web.Composing
|
||||
|
||||
public static IMediaFileSystem MediaFileSystem => Factory.GetInstance<IMediaFileSystem>();
|
||||
|
||||
public static UmbracoMapper Mapper => Factory.GetInstance<UmbracoMapper>();
|
||||
public static UmbracoMapper Mapper => Factory.GetInstance<UmbracoMapper>();
|
||||
|
||||
public static IRuntimeState RuntimeState => Factory.GetInstance<IRuntimeState>();
|
||||
|
||||
@@ -212,7 +216,7 @@ namespace Umbraco.Web.Composing
|
||||
|
||||
public static CacheRefresherCollection CacheRefreshers => Factory.GetInstance<CacheRefresherCollection>();
|
||||
|
||||
public static DataEditorCollection DataEditors => Factory.GetInstance<DataEditorCollection>();
|
||||
public static DataEditorCollection DataEditors => Factory.GetInstance<DataEditorCollection>();
|
||||
|
||||
public static DataValueReferenceFactoryCollection DataValueReferenceFactories => Factory.GetInstance<DataValueReferenceFactoryCollection>();
|
||||
|
||||
@@ -252,7 +256,7 @@ namespace Umbraco.Web.Composing
|
||||
|
||||
public static IFileSystems FileSystems => Factory.GetInstance<IFileSystems>();
|
||||
|
||||
public static ISqlContext SqlContext=> Factory.GetInstance<ISqlContext>();
|
||||
public static ISqlContext SqlContext => Factory.GetInstance<ISqlContext>();
|
||||
|
||||
public static IPublishedContentTypeFactory PublishedContentTypeFactory => Factory.GetInstance<IPublishedContentTypeFactory>();
|
||||
|
||||
@@ -266,9 +270,9 @@ namespace Umbraco.Web.Composing
|
||||
public static IUmbracoVersion UmbracoVersion => Factory.GetInstance<IUmbracoVersion>();
|
||||
public static IPublishedUrlProvider PublishedUrlProvider => Factory.GetInstance<IPublishedUrlProvider>();
|
||||
public static IMenuItemCollectionFactory MenuItemCollectionFactory => Factory.GetInstance<IMenuItemCollectionFactory>();
|
||||
public static MembershipHelper MembershipHelper => Factory.GetInstance<MembershipHelper>();
|
||||
public static IUmbracoApplicationLifetime UmbracoApplicationLifetime => Factory.GetInstance<IUmbracoApplicationLifetime>();
|
||||
public static IPublishedContentQuery PublishedContentQuery => Factory.GetInstance<IPublishedContentQuery>();
|
||||
public static MembershipHelper MembershipHelper => Factory.GetInstance<MembershipHelper>();
|
||||
public static IUmbracoApplicationLifetime UmbracoApplicationLifetime => Factory.GetInstance<IUmbracoApplicationLifetime>();
|
||||
public static IPublishedContentQuery PublishedContentQuery => Factory.GetInstance<IPublishedContentQuery>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ using Umbraco.Core.Configuration.Grid;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Web.Trees;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
@@ -54,6 +55,7 @@ namespace Umbraco.Web.Editors
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly IRuntimeSettings _runtimeSettings;
|
||||
private readonly IRuntimeMinifier _runtimeMinifier;
|
||||
|
||||
public BackOfficeController(
|
||||
IManifestParser manifestParser,
|
||||
@@ -71,7 +73,8 @@ namespace Umbraco.Web.Editors
|
||||
TreeCollection treeCollection,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IRuntimeSettings settings)
|
||||
IRuntimeSettings settings,
|
||||
IRuntimeMinifier runtimeMinifier)
|
||||
: base(globalSettings, umbracoContextAccessor, services, appCaches, profilingLogger)
|
||||
|
||||
{
|
||||
@@ -86,6 +89,7 @@ namespace Umbraco.Web.Editors
|
||||
_hostingEnvironment = hostingEnvironment;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_runtimeSettings = settings;
|
||||
_runtimeMinifier = runtimeMinifier;
|
||||
}
|
||||
|
||||
protected BackOfficeSignInManager SignInManager => _signInManager ?? (_signInManager = OwinContext.GetBackOfficeSignInManager());
|
||||
@@ -236,8 +240,8 @@ namespace Umbraco.Web.Editors
|
||||
[OutputCache(Order = 1, VaryByParam = "none", Location = OutputCacheLocation.Server, Duration = 5000)]
|
||||
public JavaScriptResult Application()
|
||||
{
|
||||
var initJs = new JsInitialization(_manifestParser);
|
||||
var initCss = new CssInitialization(_manifestParser);
|
||||
var initJs = new JsInitialization(_manifestParser, _runtimeMinifier);
|
||||
var initCss = new CssInitialization(_manifestParser, _runtimeMinifier);
|
||||
|
||||
var files = initJs.OptimizeBackOfficeScriptFiles(HttpContext, JsInitialization.GetDefaultInitialization());
|
||||
var result = JsInitialization.GetJavascriptInitialization(HttpContext, files, "umbraco", GlobalSettings, _ioHelper);
|
||||
@@ -256,8 +260,8 @@ namespace Umbraco.Web.Editors
|
||||
{
|
||||
JArray GetAssetList()
|
||||
{
|
||||
var initJs = new JsInitialization(_manifestParser);
|
||||
var initCss = new CssInitialization(_manifestParser);
|
||||
var initJs = new JsInitialization(_manifestParser, _runtimeMinifier);
|
||||
var initCss = new CssInitialization(_manifestParser, _runtimeMinifier);
|
||||
var assets = new List<string>();
|
||||
assets.AddRange(initJs.OptimizeBackOfficeScriptFiles(HttpContext, Enumerable.Empty<string>()));
|
||||
assets.AddRange(initCss.GetStylesheetFiles(HttpContext));
|
||||
@@ -292,7 +296,7 @@ namespace Umbraco.Web.Editors
|
||||
[MinifyJavaScriptResult(Order = 1)]
|
||||
public JavaScriptResult ServerVariables()
|
||||
{
|
||||
var serverVars = new BackOfficeServerVariables(Url, _runtimeState, _features, GlobalSettings, _umbracoVersion, _umbracoSettingsSection, _ioHelper, _treeCollection, _httpContextAccessor, _hostingEnvironment, _runtimeSettings);
|
||||
var serverVars = new BackOfficeServerVariables(Url, _runtimeState, _features, GlobalSettings, _umbracoVersion, _umbracoSettingsSection, _ioHelper, _treeCollection, _httpContextAccessor, _hostingEnvironment, _runtimeSettings, _runtimeMinifier);
|
||||
|
||||
//cache the result if debugging is disabled
|
||||
var result = _hostingEnvironment.IsDebugMode
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using ClientDependency.Core.Config;
|
||||
using Microsoft.Owin.Security;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
@@ -20,6 +19,7 @@ using Constants = Umbraco.Core.Constants;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Runtime;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
{
|
||||
@@ -39,6 +39,7 @@ namespace Umbraco.Web.Editors
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
private readonly IRuntimeSettings _settings;
|
||||
private readonly IRuntimeMinifier _runtimeMinifier;
|
||||
|
||||
internal BackOfficeServerVariables(
|
||||
UrlHelper urlHelper,
|
||||
@@ -51,7 +52,8 @@ namespace Umbraco.Web.Editors
|
||||
TreeCollection treeCollection,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IRuntimeSettings settings)
|
||||
IRuntimeSettings settings,
|
||||
IRuntimeMinifier runtimeMinifier)
|
||||
{
|
||||
_urlHelper = urlHelper;
|
||||
_runtimeState = runtimeState;
|
||||
@@ -64,6 +66,7 @@ namespace Umbraco.Web.Editors
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_hostingEnvironment = hostingEnvironment;
|
||||
_settings = settings;
|
||||
_runtimeMinifier = runtimeMinifier;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -472,7 +475,7 @@ namespace Umbraco.Web.Editors
|
||||
var version = _runtimeState.SemanticVersion.ToSemanticString();
|
||||
|
||||
//the value is the hash of the version, cdf version and the configured state
|
||||
app.Add("cacheBuster", $"{version}.{_runtimeState.Level}.{ClientDependencySettings.Instance.Version}".GenerateHash());
|
||||
app.Add("cacheBuster", $"{version}.{_runtimeState.Level}.{_runtimeMinifier.Version}".GenerateHash());
|
||||
|
||||
//useful for dealing with virtual paths on the client side when hosted in virtual directories especially
|
||||
app.Add("applicationPath", _httpContextAccessor.GetRequiredHttpContext().Request.ApplicationPath.EnsureEndsWith('/'));
|
||||
|
||||
@@ -16,6 +16,7 @@ using Umbraco.Core.Models.Editors;
|
||||
using Umbraco.Core.Models.Packaging;
|
||||
using Umbraco.Core.Packaging;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Net;
|
||||
@@ -41,6 +42,7 @@ namespace Umbraco.Web.Editors
|
||||
private readonly IUmbracoVersion _umbracoVersion;
|
||||
private readonly IIOHelper _ioHelper;
|
||||
private readonly IUmbracoApplicationLifetime _umbracoApplicationLifetime;
|
||||
private readonly IRuntimeMinifier _runtimeMinifier;
|
||||
|
||||
public PackageInstallController(
|
||||
IGlobalSettings globalSettings,
|
||||
@@ -55,12 +57,14 @@ namespace Umbraco.Web.Editors
|
||||
UmbracoMapper umbracoMapper,
|
||||
IIOHelper ioHelper,
|
||||
IPublishedUrlProvider publishedUrlProvider,
|
||||
IUmbracoApplicationLifetime umbracoApplicationLifetime)
|
||||
IUmbracoApplicationLifetime umbracoApplicationLifetime,
|
||||
IRuntimeMinifier runtimeMinifier)
|
||||
: base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, shortStringHelper, umbracoMapper, publishedUrlProvider)
|
||||
{
|
||||
_umbracoVersion = umbracoVersion;
|
||||
_ioHelper = ioHelper;
|
||||
_umbracoApplicationLifetime = umbracoApplicationLifetime;
|
||||
_runtimeMinifier = runtimeMinifier;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -381,7 +385,7 @@ namespace Umbraco.Web.Editors
|
||||
zipFile.Delete();
|
||||
|
||||
//bump cdf to be safe
|
||||
var clientDependencyConfig = new ClientDependencyConfiguration(Logger, _ioHelper);
|
||||
var clientDependencyConfig = new ClientDependencyConfiguration(Logger, _ioHelper, _runtimeMinifier);
|
||||
var clientDependencyUpdated = clientDependencyConfig.UpdateVersionNumber(
|
||||
_umbracoVersion.SemanticVersion, DateTime.UtcNow, "yyyyMMdd");
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Cookie;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Composing;
|
||||
using Umbraco.Web.Features;
|
||||
@@ -37,6 +38,7 @@ namespace Umbraco.Web.Editors
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
private readonly ICookieManager _cookieManager;
|
||||
private IRuntimeSettings _runtimeSettings;
|
||||
private readonly IRuntimeMinifier _runtimeMinifier;
|
||||
|
||||
public PreviewController(
|
||||
UmbracoFeatures features,
|
||||
@@ -51,7 +53,8 @@ namespace Umbraco.Web.Editors
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
ICookieManager cookieManager,
|
||||
IRuntimeSettings settings)
|
||||
IRuntimeSettings settings,
|
||||
IRuntimeMinifier runtimeMinifier)
|
||||
{
|
||||
_features = features;
|
||||
_globalSettings = globalSettings;
|
||||
@@ -66,6 +69,7 @@ namespace Umbraco.Web.Editors
|
||||
_hostingEnvironment = hostingEnvironment;
|
||||
_cookieManager = cookieManager;
|
||||
_runtimeSettings = settings;
|
||||
_runtimeMinifier = runtimeMinifier;
|
||||
}
|
||||
|
||||
[UmbracoAuthorize(redirectToUmbracoLogin: true)]
|
||||
@@ -96,7 +100,7 @@ namespace Umbraco.Web.Editors
|
||||
[OutputCache(Order = 1, VaryByParam = "none", Location = OutputCacheLocation.Server, Duration = 5000)]
|
||||
public JavaScriptResult Application()
|
||||
{
|
||||
var files = JsInitialization.OptimizeScriptFiles(HttpContext, JsInitialization.GetPreviewInitialization());
|
||||
var files = JsInitialization.OptimizeScriptFiles(HttpContext, JsInitialization.GetPreviewInitialization(), _runtimeMinifier);
|
||||
var result = JsInitialization.GetJavascriptInitialization(HttpContext, files, "umbraco.preview", _globalSettings, _ioHelper);
|
||||
|
||||
return JavaScript(result);
|
||||
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Owin.Security;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Web.Composing;
|
||||
using Umbraco.Web.Editors;
|
||||
using Umbraco.Web.Features;
|
||||
@@ -40,9 +41,9 @@ namespace Umbraco.Web
|
||||
/// These are the bare minimal server variables that are required for the application to start without being authenticated,
|
||||
/// we will load the rest of the server vars after the user is authenticated.
|
||||
/// </remarks>
|
||||
public static IHtmlString BareMinimumServerVariablesScript(this HtmlHelper html, UrlHelper uri, string externalLoginsUrl, UmbracoFeatures features, IGlobalSettings globalSettings, IUmbracoVersion umbracoVersion, IUmbracoSettingsSection umbracoSettingsSection, IIOHelper ioHelper, TreeCollection treeCollection, IHttpContextAccessor httpContextAccessor, IHostingEnvironment hostingEnvironment, IRuntimeSettings settings)
|
||||
public static IHtmlString BareMinimumServerVariablesScript(this HtmlHelper html, UrlHelper uri, string externalLoginsUrl, UmbracoFeatures features, IGlobalSettings globalSettings, IUmbracoVersion umbracoVersion, IUmbracoSettingsSection umbracoSettingsSection, IIOHelper ioHelper, TreeCollection treeCollection, IHttpContextAccessor httpContextAccessor, IHostingEnvironment hostingEnvironment, IRuntimeSettings settings, IRuntimeMinifier runtimeMinifier)
|
||||
{
|
||||
var serverVars = new BackOfficeServerVariables(uri, Current.RuntimeState, features, globalSettings, umbracoVersion, umbracoSettingsSection, ioHelper, treeCollection, httpContextAccessor, hostingEnvironment, settings);
|
||||
var serverVars = new BackOfficeServerVariables(uri, Current.RuntimeState, features, globalSettings, umbracoVersion, umbracoSettingsSection, ioHelper, treeCollection, httpContextAccessor, hostingEnvironment, settings, runtimeMinifier);
|
||||
var minVars = serverVars.BareMinimumServerVariables();
|
||||
|
||||
var str = @"<script type=""text/javascript"">
|
||||
@@ -126,10 +127,10 @@ namespace Umbraco.Web
|
||||
return html.Raw(sb.ToString());
|
||||
}
|
||||
|
||||
public static IHtmlString AngularValueTinyMceAssets(this HtmlHelper html)
|
||||
public static IHtmlString AngularValueTinyMceAssets(this HtmlHelper html, IRuntimeMinifier runtimeMinifier)
|
||||
{
|
||||
var ctx = new HttpContextWrapper(HttpContext.Current);
|
||||
var files = JsInitialization.OptimizeTinyMceScriptFiles(ctx);
|
||||
var files = JsInitialization.OptimizeTinyMceScriptFiles(ctx, runtimeMinifier);
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using Umbraco.Web.Composing;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Web.JavaScript;
|
||||
using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.Security;
|
||||
@@ -27,8 +28,17 @@ namespace Umbraco.Web.Install.Controllers
|
||||
private readonly IGlobalSettings _globalSettings;
|
||||
private readonly IUmbracoVersion _umbracoVersion;
|
||||
private readonly IIOHelper _ioHelper;
|
||||
private readonly IRuntimeMinifier _runtimeMinifier;
|
||||
|
||||
public InstallController(IUmbracoContextAccessor umbracoContextAccessor, InstallHelper installHelper, IRuntimeState runtime, ILogger logger, IGlobalSettings globalSettings, IUmbracoVersion umbracoVersion, IIOHelper ioHelper)
|
||||
public InstallController(
|
||||
IUmbracoContextAccessor umbracoContextAccessor,
|
||||
InstallHelper installHelper,
|
||||
IRuntimeState runtime,
|
||||
ILogger logger,
|
||||
IGlobalSettings globalSettings,
|
||||
IUmbracoVersion umbracoVersion,
|
||||
IIOHelper ioHelper,
|
||||
IRuntimeMinifier runtimeMinifier)
|
||||
{
|
||||
_umbracoContextAccessor = umbracoContextAccessor;
|
||||
_installHelper = installHelper;
|
||||
@@ -37,6 +47,7 @@ namespace Umbraco.Web.Install.Controllers
|
||||
_globalSettings = globalSettings;
|
||||
_umbracoVersion = umbracoVersion;
|
||||
_ioHelper = ioHelper;
|
||||
_runtimeMinifier = runtimeMinifier;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
@@ -49,7 +60,7 @@ namespace Umbraco.Web.Install.Controllers
|
||||
if (_runtime.Level == RuntimeLevel.Upgrade)
|
||||
{
|
||||
// Update ClientDependency version
|
||||
var clientDependencyConfig = new ClientDependencyConfiguration(_logger, _ioHelper);
|
||||
var clientDependencyConfig = new ClientDependencyConfiguration(_logger, _ioHelper, _runtimeMinifier);
|
||||
var clientDependencyUpdated = clientDependencyConfig.UpdateVersionNumber(
|
||||
_umbracoVersion.SemanticVersion, DateTime.UtcNow, "yyyyMMdd");
|
||||
// Delete ClientDependency temp directories to make sure we get fresh caches
|
||||
|
||||
@@ -12,6 +12,7 @@ using Semver;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Web.Composing;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Runtime;
|
||||
|
||||
namespace Umbraco.Web.JavaScript
|
||||
{
|
||||
@@ -21,12 +22,14 @@ namespace Umbraco.Web.JavaScript
|
||||
public class ClientDependencyConfiguration
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IRuntimeMinifier _runtimeMinifier;
|
||||
private readonly string _fileName;
|
||||
|
||||
public ClientDependencyConfiguration(ILogger logger, IIOHelper ioHelper)
|
||||
public ClientDependencyConfiguration(ILogger logger, IIOHelper ioHelper, IRuntimeMinifier runtimeMinifier)
|
||||
{
|
||||
if (logger == null) throw new ArgumentNullException("logger");
|
||||
_logger = logger;
|
||||
_runtimeMinifier = runtimeMinifier;
|
||||
_fileName = ioHelper.MapPath(string.Format("{0}/ClientDependency.config", Core.Constants.SystemDirectories.Config));
|
||||
}
|
||||
|
||||
@@ -108,9 +111,9 @@ namespace Umbraco.Web.JavaScript
|
||||
|
||||
try
|
||||
{
|
||||
var fullPath = XmlFileMapper.FileMapDefaultFolder.StartsWith("~/")
|
||||
? currentHttpContext.Server.MapPath(XmlFileMapper.FileMapDefaultFolder)
|
||||
: XmlFileMapper.FileMapDefaultFolder;
|
||||
var fullPath = _runtimeMinifier.FileMapDefaultFolder.StartsWith("~/")
|
||||
? currentHttpContext.Server.MapPath(_runtimeMinifier.FileMapDefaultFolder)
|
||||
: _runtimeMinifier.FileMapDefaultFolder;
|
||||
if (fullPath != null)
|
||||
{
|
||||
cdfTempDirectories.Add(fullPath);
|
||||
|
||||
Reference in New Issue
Block a user