mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
"orchard.exe" can now invoke the CommandAgent
The CommandAgent merely initalizes an Orchard Host and Shell (for now). --HG-- branch : dev
This commit is contained in:
@@ -18,5 +18,10 @@ namespace Orchard.Host {
|
||||
public void Stop(bool immediate) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
public void RunCommand(string[] args) {
|
||||
var agent = Activator.CreateInstance("Orchard.Framework", "Orchard.Commands.CommandAgent").Unwrap();
|
||||
agent.GetType().GetMethod("RunSingleCommand").Invoke(agent, new object[] { args });
|
||||
}
|
||||
}
|
||||
}
|
@@ -21,6 +21,8 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>true</UseVSHostingProcess>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
@@ -8,5 +8,6 @@ namespace Orchard {
|
||||
public bool Verbose { get; set; }
|
||||
public string VirtualPath { get; set; }
|
||||
public string WorkingDirectory { get; set; }
|
||||
public string Tenant { get; set; }
|
||||
}
|
||||
}
|
@@ -10,8 +10,9 @@ namespace Orchard {
|
||||
}
|
||||
|
||||
public class OrchardArgumentsParser : IOrchardArgumentsParser {
|
||||
|
||||
public OrchardArguments Parse(ParserResult arguments) {
|
||||
OrchardArguments result = new OrchardArguments();
|
||||
var result = new OrchardArguments();
|
||||
|
||||
foreach (var sw in arguments.Switches) {
|
||||
switch (sw.Name.ToLowerInvariant()) {
|
||||
@@ -29,6 +30,11 @@ namespace Orchard {
|
||||
case "virtualpath":
|
||||
result.VirtualPath = sw.Value;
|
||||
break;
|
||||
|
||||
case "t":
|
||||
case "tenant":
|
||||
result.Tenant = sw.Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -41,8 +41,16 @@ namespace Orchard {
|
||||
Console.WriteLine("Detected and using orchard directory \"{0}\"", orchardDirectory.FullName);
|
||||
}
|
||||
|
||||
object host = CreateWorkerAppDomainWithHost(arguments.VirtualPath, orchardDirectory.FullName, typeof(CommandHost));
|
||||
if (arguments.Verbose) {
|
||||
Console.WriteLine("Creating ASP.NET AppDomain for command agent");
|
||||
}
|
||||
var host = (CommandHost)CreateWorkerAppDomainWithHost(arguments.VirtualPath, orchardDirectory.FullName, typeof(CommandHost));
|
||||
|
||||
|
||||
if (arguments.Verbose) {
|
||||
Console.WriteLine("Executing command in ASP.NET AppDomain");
|
||||
}
|
||||
host.RunCommand(_args);
|
||||
}
|
||||
|
||||
private DirectoryInfo GetOrchardDirectory(string directory) {
|
||||
|
Reference in New Issue
Block a user