chipslays/clify
Composer 安装命令:
composer require chipslays/clify
包简介
Developing CLI applications in PHP.
关键字:
README 文档
README
Developing CLI applications in PHP.
Installation
$ composer require chipslays/clify
Usage
Place this code in app file:
#!/usr/bin/env php <?php use Clify\Cli; require 'vendor/autoload.php'; $cli = new Cli; print_r($cli->getArgs()->toArray());
Run app file in Terminal:
$ php app --data "hello world" --save "./path/to/file.txt" -o --append -val="test" --some="spaces here" lonely
Terminal output:
Array ( [data] => hello world [save] => ./path/to/file.txt [o] => 1 [append] => 1 [val] => test [some] => spaces here [lonely] => 1 )
use Clify\Cli; require 'vendor/autoload.php'; out('text'); error('text'); success('text'); info('text'); warning('text'); $cli->get('some_arg', 'default value');
Terminal output (with new line):
use Clify\Cli; require 'vendor/autoload.php'; echo Cli::out("{blue}Blue text");
Colorize text output:
use Clify\Cli; require 'vendor/autoload.php'; echo Cli::colorize("{blue}Blue text{reset}"); echo Cli::colorize("{black}{bg:yellow} Black text on Yellow background{reset}"); // At the end, it will automatically add {reset} echo Cli::colorizeLine("{blue}Blue text");
Available colors:
$list = [ "{reset}" => "\e[0m", "{black}" => "\e[0;30m", "{white}" => "\e[1;37m", "{dark_grey}" => "\e[1;30m", "{dark_gray}" => "\e[1;30m", "{light_grey}" => "\e[0;37m", "{light_gray}" => "\e[0;37m", "{red}" => "\e[0;31m", "{light_red}" => "\e[1;31m", "{green}" => "\e[0;32m", "{light_green}" => "\e[1;32m", "{brown}" => "\e[0;33m", "{yellow}" => "\e[1;33m", "{blue}" => "\e[0;34m", "{magenta}" => "\e[0;35m", "{light_magenta}" => "\e[1;35m", "{cyan}" => "\e[0;36m", "{light_cyan}" => "\e[1;36m", "{bg:black}" => "\e[40m", "{bg:red}" => "\e[41m", "{bg:green}" => "\e[42m", "{bg:yellow}" => "\e[43m", "{bg:blue}" => "\e[44m", "{bg:magenta}" => "\e[45m", "{bg:cyan}" => "\e[46m", "{bg:light_grey}" => "\e[47m", "{bg:light_gray}" => "\e[47m", ];
chipslays/clify 适用场景与选型建议
chipslays/clify 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 43 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 01 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「application」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 chipslays/clify 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 chipslays/clify 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 chipslays/clify 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Kinikit - PHP Application development framework MVC component
A Laravel queue connector to process jobs at the end of the application
C3JS By phpanonymous (Mahmoud Ibrahim)
This package manage your site basic settings like - site title, logo etc. You can also add your custom setting using this package.
Slim starter / Slim skeleton package to boost your development with Slim framework
Generates a trait to help ease the access of custom repo methods
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-14