PHP 클래스 JBZoo\Utils\Cli

파일 보기 프로젝트 열기: jbzoo/utils 1 사용 예제들

공개 메소드들

메소드 설명
build ( string $command, array $args = [] ) : string Build params for cli options
check ( ) : boolean Is command line
err ( string $message, boolean $addEol = true ) Print line to std error
exec ( string $command, array $args = [], null $cwd = null, boolean $verbose = false ) : string Execute cli commands
getNumberOfColumns ( ) : integer Returns the number of columns of the terminal.
hasColorSupport ( ) : boolean Returns true if STDOUT supports colorization.
isInteractive ( integer | resource $fileDescriptor = self::STDOUT ) : boolean Returns if the file descriptor is an interactive terminal or not.
out ( string $message, boolean $addEol = true ) Print line to std out

메소드 상세

build() 공개 정적인 메소드

Build params for cli options
public static build ( string $command, array $args = [] ) : string
$command string
$args array
리턴 string

check() 공개 정적인 메소드

Is command line
public static check ( ) : boolean
리턴 boolean

err() 공개 정적인 메소드

Print line to std error
public static err ( string $message, boolean $addEol = true )
$message string
$addEol boolean

exec() 공개 정적인 메소드

Execute cli commands
public static exec ( string $command, array $args = [], null $cwd = null, boolean $verbose = false ) : string
$command string
$args array
$cwd null
$verbose boolean
리턴 string

getNumberOfColumns() 공개 정적인 메소드

Returns the number of columns of the terminal.
public static getNumberOfColumns ( ) : integer
리턴 integer

hasColorSupport() 공개 정적인 메소드

This code has been copied and adapted from Symfony\Component\Console\Output\OutputStream.
public static hasColorSupport ( ) : boolean
리턴 boolean

isInteractive() 공개 정적인 메소드

Returns if the file descriptor is an interactive terminal or not.
public static isInteractive ( integer | resource $fileDescriptor = self::STDOUT ) : boolean
$fileDescriptor integer | resource
리턴 boolean

out() 공개 정적인 메소드

Print line to std out
public static out ( string $message, boolean $addEol = true )
$message string
$addEol boolean