wp-cli/php-cli-tools
Composer 安装命令:
composer require wp-cli/php-cli-tools
包简介
Console utilities for PHP
README 文档
README
A collection of functions and classes to assist with command line development.
Requirements
- PHP >= 5.6
Suggested PHP extensions
- mbstring - Used for calculating string widths.
Function List
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')
Progress Indicators
cli\notify\Dots($msg, $dots = 3, $interval = 100)cli\notify\Spinner($msg, $interval = 100)cli\progress\Bar($msg, $total, $interval = 100)
Tabular Display
cli\Table::__construct(array $headers = null, array $rows = null)cli\Table::setHeaders(array $headers)cli\Table::setRows(array $rows)cli\Table::setRenderer(cli\table\Renderer $renderer)cli\Table::addRow(array $row)cli\Table::sort($column)cli\Table::display()
The display function will detect if output is piped and, if it is, render a tab delimited table instead of the ASCII table rendered for visual display.
You can also explicitly set the renderer used by calling cli\Table::setRenderer() and giving it an instance of one
of the concrete cli\table\Renderer classes.
Tree Display
cli\Tree::__construct()cli\Tree::setData(array $data)cli\Tree::setRenderer(cli\tree\Renderer $renderer)cli\Tree::render()cli\Tree::display()
Argument Parser
Argument parsing uses a simple framework for taking a list of command line arguments,
usually straight from $_SERVER['argv'], and parses the input against a set of
defined rules.
Check examples/arguments.php for an example.
Usage
See examples/ directory for examples.
Todo
- Expand this README
- Add doc blocks to rest of code
wp-cli/php-cli-tools 适用场景与选型建议
wp-cli/php-cli-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27.48M 次下载、GitHub Stars 达 683, 最近一次更新时间为 2012 年 12 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「console」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wp-cli/php-cli-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wp-cli/php-cli-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wp-cli/php-cli-tools 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This class provides you with an easy-to-use interface to progress bars.
A Laravel package to retrieve data from Google Search Console
Additional artisan commands for Laravel
A table generator class for the PHP CLI.
Slim starter / Slim skeleton package to boost your development with Slim framework
Generates a trait to help ease the access of custom repo methods
统计信息
- 总下载量: 27.48M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 699
- 点击次数: 16
- 依赖项目数: 458
- 推荐数: 2
其他信息
- 授权协议: MIT
- 更新时间: 2012-12-13