mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Autofac;
|
||||
@@ -36,6 +37,14 @@ namespace Orchard.Environment {
|
||||
}
|
||||
|
||||
void IOrchardHost.Initialize() {
|
||||
ViewEngines.Engines.Insert(0, LayoutViewEngine.CreateShim());
|
||||
_controllerBuilder.SetControllerFactory(new OrchardControllerFactory());
|
||||
ServiceLocator.SetLocator(t => _containerProvider.RequestContainer.Resolve(t));
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void IOrchardHost.Reinitialize() {
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -54,10 +63,6 @@ namespace Orchard.Environment {
|
||||
shell.Activate();
|
||||
_current = shell;
|
||||
|
||||
ViewEngines.Engines.Insert(0, LayoutViewEngine.CreateShim());
|
||||
_controllerBuilder.SetControllerFactory(new OrchardControllerFactory());
|
||||
ServiceLocator.SetLocator(t => _containerProvider.RequestContainer.Resolve(t));
|
||||
|
||||
// Fire off one-time install events on an alternate container
|
||||
HackInstallSimulation();
|
||||
|
||||
@@ -123,7 +128,5 @@ namespace Orchard.Environment {
|
||||
containerProvider.DisposeRequestContainer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@@ -2,9 +2,25 @@ using Orchard.Environment.Configuration;
|
||||
|
||||
namespace Orchard.Environment {
|
||||
public interface IOrchardHost {
|
||||
/// <summary>
|
||||
/// Called once on startup to configure app domain, and load/apply existing shell configuration
|
||||
/// </summary>
|
||||
void Initialize();
|
||||
|
||||
/// <summary>
|
||||
/// Called each time a request ends to deterministically commit and dispose outstanding activity
|
||||
/// </summary>
|
||||
void EndRequest();
|
||||
|
||||
/// <summary>
|
||||
/// Called when configuration changes requires the shell topology to be reloaded and applied
|
||||
/// </summary>
|
||||
void Reinitialize();
|
||||
|
||||
/// <summary>
|
||||
/// Can be used to build an temporary self-contained instance of a shell's configured code.
|
||||
/// Services may be resolved from within this instance to configure and initialize it's storage.
|
||||
/// </summary>
|
||||
IStandaloneEnvironment CreateStandaloneEnvironment(IShellSettings shellSettings);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user