#20367: Removing IHostEnvironment.IsFullTrust since only full trust is supported any way.

Work Item: 20367
This commit is contained in:
Lombiq
2015-01-26 20:32:06 +01:00
committed by Zoltán Lehóczky
parent 8dae8f3d5b
commit a14ebfd555
6 changed files with 10 additions and 29 deletions
@@ -71,9 +71,6 @@ namespace Orchard.Data {
}
private void StoreConfiguration(ConfigurationCache cache) {
if (!_hostEnvironment.IsFullTrust)
return;
var pathName = GetPathName(_shellSettings.Name);
try {
@@ -93,9 +90,6 @@ namespace Orchard.Data {
}
private ConfigurationCache ReadConfiguration(string hash) {
if (!_hostEnvironment.IsFullTrust)
return null;
var pathName = GetPathName(_shellSettings.Name);
if (!_appDataFolder.FileExists(pathName))
-3
View File
@@ -84,9 +84,6 @@ namespace Orchard.Data {
private ISessionFactory BuildSessionFactory() {
Logger.Debug("Building session factory");
if (!_hostEnvironment.IsFullTrust)
NHibernate.Cfg.Environment.UseReflectionOptimizer = false;
Configuration config = GetConfiguration();
var result = config.BuildSessionFactory();
Logger.Debug("Done building session factory");
@@ -25,10 +25,6 @@ namespace Orchard.Environment {
public ILogger Logger { get; set; }
public override void RestartAppDomain() {
if (IsFullTrust) {
HttpRuntime.UnloadAppDomain();
}
else {
bool success = TryWriteBinFolder() || TryWriteWebConfig();
if (!success) {
@@ -40,7 +36,6 @@ namespace Orchard.Environment {
"- give the application write access to the '{1}' file.",
HostRestartPath, WebConfigPath));
}
}
// If setting up extensions/modules requires an AppDomain restart, it's very unlikely the
// current request can be processed correctly. So, we redirect to the same URL, so that the
@@ -5,10 +5,6 @@ using System.Web.Hosting;
namespace Orchard.Environment {
public abstract class HostEnvironment : IHostEnvironment {
public bool IsFullTrust {
get { return AppDomain.CurrentDomain.IsHomogenous && AppDomain.CurrentDomain.IsFullyTrusted; }
}
public string MapPath(string virtualPath) {
return HostingEnvironment.MapPath(virtualPath);
}
@@ -3,7 +3,6 @@
/// Abstraction of the running environment
/// </summary>
public interface IHostEnvironment {
bool IsFullTrust { get; }
string MapPath(string virtualPath);
bool IsAssemblyLoaded(string name);
+1 -1
View File
@@ -13,7 +13,7 @@ namespace Orchard.Logging {
: this(ConfigurationManager.AppSettings["log4net.Config"], hostEnvironment) { }
public OrchardLog4netFactory(string configFilename, IHostEnvironment hostEnvironment) {
if (!_isFileWatched && !string.IsNullOrWhiteSpace(configFilename) && hostEnvironment.IsFullTrust) {
if (!_isFileWatched && !string.IsNullOrWhiteSpace(configFilename)) {
// Only monitor configuration file in full trust
XmlConfigurator.ConfigureAndWatch(GetConfigFile(configFilename));
_isFileWatched = true;