PHP Class yii2tech\selfupdate\ShellResult

Since: 1.0
Author: Paul Klimov ([email protected])
Inheritance: extends yii\base\Object
Show file Open project: yii2tech/selfupdate

Public Properties

Property Type Description
$command command being executed.
$exitCode shell command execution exit code
$outputLines shell command output lines.

Public Methods

Method Description
__toString ( ) : string PHP magic method that returns the string representation of this object.
getOutput ( string $glue = " " ) : string
isOk ( ) : boolean
isOutputContains ( string $string ) : boolean Checks if output contains given string
isOutputEmpty ( ) : boolean
isOutputMatches ( string $pattern ) : boolean Checks if output matches give regular expression.
toString ( ) : string

Method Details

__toString() public method

PHP magic method that returns the string representation of this object.
public __toString ( ) : string
return string the string representation of this object.

getOutput() public method

public getOutput ( string $glue = " " ) : string
$glue string lines glue.
return string shell command output.

isOk() public method

public isOk ( ) : boolean
return boolean whether exit code is OK.

isOutputContains() public method

Checks if output contains given string
public isOutputContains ( string $string ) : boolean
$string string needle string.
return boolean whether output contains given string.

isOutputEmpty() public method

public isOutputEmpty ( ) : boolean
return boolean whether command execution produced empty output.

isOutputMatches() public method

Checks if output matches give regular expression.
public isOutputMatches ( string $pattern ) : boolean
$pattern string regular expression
return boolean whether output matches given regular expression.

toString() public method

public toString ( ) : string
return string string representation of this object.

Property Details

$command public property

command being executed.
public $command

$exitCode public property

shell command execution exit code
public $exitCode

$outputLines public property

shell command output lines.
public $outputLines