Even more IOHelper reduction, fixes some tests
This commit is contained in:
@@ -59,6 +59,7 @@ namespace Umbraco.Core.IO
|
||||
if (Path.IsPathRooted(rootPath) == false)
|
||||
{
|
||||
// but the test suite App.config cannot really "root" anything so we have to do it here
|
||||
// TODO: This will map to the web content root (www) not the web app root, is that what we want? Else we need to use IHostingEnvironment.ApplicationPhysicalPath
|
||||
var localRoot = _ioHelper.MapPath("~");
|
||||
rootPath = Path.Combine(localRoot, rootPath);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using Lucene.Net.Store;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
namespace Umbraco.Examine
|
||||
@@ -18,13 +19,13 @@ namespace Umbraco.Examine
|
||||
public abstract class LuceneIndexCreator : IIndexCreator
|
||||
{
|
||||
private readonly ITypeFinder _typeFinder;
|
||||
private readonly IIOHelper _ioHelper;
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
private readonly IIndexCreatorSettings _settings;
|
||||
|
||||
protected LuceneIndexCreator(ITypeFinder typeFinder, IIOHelper ioHelper, IIndexCreatorSettings settings)
|
||||
protected LuceneIndexCreator(ITypeFinder typeFinder, IHostingEnvironment hostingEnvironment, IIndexCreatorSettings settings)
|
||||
{
|
||||
_typeFinder = typeFinder;
|
||||
_ioHelper = ioHelper;
|
||||
_hostingEnvironment = hostingEnvironment;
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ namespace Umbraco.Examine
|
||||
public virtual Lucene.Net.Store.Directory CreateFileSystemLuceneDirectory(string folderName)
|
||||
{
|
||||
|
||||
var dirInfo = new DirectoryInfo(Path.Combine(_ioHelper.MapPath(Constants.SystemDirectories.TempData), "ExamineIndexes", folderName));
|
||||
var dirInfo = new DirectoryInfo(Path.Combine(_hostingEnvironment.MapPath(Constants.SystemDirectories.TempData), "ExamineIndexes", folderName));
|
||||
if (!dirInfo.Exists)
|
||||
System.IO.Directory.CreateDirectory(dirInfo.FullName);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Examine;
|
||||
using Examine.LuceneEngine.Providers;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
@@ -12,12 +13,12 @@ namespace Umbraco.Examine
|
||||
public class LuceneIndexDiagnosticsFactory : IndexDiagnosticsFactory
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IIOHelper _ioHelper;
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
|
||||
public LuceneIndexDiagnosticsFactory(ILogger logger, IIOHelper ioHelper)
|
||||
public LuceneIndexDiagnosticsFactory(ILogger logger, IHostingEnvironment hostingEnvironment)
|
||||
{
|
||||
_logger = logger;
|
||||
_ioHelper = ioHelper;
|
||||
_hostingEnvironment = hostingEnvironment;
|
||||
}
|
||||
|
||||
public override IIndexDiagnostics Create(IIndex index)
|
||||
@@ -25,7 +26,7 @@ namespace Umbraco.Examine
|
||||
if (!(index is IIndexDiagnostics indexDiag))
|
||||
{
|
||||
if (index is LuceneIndex luceneIndex)
|
||||
indexDiag = new LuceneIndexDiagnostics(luceneIndex, _logger, _ioHelper);
|
||||
indexDiag = new LuceneIndexDiagnostics(luceneIndex, _logger, _hostingEnvironment);
|
||||
else
|
||||
indexDiag = base.Create(index);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ using Lucene.Net.Store;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Logging;
|
||||
using Examine.LuceneEngine;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
namespace Umbraco.Examine
|
||||
@@ -33,7 +34,7 @@ namespace Umbraco.Examine
|
||||
/// <param name="luceneDirectory"></param>
|
||||
/// <param name="defaultAnalyzer"></param>
|
||||
/// <param name="profilingLogger"></param>
|
||||
/// <param name="ioHelper"></param>
|
||||
/// <param name="hostingEnvironment"></param>
|
||||
/// <param name="runtimeState"></param>
|
||||
/// <param name="languageService"></param>
|
||||
/// <param name="validator"></param>
|
||||
@@ -44,12 +45,12 @@ namespace Umbraco.Examine
|
||||
FieldDefinitionCollection fieldDefinitions,
|
||||
Analyzer defaultAnalyzer,
|
||||
IProfilingLogger profilingLogger,
|
||||
IIOHelper ioHelper,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IRuntimeState runtimeState,
|
||||
ILocalizationService languageService,
|
||||
IContentValueSetValidator validator,
|
||||
IReadOnlyDictionary<string, IFieldValueTypeFactory> indexValueTypes = null)
|
||||
: base(name, luceneDirectory, fieldDefinitions, defaultAnalyzer, profilingLogger, ioHelper, runtimeState, validator, indexValueTypes)
|
||||
: base(name, luceneDirectory, fieldDefinitions, defaultAnalyzer, profilingLogger, hostingEnvironment, runtimeState, validator, indexValueTypes)
|
||||
{
|
||||
if (validator == null) throw new ArgumentNullException(nameof(validator));
|
||||
LanguageService = languageService ?? throw new ArgumentNullException(nameof(languageService));
|
||||
|
||||
@@ -9,6 +9,7 @@ using Umbraco.Core;
|
||||
using Examine;
|
||||
using Examine.LuceneEngine;
|
||||
using Lucene.Net.Store;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Directory = Lucene.Net.Store.Directory;
|
||||
@@ -38,7 +39,7 @@ namespace Umbraco.Examine
|
||||
/// <param name="luceneDirectory"></param>
|
||||
/// <param name="defaultAnalyzer"></param>
|
||||
/// <param name="profilingLogger"></param>
|
||||
/// <param name="ioHelper"></param>
|
||||
/// <param name="hostingEnvironment"></param>
|
||||
/// <param name="runtimeState"></param>
|
||||
/// <param name="validator"></param>
|
||||
/// <param name="indexValueTypes"></param>
|
||||
@@ -48,7 +49,7 @@ namespace Umbraco.Examine
|
||||
FieldDefinitionCollection fieldDefinitions,
|
||||
Analyzer defaultAnalyzer,
|
||||
IProfilingLogger profilingLogger,
|
||||
IIOHelper ioHelper,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IRuntimeState runtimeState,
|
||||
IValueSetValidator validator = null,
|
||||
IReadOnlyDictionary<string, IFieldValueTypeFactory> indexValueTypes = null)
|
||||
@@ -61,7 +62,7 @@ namespace Umbraco.Examine
|
||||
if (luceneDirectory is FSDirectory fsDir)
|
||||
LuceneIndexFolder = fsDir.Directory;
|
||||
|
||||
_diagnostics = new UmbracoExamineIndexDiagnostics(this, ProfilingLogger, ioHelper);
|
||||
_diagnostics = new UmbracoExamineIndexDiagnostics(this, ProfilingLogger, hostingEnvironment);
|
||||
}
|
||||
|
||||
private readonly bool _configBased = false;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Linq;
|
||||
using Lucene.Net.Store;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
@@ -11,8 +12,8 @@ namespace Umbraco.Examine
|
||||
{
|
||||
private readonly UmbracoExamineIndex _index;
|
||||
|
||||
public UmbracoExamineIndexDiagnostics(UmbracoExamineIndex index, ILogger logger, IIOHelper ioHelper)
|
||||
: base(index, logger, ioHelper)
|
||||
public UmbracoExamineIndexDiagnostics(UmbracoExamineIndex index, ILogger logger, IHostingEnvironment hostingEnvironment)
|
||||
: base(index, logger, hostingEnvironment)
|
||||
{
|
||||
_index = index;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using Examine;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
namespace Umbraco.Examine
|
||||
@@ -25,21 +26,21 @@ namespace Umbraco.Examine
|
||||
IPublicAccessService publicAccessService,
|
||||
IMemberService memberService,
|
||||
IUmbracoIndexConfig umbracoIndexConfig,
|
||||
IIOHelper ioHelper,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IRuntimeState runtimeState,
|
||||
IIndexCreatorSettings settings) : base(typeFinder, ioHelper, settings)
|
||||
IIndexCreatorSettings settings) : base(typeFinder, hostingEnvironment, settings)
|
||||
{
|
||||
ProfilingLogger = profilingLogger ?? throw new System.ArgumentNullException(nameof(profilingLogger));
|
||||
LanguageService = languageService ?? throw new System.ArgumentNullException(nameof(languageService));
|
||||
PublicAccessService = publicAccessService ?? throw new System.ArgumentNullException(nameof(publicAccessService));
|
||||
MemberService = memberService ?? throw new System.ArgumentNullException(nameof(memberService));
|
||||
UmbracoIndexConfig = umbracoIndexConfig;
|
||||
IOHelper = ioHelper ?? throw new System.ArgumentNullException(nameof(ioHelper));
|
||||
HostingEnvironment = hostingEnvironment ?? throw new System.ArgumentNullException(nameof(hostingEnvironment));
|
||||
RuntimeState = runtimeState ?? throw new System.ArgumentNullException(nameof(runtimeState));
|
||||
}
|
||||
|
||||
protected IProfilingLogger ProfilingLogger { get; }
|
||||
protected IIOHelper IOHelper { get; }
|
||||
protected IHostingEnvironment HostingEnvironment { get; }
|
||||
protected IRuntimeState RuntimeState { get; }
|
||||
protected ILocalizationService LanguageService { get; }
|
||||
protected IPublicAccessService PublicAccessService { get; }
|
||||
@@ -68,7 +69,7 @@ namespace Umbraco.Examine
|
||||
new UmbracoFieldDefinitionCollection(),
|
||||
new CultureInvariantWhitespaceAnalyzer(),
|
||||
ProfilingLogger,
|
||||
IOHelper,
|
||||
HostingEnvironment,
|
||||
RuntimeState,
|
||||
LanguageService,
|
||||
UmbracoIndexConfig.GetContentValueSetValidator()
|
||||
@@ -84,7 +85,7 @@ namespace Umbraco.Examine
|
||||
new UmbracoFieldDefinitionCollection(),
|
||||
new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30),
|
||||
ProfilingLogger,
|
||||
IOHelper,
|
||||
HostingEnvironment,
|
||||
RuntimeState,
|
||||
LanguageService,
|
||||
UmbracoIndexConfig.GetPublishedContentValueSetValidator());
|
||||
@@ -99,7 +100,7 @@ namespace Umbraco.Examine
|
||||
CreateFileSystemLuceneDirectory(Constants.UmbracoIndexes.MembersIndexPath),
|
||||
new CultureInvariantWhitespaceAnalyzer(),
|
||||
ProfilingLogger,
|
||||
IOHelper,
|
||||
HostingEnvironment,
|
||||
RuntimeState,
|
||||
UmbracoIndexConfig.GetMemberValueSetValidator()
|
||||
);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Examine;
|
||||
using Lucene.Net.Analysis;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Directory = Lucene.Net.Store.Directory;
|
||||
@@ -20,7 +21,8 @@ namespace Umbraco.Examine
|
||||
/// <param name="fieldDefinitions"></param>
|
||||
/// <param name="luceneDirectory"></param>
|
||||
/// <param name="profilingLogger"></param>
|
||||
/// <param name="ioHelper"></param>
|
||||
/// <param name="hostingEnvironment"></param>
|
||||
/// <param name="runtimeState"></param>
|
||||
/// <param name="validator"></param>
|
||||
/// <param name="analyzer"></param>
|
||||
public UmbracoMemberIndex(
|
||||
@@ -29,10 +31,10 @@ namespace Umbraco.Examine
|
||||
Directory luceneDirectory,
|
||||
Analyzer analyzer,
|
||||
IProfilingLogger profilingLogger,
|
||||
IIOHelper ioHelper,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IRuntimeState runtimeState,
|
||||
IValueSetValidator validator = null) :
|
||||
base(name, luceneDirectory, fieldDefinitions, analyzer, profilingLogger, ioHelper, runtimeState, validator)
|
||||
base(name, luceneDirectory, fieldDefinitions, analyzer, profilingLogger, hostingEnvironment, runtimeState, validator)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace Umbraco.Tests.Packaging
|
||||
private static FileInfo GetTestPackagePath(string packageName)
|
||||
{
|
||||
const string testPackagesDirName = "Packaging\\Packages";
|
||||
string path = Path.Combine(TestHelper.IOHelper.MapPath("~"), testPackagesDirName, packageName);
|
||||
var hosting = TestHelper.GetHostingEnvironment();
|
||||
string path = Path.Combine(hosting.ApplicationPhysicalPath, testPackagesDirName, packageName);
|
||||
return new FileInfo(path);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
var rebuilder = IndexInitializer.GetMediaIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockMediaService());
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(true)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
@@ -149,7 +149,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
var rebuilder = IndexInitializer.GetMediaIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockMediaService());
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
//include unpublished content since this uses the 'internal' indexer, it's up to the media cache to filter
|
||||
validator: new ContentValueSetValidator(false)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
@@ -197,7 +197,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
var rebuilder = IndexInitializer.GetMediaIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockMediaService());
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(true)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
@@ -225,7 +225,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
var rebuilder = IndexInitializer.GetMediaIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockMediaService());
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(true)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
@@ -253,7 +253,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
var rebuilder = IndexInitializer.GetMediaIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockMediaService());
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(true)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
@@ -282,7 +282,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(true)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
@@ -307,7 +307,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
var rebuilder = IndexInitializer.GetMediaIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockMediaService());
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(true)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
public void Events_Ignoring_Node()
|
||||
{
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
//make parent id 999 so all are ignored
|
||||
validator: new ContentValueSetValidator(false, 999)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
|
||||
@@ -8,6 +8,7 @@ using Lucene.Net.Analysis.Standard;
|
||||
using Lucene.Net.Store;
|
||||
using Moq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
@@ -155,7 +156,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
|
||||
public static UmbracoContentIndex GetUmbracoIndexer(
|
||||
IProfilingLogger profilingLogger,
|
||||
IIOHelper ioHelper,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IRuntimeState runtimeState,
|
||||
Directory luceneDir,
|
||||
Analyzer analyzer = null,
|
||||
@@ -177,7 +178,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
new UmbracoFieldDefinitionCollection(),
|
||||
analyzer,
|
||||
profilingLogger,
|
||||
ioHelper,
|
||||
hostingEnvironment,
|
||||
runtimeState,
|
||||
languageService,
|
||||
validator);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
var contentValueSetBuilder = IndexInitializer.GetContentValueSetBuilder(Factory.GetInstance<PropertyEditorCollection>(), false);
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(false)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
@@ -126,7 +126,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
var mediaRebuilder = IndexInitializer.GetMediaIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockMediaService());
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(false)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
@@ -154,7 +154,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir))
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir))
|
||||
using (indexer.ProcessNonAsync())
|
||||
using (var searcher = ((LuceneSearcher)indexer.GetSearcher()).GetLuceneSearcher())
|
||||
{
|
||||
@@ -191,7 +191,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
var validator = new ContentValueSetValidator(false, 1116);
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir, validator: validator))
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir, validator: validator))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
var searcher = indexer.GetSearcher();
|
||||
@@ -234,7 +234,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
var validator = new ContentValueSetValidator(false, 2222);
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer1 = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir, validator: validator))
|
||||
using (var indexer1 = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir, validator: validator))
|
||||
using (indexer1.ProcessNonAsync())
|
||||
{
|
||||
var searcher = indexer1.GetSearcher();
|
||||
@@ -277,7 +277,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
{
|
||||
var rebuilder = IndexInitializer.GetContentIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockContentService(), ScopeProvider.SqlContext, false);
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir,
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir,
|
||||
validator: new ContentValueSetValidator(false)))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
@@ -319,7 +319,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
var rebuilder = IndexInitializer.GetContentIndexRebuilder(Factory.GetInstance<PropertyEditorCollection>(), IndexInitializer.GetMockContentService(), ScopeProvider.SqlContext, false);
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir))
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
var searcher = indexer.GetSearcher();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
var rebuilder = IndexInitializer.GetContentIndexRebuilder(propertyEditors, contentService, ScopeProvider.SqlContext, true);
|
||||
|
||||
using (var luceneDir = new RandomIdRamDirectory())
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, IOHelper, RuntimeState, luceneDir))
|
||||
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, HostingEnvironment, RuntimeState, luceneDir))
|
||||
using (indexer.ProcessNonAsync())
|
||||
{
|
||||
indexer.CreateIndex();
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Umbraco.Web.Hosting
|
||||
ApplicationId = HostingEnvironment.ApplicationID;
|
||||
// when we are not hosted (i.e. unit test or otherwise) we'll need to get the root path from the executing assembly
|
||||
ApplicationPhysicalPath = HostingEnvironment.ApplicationPhysicalPath ?? Assembly.GetExecutingAssembly().GetRootDirectorySafe();
|
||||
ApplicationVirtualPath = hostingSettings.ApplicationVirtualPath ?? HostingEnvironment.ApplicationVirtualPath.EnsureStartsWith("/");
|
||||
ApplicationVirtualPath = hostingSettings.ApplicationVirtualPath ?? HostingEnvironment.ApplicationVirtualPath?.EnsureStartsWith("/") ?? "/";
|
||||
IISVersion = HttpRuntime.IISVersion;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user