PHP 클래스 yii2tech\selfupdate\Shell

또한 보기: ShellResult
부터: 1.0
저자: Paul Klimov ([email protected])
파일 보기 프로젝트 열기: yii2tech/selfupdate 1 사용 예제들

공개 메소드들

메소드 설명
buildOptions ( array $options ) : string Builds shell command options string from array.
execute ( string $command, array $placeholders = [] ) : ShellResult Executes shell command.

비공개 메소드들

메소드 설명
normalizeOptionName ( string $name ) : string Normalizes shell command option name, adding leading - if necessary.

메소드 상세

buildOptions() 공개 정적인 메소드

Option, which does not use any value should be specified as an array value, option with value should be specified as key-value pair, where key is an option name and value - option value. Option name will be automatically prefixed with -- in case it has not already. For example: php [ 'verbose', 'username' => 'root' ]
부터: 1.0.2
public static buildOptions ( array $options ) : string
$options array options specification.
리턴 string options string.

execute() 공개 정적인 메소드

Executes shell command.
public static execute ( string $command, array $placeholders = [] ) : ShellResult
$command string command to be executed.
$placeholders array placeholders to be replaced using `escapeshellarg()` in format: placeholder => value.
리턴 ShellResult execution result.