Fix for PhpVersions-related issue on VirtualDir
This commit is contained in:
parent
aa71fcaaa2
commit
4e5115b512
1 changed files with 10 additions and 5 deletions
|
@ -892,7 +892,7 @@ namespace WebsitePanel.Providers.Web
|
||||||
if (handlerName != GetActivePhpHandlerName(virtualDir))
|
if (handlerName != GetActivePhpHandlerName(virtualDir))
|
||||||
{
|
{
|
||||||
// Only change handler if it is different from the current one
|
// Only change handler if it is different from the current one
|
||||||
handlersSvc.CopyInheritedHandlers(((WebSite)virtualDir).SiteId, virtualDir.VirtualPath);
|
handlersSvc.CopyInheritedHandlers(GetSiteIdFromVirtualDir(virtualDir), virtualDir.VirtualPath);
|
||||||
MakeHandlerActive(handlerName, virtualDir);
|
MakeHandlerActive(handlerName, virtualDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4484,7 +4484,7 @@ namespace WebsitePanel.Providers.Web
|
||||||
|
|
||||||
protected PhpVersion[] GetPhpVersions(ServerManager srvman, WebVirtualDirectory virtualDir)
|
protected PhpVersion[] GetPhpVersions(ServerManager srvman, WebVirtualDirectory virtualDir)
|
||||||
{
|
{
|
||||||
var config = srvman.GetWebConfiguration(((WebSite)virtualDir).SiteId, virtualDir.VirtualPath);
|
var config = srvman.GetWebConfiguration(GetSiteIdFromVirtualDir(virtualDir), virtualDir.VirtualPath);
|
||||||
//var config = srvman.GetApplicationHostConfiguration();
|
//var config = srvman.GetApplicationHostConfiguration();
|
||||||
var handlersSection = config.GetSection(Constants.HandlersSection);
|
var handlersSection = config.GetSection(Constants.HandlersSection);
|
||||||
|
|
||||||
|
@ -4526,7 +4526,7 @@ namespace WebsitePanel.Providers.Web
|
||||||
|
|
||||||
protected string GetActivePhpHandlerName(ServerManager srvman, WebVirtualDirectory virtualDir)
|
protected string GetActivePhpHandlerName(ServerManager srvman, WebVirtualDirectory virtualDir)
|
||||||
{
|
{
|
||||||
var config = srvman.GetWebConfiguration(((WebSite)virtualDir).SiteId, virtualDir.VirtualPath);
|
var config = srvman.GetWebConfiguration(GetSiteIdFromVirtualDir(virtualDir), virtualDir.VirtualPath);
|
||||||
var handlersSection = config.GetSection(Constants.HandlersSection);
|
var handlersSection = config.GetSection(Constants.HandlersSection);
|
||||||
|
|
||||||
// Find first handler for *.php
|
// Find first handler for *.php
|
||||||
|
@ -4545,7 +4545,7 @@ namespace WebsitePanel.Providers.Web
|
||||||
{
|
{
|
||||||
using (var srvman = webObjectsSvc.GetServerManager())
|
using (var srvman = webObjectsSvc.GetServerManager())
|
||||||
{
|
{
|
||||||
var config = srvman.GetWebConfiguration(((WebSite)virtualDir).SiteId, virtualDir.VirtualPath);
|
var config = srvman.GetWebConfiguration(GetSiteIdFromVirtualDir(virtualDir), virtualDir.VirtualPath);
|
||||||
|
|
||||||
var handlersSection = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));
|
var handlersSection = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));
|
||||||
|
|
||||||
|
@ -4564,6 +4564,11 @@ namespace WebsitePanel.Providers.Web
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
protected string GetSiteIdFromVirtualDir(WebVirtualDirectory virtualDir)
|
||||||
|
{
|
||||||
|
return string.IsNullOrEmpty(virtualDir.ParentSiteName) ? ((WebSite) virtualDir).SiteId : virtualDir.ParentSiteName;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue