sunkan/console-select
Composer 安装命令:
composer require sunkan/console-select
包简介
A fancy selection interface for symfony's console component.
README 文档
README
A fancy selection interface for symfony's console component.
Requirements
This project is intended to be run with one of these frameworks:
- symfony/console 5.0+
Install
composer require sunkan/console-select
On Symfony
Add the EddIriarte\Console\Traits\SelectableInputs trait to your command class
# importing : \EddIriarte\Console\Helpers\SelectionHelper # passing the input and output interfaces $this->getHelperSet()->set( new SelectionHelper($this->input, $this->output) );
Checkboxes
Useful when you need several answers from the user.
$selected = $this->select( 'Select characters that appeared in "Star Wars, Episode I - The phantom menace"', [ 'Ahsoka Tano', 'Anakin Skywalker', 'Boba Fett', 'Chewbacca', 'Count Dooku', 'Darth Maul', 'Darth Vader', 'Finn', 'Han Solo', 'Jabba the Hutt', 'Jar Jar Binks', 'Kylo Ren', 'Lando Calrissian', 'Luke Skywalker', 'Mace Windu', 'Obi-Wan Kenobi', 'Padmé Amidala', 'Sheev Palpatine', 'Poe Dameron', 'Princess Leia Organa', 'Qui-Gon Jinn', 'Rey', 'Watto', 'Yoda', ] );
Radio
Useful when you need the user to pick only one anwer from the list.
$selected = $this->select( 'What is the name of the ancient Jedi master that lives at the swamps of Dagobah', [ 'Ahsoka Tano', 'Anakin Skywalker', 'Boba Fett', 'Chewbacca', 'Count Dooku', 'Darth Maul', 'Darth Vader', 'Finn', 'Han Solo', 'Jabba the Hutt', 'Jar Jar Binks', 'Kylo Ren', 'Lando Calrissian', 'Luke Skywalker', 'Mace Windu', 'Obi-Wan Kenobi', 'Padmé Amidala', 'Sheev Palpatine', 'Poe Dameron', 'Princess Leia Organa', 'Qui-Gon Jinn', 'Rey', 'Watto', 'Yoda', ], false // third argument(bool) that allows multiple selections (default: true) );
Still to do
- Handle user-interruptions, such as
Ctrl+C
License
The MIT License (MIT). Please see License File for more information.
sunkan/console-select 适用场景与选型建议
sunkan/console-select 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.29k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 06 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「cli」 「library」 「console」 「select」 「checkbox」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sunkan/console-select 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sunkan/console-select 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sunkan/console-select 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The bundle for easy using json-rpc api on your project
Inbox pattern process implementation for your Laravel Applications
Bundle Symfony DaplosBundle
Core library that defines common interfaces used by the rest of the intahwebz..
Amqp classes
Provides command to manage a web library directory
统计信息
- 总下载量: 1.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-02
