PHP Класс System\cli

Just another php framework
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$args
$background_colors
$foreground_colors

Открытые методы

Метод Описание
beep ( $num = 1 ) Beeps a certain number of times.
clear_screen ( ) Clears the screen of output
color ( $text, $foreground, $background = null ) Returns the given text with the correct color codes for a foreground and optionally a background color.
error ( $text = '', $foreground = 'light_red', $background = null ) Outputs an error to the CLI using STDERR instead of STDOUT
input ( $prefix = '' ) Get input from the shell, using readline or the standard STDIN
is_windows ( ) if operating system === windows
new_line ( $num = 1 ) Enter a number of empty lines
option ( $name, $default = false ) Returns the option with the given name. You can also give the option number.
spawn ( $call, $output = '/dev/null' ) Spawn Background Process
wait ( $seconds, $countdown = false ) Waits a certain number of seconds, optionally showing a wait message and waiting for a key press.
write ( $text = '', $foreground = null, $background = null ) Outputs a string to the cli. If you send an array it will implode them with a line break.

Приватные методы

Метод Описание
readline_support ( )

Описание методов

beep() публичный статический Метод

Beeps a certain number of times.
public static beep ( $num = 1 )

clear_screen() публичный статический Метод

Clears the screen of output
public static clear_screen ( )

color() публичный статический Метод

Returns the given text with the correct color codes for a foreground and optionally a background color.
public static color ( $text, $foreground, $background = null )

error() публичный статический Метод

Outputs an error to the CLI using STDERR instead of STDOUT
public static error ( $text = '', $foreground = 'light_red', $background = null )

input() публичный статический Метод

Get input from the shell, using readline or the standard STDIN
public static input ( $prefix = '' )

is_windows() публичный статический Метод

if operating system === windows
public static is_windows ( )

new_line() публичный статический Метод

Enter a number of empty lines
public static new_line ( $num = 1 )

option() публичный статический Метод

Returns the option with the given name. You can also give the option number.
public static option ( $name, $default = false )

spawn() публичный статический Метод

Spawn Background Process
public static spawn ( $call, $output = '/dev/null' )

wait() публичный статический Метод

Waits a certain number of seconds, optionally showing a wait message and waiting for a key press.
public static wait ( $seconds, $countdown = false )

write() публичный статический Метод

Outputs a string to the cli. If you send an array it will implode them with a line break.
public static write ( $text = '', $foreground = null, $background = null )

Описание свойств

$args защищенное статическое свойство

protected static $args

$background_colors защищенное статическое свойство

protected static $background_colors

$foreground_colors защищенное статическое свойство

protected static $foreground_colors