Adds new database table + migration + unit test + fixes up unit tests to ensure PluginManager.Current = null; is done on teardown.

Created new ServerRegistrationRepository + unit tests + models
This commit is contained in:
Shannon Deminick
2013-02-13 03:29:32 +06:00
parent 102bf058bc
commit 3b25214433
43 changed files with 724 additions and 101 deletions

View File

@@ -0,0 +1,29 @@
using System.Xml;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
namespace Umbraco.Core.Sync
{
/// <summary>
/// A server registration based on the legacy umbraco xml configuration in umbracoSettings
/// </summary>
internal class ConfigServerAddress : IServerAddress
{
public ConfigServerAddress(XmlNode n)
{
var webServicesUrl = IOHelper.ResolveUrl(SystemDirectories.WebServices);
var protocol = GlobalSettings.UseSSL ? "https" : "http";
if (n.Attributes.GetNamedItem("forceProtocol") != null && !string.IsNullOrEmpty(n.Attributes.GetNamedItem("forceProtocol").Value))
protocol = n.Attributes.GetNamedItem("forceProtocol").Value;
var domain = XmlHelper.GetNodeValue(n);
if (n.Attributes.GetNamedItem("forcePortnumber") != null && !string.IsNullOrEmpty(n.Attributes.GetNamedItem("forcePortnumber").Value))
domain += string.Format(":{0}", n.Attributes.GetNamedItem("forcePortnumber").Value);
ServerAddress = string.Format("{0}://{1}{2}/cacheRefresher.asmx", protocol, domain, webServicesUrl);
}
public string ServerAddress { get; private set; }
}
}