mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Adding a Reinitialize method to the IOrchardHost
Needed for the setup scenario to be able to reload and apply new shell topology Eventyally needed when module configuration requires the same effect --HG-- branch : dev
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Autofac;
|
using Autofac;
|
||||||
@@ -36,6 +37,14 @@ namespace Orchard.Environment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IOrchardHost.Initialize() {
|
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();
|
Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,10 +63,6 @@ namespace Orchard.Environment {
|
|||||||
shell.Activate();
|
shell.Activate();
|
||||||
_current = shell;
|
_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
|
// Fire off one-time install events on an alternate container
|
||||||
HackInstallSimulation();
|
HackInstallSimulation();
|
||||||
|
|
||||||
@@ -123,7 +128,5 @@ namespace Orchard.Environment {
|
|||||||
containerProvider.DisposeRequestContainer();
|
containerProvider.DisposeRequestContainer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -2,9 +2,25 @@ using Orchard.Environment.Configuration;
|
|||||||
|
|
||||||
namespace Orchard.Environment {
|
namespace Orchard.Environment {
|
||||||
public interface IOrchardHost {
|
public interface IOrchardHost {
|
||||||
|
/// <summary>
|
||||||
|
/// Called once on startup to configure app domain, and load/apply existing shell configuration
|
||||||
|
/// </summary>
|
||||||
void Initialize();
|
void Initialize();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called each time a request ends to deterministically commit and dispose outstanding activity
|
||||||
|
/// </summary>
|
||||||
void EndRequest();
|
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);
|
IStandaloneEnvironment CreateStandaloneEnvironment(IShellSettings shellSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user