mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-15 21:17:14 +08:00
- tenant info <tenantName> command...
--HG-- branch : dev
This commit is contained in:
parent
fb87c02273
commit
45c2b3ec7e
@ -1,4 +1,5 @@
|
||||
using Orchard.Commands;
|
||||
using System.Linq;
|
||||
using Orchard.Commands;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.MultiTenancy.Services;
|
||||
|
||||
@ -48,5 +49,24 @@ namespace Orchard.MultiTenancy.Commands {
|
||||
DataPrefix = prefix
|
||||
});
|
||||
}
|
||||
|
||||
[CommandHelp("tenant info <tenantName>: Display settings for a tenant")]
|
||||
[CommandName("tenant info")]
|
||||
public void Info(string tenantName) {
|
||||
ShellSettings tenant = _tenantService.GetTenants().Where(x => x.Name == tenantName).FirstOrDefault();
|
||||
|
||||
if (tenant == null) {
|
||||
Context.Output.Write(T("Tenant: ") + tenantName + T(" was not found"));
|
||||
}
|
||||
else {
|
||||
Context.Output.WriteLine(T("Tenant Settings:"));
|
||||
Context.Output.WriteLine(T("---------------------------"));
|
||||
Context.Output.WriteLine(T("Name: ") + tenant.Name);
|
||||
Context.Output.WriteLine(T("Provider: ") + tenant.DataProvider);
|
||||
Context.Output.WriteLine(T("ConnectionString: ") + tenant.DataConnectionString);
|
||||
Context.Output.WriteLine(T("Prefix: ") + tenant.DataPrefix);
|
||||
Context.Output.WriteLine(T("---------------------------"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user