CLI.php
system/CLI/CLI.php
1 class
38 methods
class CLI
Set of static methods useful for CLI request handling. Portions of this code were initially from the FuelPHP Framework, version 1.7.x, and used here under the MIT license they were originally made available under. Reference: http://fuelphp.com Some of the code in this class is Windows-specific, and not possible to test using travis-ci. It has been phpunit-annotated to prevent messing up code coverage.
init
()
input
(?string $prefix = null)
prompt
(string $field, $options = null, $validation = null)
promptByKey
($text, array $options, $validation = null)
promptByMultipleKeys
(string $text, array $options)
isZeroOptions
(array $options)
printKeysAndValues
(array $options)
validate
(string $field, string $value, $rules)
string
(string $text = '', ?string $foreground = null, ?string $background = null)
write
(string $text = '', ?string $foreground = null, ?string $background = null)
error
(string $text, string $foreground = 'light_red', ?string $background = null)
beep
(int $num = 1)
wait
(int $seconds, bool $countdown = false)
isWindows
()
newLine
(int $num = 1)
clearScreen
()
color
(string $text, string $foreground, ?string $background = null, ?string $format = null)
getColoredText
(string $text, string $foreground, ?string $background, ?string $format)
strlen
(?string $string)
streamSupports
(string $function, $resource)
hasColorSupport
($resource)
getWidth
(int $default = 80)
getHeight
(int $default = 32)
generateDimensions
()
showProgress
($thisStep = 1, int $totalSteps = 10)
wrap
(?string $string = null, int $max = 0, int $padLeft = 0)
void
(&$line)
parseCommandLine
()
getURI
()
getSegment
(int $index)
getSegments
()
getOption
(string $name)
getOptions
()
getOptionString
(bool $useLongOpts = false, bool $trim = false)
table
(array $tbody, array $thead = [])
fwrite
($handle, string $string)
setInputOutput
(InputOutput $io)
resetInputOutput
()