class Command
deprecated
__construct(Command $parent = null) Constructor. | ||
string | __toString() Returns command as string. | |
static Command | create(Command $parent = null) Creates a new Command instance. | |
static string | escape(string $input) Escapes special chars from input. | |
static string | quote(string $input) Quotes input. | |
Command | add(string|Command $bit) Appends a string or a Command instance. | |
Command | top(string|Command $bit) Prepends a string or a command instance. | |
Command | arg(string $arg) Appends an argument, will be quoted. | |
Command | cmd(string $esc) Appends escaped special command chars. | |
Command | ins(string $label) Inserts a labeled command to feed later. | |
Command | get(string $label) Retrieves a previously labeled command. | |
Command | end() Returns parent command (if any). | |
int | length() Counts bits stored in command. | |
Command | setErrorHandler(Closure $errorHandler) | |
Closure|null | getErrorHandler() | |
array | execute() Executes current command. | |
string | join() Joins bits. | |
Command | addAtIndex(string|Command $bit, int $index) Insert a string or a Command instance before the bit at given position $index (index starts from 0). |
Constructor.
Command | $parent | Parent command |
Returns command as string.
string |
Creates a new Command instance.
Command | $parent | Parent command |
Command | New Command instance |
Escapes special chars from input.
string | $input | A string to escape |
string | The escaped string |
Quotes input.
string | $input | An argument string |
string | The quoted string |
Appends a string or a Command instance.
string|Command | $bit |
Command | The current Command instance |
Prepends a string or a command instance.
string|Command | $bit |
Command | The current Command instance |
Appends an argument, will be quoted.
string | $arg |
Command | The current Command instance |
Appends escaped special command chars.
string | $esc |
Command | The current Command instance |
Inserts a labeled command to feed later.
string | $label | The unique label |
Command | The current Command instance |
RuntimeException | If label already exists |
Retrieves a previously labeled command.
string | $label |
Command | The labeled command |
RuntimeException |
Returns parent command (if any).
Command | Parent command |
RuntimeException | If command has no parent |
Counts bits stored in command.
int | The bits count |
Closure | $errorHandler |
Command |
Closure|null |
Executes current command.
array | The command result |
RuntimeException |
Joins bits.
string |
Insert a string or a Command instance before the bit at given position $index (index starts from 0).
string|Command | $bit | |
int | $index |
Command | The current Command instance |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Finder/Shell/Command.html