ProcessExecutor
in package
Tags
Table of Contents
- $captureOutput : mixed
- $errorOutput : mixed
- $io : mixed
- $timeout : mixed
- __construct() : mixed
- escape() : string
- Escapes a string to be used as a shell argument.
- execute() : int
- runs a process on the commandline
- getErrorOutput() : string
- Get any error output from the last command
- getTimeout() : mixed
- outputHandler() : mixed
- setTimeout() : mixed
- splitLines() : mixed
- escapeArgument() : string
- Copy of ProcessUtils::escapeArgument() that is deprecated in Symfony 3.3 and removed in Symfony 4.
- isSurroundedBy() : mixed
Properties
$captureOutput
protected
mixed
$captureOutput
$errorOutput
protected
mixed
$errorOutput
$io
protected
mixed
$io
$timeout
protected
static mixed
$timeout
= 300
Methods
__construct()
public
__construct([IOInterface $io = null ]) : mixed
Parameters
- $io : IOInterface = null
Return values
mixed —escape()
Escapes a string to be used as a shell argument.
public
static escape(string $argument) : string
Parameters
- $argument : string
-
The argument that will be escaped
Return values
string —The escaped argument
execute()
runs a process on the commandline
public
execute(string $command[, mixed &$output = null ][, string $cwd = null ]) : int
Parameters
- $command : string
-
the command to execute
- $output : mixed = null
-
the output will be written into this var if passed by ref if a callable is passed it will be used as output handler
- $cwd : string = null
-
the working directory
Return values
int —statuscode
getErrorOutput()
Get any error output from the last command
public
getErrorOutput() : string
Return values
string —getTimeout()
public
static getTimeout() : mixed
Return values
mixed —outputHandler()
public
outputHandler(mixed $type, mixed $buffer) : mixed
Parameters
- $type : mixed
- $buffer : mixed
Return values
mixed —setTimeout()
public
static setTimeout(mixed $timeout) : mixed
Parameters
- $timeout : mixed
Return values
mixed —splitLines()
public
splitLines(mixed $output) : mixed
Parameters
- $output : mixed
Return values
mixed —escapeArgument()
Copy of ProcessUtils::escapeArgument() that is deprecated in Symfony 3.3 and removed in Symfony 4.
private
static escapeArgument(string $argument) : string
Parameters
- $argument : string
Return values
string —isSurroundedBy()
private
static isSurroundedBy(mixed $arg, mixed $char) : mixed
Parameters
- $arg : mixed
- $char : mixed