@@ -165,6 +165,7 @@ pass `command`, `execCommand` and `args` as options. This will call the respecti
165
165
166
166
* ` __construct($options = null) `
167
167
* ` $options ` : either a command string or an options array (see ` setOptions() ` )
168
+ * ` __toString() ` : The result from ` getExecCommand() `
168
169
* ` setOptions($options) ` : Set command options
169
170
* ` $options ` : array of name => value options that should be applied to the object.
170
171
You can also pass options that use a setter, e.g. you can pass a ` command ` option which
@@ -176,22 +177,27 @@ pass `command`, `execCommand` and `args` as options. This will call the respecti
176
177
* ` getCommand() ` : The command that was set through ` setCommand() ` or passed to the constructor.
177
178
* ` getExecCommand() ` : The full command string to execute.
178
179
* ` setArgs($args) ` : Set argument as string
179
- * ` $args ` : The command arguments as string. Note, that these will not get escaped!
180
+ * ` $args ` : The command arguments as string. Note, that these will not get escaped. This
181
+ will overwrite the args added with ` addArgs() ` .
180
182
* ` getArgs() ` : The command arguments that where set through ` setArgs() ` or ` addArg() ` , as string
181
183
* ` addArg($key, $value=null, $escape=null) ` : Add argument with correct escaping
182
184
* ` $key ` : The argument key to add e.g. ` --feature ` or ` --name= ` . If the key does not end with
183
- and ` = ` , the ` $value ` will be separated by a space, if any. Keys are not escaped unless
184
- ` $value ` is null and ` $escape ` is ` true ` .
185
- * ` $value ` : The optional argument value which will get escaped if ` $escapeArgs ` is true.
185
+ and ` = ` , the (optional) ` $value ` will be separated by a space. The key will get
186
+ escaped if ` $escapeArgs ` is ` true ` .
187
+ * ` $value ` : The optional argument value which will get escaped if ` $escapeArgs ` is ` true ` .
186
188
An array can be passed to add more than one value for a key, e.g. ` addArg('--exclude', array('val1','val2')) `
187
189
which will create the option "--exclude 'val1' 'val2'".
188
190
* ` $escape ` : If set, this overrides the ` $escapeArgs ` setting and enforces escaping/no escaping
189
191
* ` setStdIn() ` : String or resource to supply to command via standard input.
192
+ This enables the same functionality as piping on the command line. It can
193
+ also be a resource like a file handle or a stream in which case its content
194
+ will be piped into the command like an input redirection.
190
195
* ` getOutput() ` : The command output as string. Empty if none.
191
196
* ` getError() ` : The error message, either stderr or internal message. Empty if no error.
192
197
* ` getStdErr() ` : The stderr output. Empty if none.
193
- * ` getExitCode() ` : The exit code.
198
+ * ` getExitCode() ` : The exit code or ` null ` if command was not executed .
194
199
* ` getExecuted() ` : Whether the command was successfully executed.
200
+ * ` getIsWindows() ` : Whether we are on a Windows Owe are on a Windows OS
195
201
* ` execute() ` : Executes the command and returns ` true ` on success, ` false ` otherwhise.
196
202
197
203
> ** Note:** ` getError() ` , ` getStdErr() ` and ` getOutput() ` return the trimmed output.
0 commit comments