Some refactoring and small changes:

- Use webObjectsSvc.GetServerManager()
- Do not make any changes if the PHP5 handler is not changed in the UI
- Added text on IIS70_Settings page to inform that the PHP5 Executable Path can be ignored
This commit is contained in:
Olov Karlsson 2014-10-09 11:14:45 +02:00
parent d7ac9fa36f
commit 170b4da51d
5 changed files with 62 additions and 45 deletions

View file

@ -278,34 +278,5 @@ namespace WebsitePanel.Providers.Web.Handlers
srvman.CommitChanges();
}
}
internal void MoveHandlerToTop(string handlerName, string siteName, string vDirPath)
{
if (string.IsNullOrEmpty(siteName))
{
return;
}
if (string.IsNullOrEmpty(vDirPath))
{
vDirPath = "/";
}
using (var srvman = GetServerManager())
{
var config = srvman.GetWebConfiguration(siteName, vDirPath);
var handlersSection = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));
var handlersCollection = handlersSection.Handlers;
var handlerElement = handlersCollection[handlerName];
handlersCollection.Remove(handlerElement);
handlersCollection.AddCopyAt(0, handlerElement);
srvman.CommitChanges();
}
}
}
}