2019-11-07 10:08:16 +01:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using Umbraco.Core.Cache;
|
2019-11-13 10:48:51 +01:00
|
|
|
|
using Umbraco.Core.Composing;
|
2019-11-07 10:08:16 +01:00
|
|
|
|
using Umbraco.Core.Configuration;
|
|
|
|
|
|
using Umbraco.Core.Configuration.Grid;
|
|
|
|
|
|
using Umbraco.Core.IO;
|
|
|
|
|
|
using Umbraco.Core.Logging;
|
|
|
|
|
|
using Umbraco.Core.Manifest;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Provides extension methods for the <see cref="Configs"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static class ConfigsExtensions
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2019-11-13 10:48:51 +01:00
|
|
|
|
public static void AddCoreConfigs(this Configs configs, IIOHelper ioHelper, ISystemDirectories systemDirectories)
|
2019-11-07 10:08:16 +01:00
|
|
|
|
{
|
2019-11-13 10:48:51 +01:00
|
|
|
|
var configDir = new DirectoryInfo(ioHelper.MapPath(systemDirectories.Config));
|
2019-11-07 10:08:16 +01:00
|
|
|
|
|
|
|
|
|
|
// GridConfig depends on runtime caches, manifest parsers... and cannot be available during composition
|
|
|
|
|
|
configs.Add<IGridConfig>(factory => new GridConfig(
|
|
|
|
|
|
factory.GetInstance<ILogger>(),
|
|
|
|
|
|
factory.GetInstance<AppCaches>(),
|
|
|
|
|
|
configDir,
|
|
|
|
|
|
factory.GetInstance<IManifestParser>(),
|
|
|
|
|
|
factory.GetInstance<IRuntimeState>().Debug));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|