gevman/interactive-cli
Composer 安装命令:
composer require gevman/interactive-cli
包简介
PHP interactive CLI
README 文档
README
Installation (using composer)
composer require gevman/interactive-cli
Class Gevman\Cli\Cli
bool confirm(string $prompt [, bool $default = true])
Interactive confirm - returns user selected value (Y=true, N=false)
$prompt- prompt message$default- default value
void input(&$input [, string $message = ''] [, bool $required = false])
Interactive prompt for user input
$prompt- prompt message$default- default value
Gevman\Cli\CliOutput output(string $str [, mixed $_ = null])
Outputs message
$str- message or pattern for sprintf$_- parameters for sprintf
Class Gevman\Cli\CliOutput
Gevman\Cli\CliOutput success()
Marks output green
Gevman\Cli\CliOutput warning()
Marks output Yellow
Gevman\Cli\CliOutput error()
Marks output Red
Gevman\Cli\CliOutput note()
Marks output Blue
Gevman\Cli\CliOutput endl()
Line break
Gevman\Cli\CliOutput cl()
Clear current line
void progressBar(mixed $all [, string $additionalInfo = ''])
Displays interactive progressbar (message should be current key)
$all- count of all$additionalInfo- displays additional Info for each step
require '/path/to/autoload.php'; use Gevman\Cli\Cli; //basic example Cli::output('%s - %s', 'hello', 'world')->note()->endl()->output('yesimum')->error()->endl()->endl(); //pregressbar example $all = 100000; for ($step = 0; $step < 100000; $step++) { Cli::output($step + 1)->progressBar($all, $step); }
统计信息
- 总下载量: 590
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-11