Commandline objects help handling command lines specifying processes to execute.
The class can be used to define a command line as nested elements or as a helper to define a command line by an application.
<someelement>
The element
<acommandline executable="/executable/to/run">
<argument value="argument 1" />
<argument line="argument_1 argument_2 argument_3" />
<argument value="argument 4" />
</acommandline>
</someelement>
someelement
must provide a method
createAcommandline
which returns an instance of this class.
author |
thomas.haas@softwired-inc.com |
---|---|
author | |
package |
phing.types |
__construct(null $to_process = null)
throws | |
---|---|
null
__toString() : string
string
addArguments( $line)
clear()
clearArgs()
createArgument(boolean $insertAtStart = false) : \CommandlineArgument
Each commandline object has at most one instance of the argument class.
boolean
if true, the argument is inserted at the beginning of the list of args, otherwise it is appended.
\CommandlineArgument
createMarker() : \CommandlineMarker
This marker can be used to locate a position on the commandline - to insert something for example - when all parameters have been set.
\CommandlineMarker
describeArguments( $args = null, \ignore|integer $offset) : string
arguments to use (default is to use current class args)
\ignore|integer
ignore entries before this index
string
describeCommand(array $args = null) : string
This method assumes that the first entry in the array is the executable to run.
array
CommandlineArgument[] to use
string
getArguments()
getCommandline() : array
array
getExecutable() : string
string
quoteArgument( $argument, boolean $escape = false) : string
If the argument doesn't include spaces or quotes, return it as is. If it contains double quotes, use single quotes - else surround the argument by double quotes.
exception |
BuildException if the argument contains both, single and double quotes. |
---|---|
throws |
boolean
string
setExecutable( $executable)
size() : integer
integer
Number of components in current commandline.
toString( $lines, boolean $escape = false) : string
throws |
---|
boolean
string
translateCommandline(string $to_process) : array
throws |
---|
string
array
DISCLAIMER
arguments : array
var |
CommandlineArguments[] |
---|
array
executable : string
var |
---|
string