thesmart / php-cli-tools
一组用于帮助在PHP 5.3中进行命令行开发的工具
v1.1
2012-08-07 10:58 UTC
Requires
- php: >=5.3.0
Suggests
- kriswallsmith/buzz: Allows execution of the http-console.php cli example
This package is not auto-updated.
Last update: 2024-09-28 12:39:00 UTC
README
一组辅助命令行开发的函数和类。
要求
- PHP >= 5.3
函数列表
\cli\out($msg, ...)
\cli\out_padded($msg, ...)
\cli\err($msg, ...)
\cli\line($msg = '', ...)
\cli\input()
\cli\prompt($question, $default = false, $marker = ':')
\cli\choose($question, $choices = 'yn', $default = 'n')
\cli\menu($items, $default = false, $title = 'Choose an Item')
进度指示器
\cli\notifier\Dots($msg, $dots = 3, $interval = 100)
\cli\notifier\Spinner($msg, $interval = 100)
\cli\progress\Bar($msg, $total, $interval = 100)
表格显示
\cli\Table::__construct(array $headers = null, array $rows = null)
\cli\Table::setHeaders(array $headers)
\cli\Table::setRows(array $rows)
\cli\Table::addRow(array $row)
\cli\Table::sort($column)
\cli\Table::display()
用法
查看 example.php
以获取示例。
待办事项
- 扩展此README
- 添加代码块的文档注释