mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Some setup cleanup around ShellSettings
--HG-- branch : dev
This commit is contained in:
@@ -48,7 +48,6 @@ namespace Orchard.Setup.Controllers {
|
|||||||
var shellSettings = new ShellSettings {
|
var shellSettings = new ShellSettings {
|
||||||
Name = "default",
|
Name = "default",
|
||||||
DataProvider = model.DatabaseOptions ? "SQLite" : "SqlServer",
|
DataProvider = model.DatabaseOptions ? "SQLite" : "SqlServer",
|
||||||
DataFolder = Server.MapPath("~/App_Data"),
|
|
||||||
DataConnectionString = model.DatabaseConnectionString
|
DataConnectionString = model.DatabaseConnectionString
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -56,7 +55,7 @@ namespace Orchard.Setup.Controllers {
|
|||||||
// provider: SqlServer or SQLite
|
// provider: SqlServer or SQLite
|
||||||
// dataFolder: physical path (map before calling). Builtin database will be created in this location
|
// dataFolder: physical path (map before calling). Builtin database will be created in this location
|
||||||
// connectionString: optional - if provided the dataFolder is essentially ignored, but should still be passed in
|
// connectionString: optional - if provided the dataFolder is essentially ignored, but should still be passed in
|
||||||
_databaseMigrationManager.CreateCoordinator(shellSettings.DataProvider, shellSettings.DataFolder, shellSettings.DataConnectionString);
|
_databaseMigrationManager.CreateCoordinator(shellSettings.DataProvider, Server.MapPath("~/App_Data"), shellSettings.DataConnectionString);
|
||||||
|
|
||||||
// creating a standalone environment.
|
// creating a standalone environment.
|
||||||
// in theory this environment can be used to resolve any normal components by interface, and those
|
// in theory this environment can be used to resolve any normal components by interface, and those
|
||||||
|
@@ -2,14 +2,12 @@
|
|||||||
public interface IShellSettings {
|
public interface IShellSettings {
|
||||||
string Name { get; set; }
|
string Name { get; set; }
|
||||||
string DataProvider { get; set; }
|
string DataProvider { get; set; }
|
||||||
string DataFolder { get; set; }
|
|
||||||
string DataConnectionString { get; set; }
|
string DataConnectionString { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ShellSettings : IShellSettings {
|
public class ShellSettings : IShellSettings {
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string DataProvider { get; set; }
|
public string DataProvider { get; set; }
|
||||||
public string DataFolder { get; set; }
|
|
||||||
public string DataConnectionString { get; set; }
|
public string DataConnectionString { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -67,7 +67,6 @@ namespace Orchard.Environment.Configuration {
|
|||||||
return new ShellSettings {
|
return new ShellSettings {
|
||||||
Name = GetValue(fields, "Name"),
|
Name = GetValue(fields, "Name"),
|
||||||
DataProvider = GetValue(fields, "DataProvider"),
|
DataProvider = GetValue(fields, "DataProvider"),
|
||||||
DataFolder = GetValue(fields, "DataFolder"),
|
|
||||||
DataConnectionString = GetValue(fields, "DataConnectionString")
|
DataConnectionString = GetValue(fields, "DataConnectionString")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -88,8 +87,9 @@ namespace Orchard.Environment.Configuration {
|
|||||||
|
|
||||||
settingsBuilder.AppendLine(string.Format("Name: {0}", shellSettings.Name));
|
settingsBuilder.AppendLine(string.Format("Name: {0}", shellSettings.Name));
|
||||||
settingsBuilder.AppendLine(string.Format("DataProvider: {0}", shellSettings.DataProvider));
|
settingsBuilder.AppendLine(string.Format("DataProvider: {0}", shellSettings.DataProvider));
|
||||||
settingsBuilder.AppendLine(string.Format("DataFolder: {0}", shellSettings.DataFolder));
|
|
||||||
settingsBuilder.AppendLine(string.Format("DataConnectionString: {0}", shellSettings.DataConnectionString));
|
if (!string.IsNullOrEmpty(shellSettings.DataConnectionString))
|
||||||
|
settingsBuilder.AppendLine(string.Format("DataConnectionString: {0}", shellSettings.DataConnectionString));
|
||||||
|
|
||||||
return settingsBuilder.ToString();
|
return settingsBuilder.ToString();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user