Files
Umbraco-CMS/src/Umbraco.Core/Configuration/HealthChecks/CompilationDebugCheck.cs

38 lines
1.6 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Umbraco.Core.Hosting;
using Umbraco.Core.IO;
using Umbraco.Core.Services;
namespace Umbraco.Web.HealthCheck.Checks.Config
{
[HealthCheck("61214FF3-FC57-4B31-B5CF-1D095C977D6D", "Debug Compilation Mode",
Description = "Leaving debug compilation mode enabled can severely slow down a website and take up more memory on the server.",
Group = "Live Environment")]
public class CompilationDebugCheck : AbstractConfigCheck
{
public CompilationDebugCheck(ILocalizedTextService textService, IHostingEnvironment hostingEnvironment, ILoggerFactory loggerFactory)
: base(textService, hostingEnvironment, loggerFactory)
{ }
public override string FilePath => "~/Web.config";
public override string XPath => "/configuration/system.web/compilation/@debug";
public override ValueComparisonType ValueComparisonType => ValueComparisonType.ShouldEqual;
2017-09-08 19:39:13 +02:00
public override bool ValidIfConfigMissing => true;
public override IEnumerable<AcceptableConfiguration> Values => new List<AcceptableConfiguration>
{
new AcceptableConfiguration { IsRecommended = true, Value = bool.FalseString.ToLower() }
};
public override string CheckSuccessMessage => TextService.Localize("healthcheck/compilationDebugCheckSuccessMessage");
public override string CheckErrorMessage => TextService.Localize("healthcheck/compilationDebugCheckErrorMessage");
public override string RectifySuccessMessage => TextService.Localize("healthcheck/compilationDebugCheckRectifySuccessMessage");
}
2017-07-20 11:21:28 +02:00
}