classes/phing/types/Commandline.php
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.
<
p>
<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
- Stefan Bodewig
- package
- phing.types
\Commandline
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.
<
p>
<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
- Stefan Bodewig
- package
- phing.types
Constants
Properties
Methods

createArgument(
boolean $insertAtStart
=
false
)
:
\CommandlineArgumentEach commandline object has at most one instance of the argument class.
| Name | Type | Description |
|---|---|---|
| $insertAtStart | boolean | if true, the argument is inserted at the beginning of the list of args, otherwise it is appended. |
| Type | Description |
|---|---|
| \CommandlineArgument |

createMarker(
)
:
\CommandlineMarkerThis marker can be used to locate a position on the commandline - to insert something for example - when all parameters have been set.
| Type | Description |
|---|---|
| \CommandlineMarker |

describeArguments(
\$args $args
=
null, \$offset $offset
=
0
)
:
stringRuntime.exec(String[])| Name | Type | Description |
|---|---|---|
| $args | \$args | arguments to use (default is to use current class args) |
| $offset | \$offset | ignore entries before this index |
| Type | Description |
|---|---|
| string |

describeCommand(
array $args
=
null
)
:
stringRuntime.exec(String[]).This method assumes that the first entry in the array is the executable to run.
| Name | Type | Description |
|---|---|---|
| $args | array | CommandlineArgument[] to use |
| Type | Description |
|---|---|
| string |

getCommandline(
)
:
array| Type | Description |
|---|---|
| array |

quoteArgument(
$argument
)
:
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.
| Name | Type | Description |
|---|---|---|
| $argument |
- exception
- BuildException if the argument contains both, single and double quotes.

setExecutable(
$executable
)
:
| Name | Type | Description |
|---|---|---|
| $executable |

toString(
$lines
)
:
| Name | Type | Description |
|---|---|---|
| $lines |
\CommandlineArgument
"Inner" class used for nested xml command line definitions.
- package
- phing.types
Properties
Methods

setFile(
\value $value
)
:
| Name | Type | Description |
|---|---|---|
| $value | \value | a single commandline argument. |

setLine(
\line $line
)
:
| Name | Type | Description |
|---|---|---|
| $line | \line | line to split into several commandline arguments |

setPath(
\value $value
)
:
| Name | Type | Description |
|---|---|---|
| $value | \value | a single commandline argument. |
\CommandlineMarker
Class to keep track of the position of an Argument.
This class is there to support the srcfile and targetfile elements of <execon> and <transform> - don't know whether there might be additional use cases.
--SB
- package
- phing.types