Download the PHP package iry/cli without Composer

On this page you can find all versions of the php package iry/cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cli

[中文] / English

简介

iry/Cli 可以简单实现 输出、输入、倒计时、绘制进度条、绘制表格、移动光标、清除屏幕、确认对话 等功能

可以轻松实现类似表单等输入功能:

如(input: stdin, 开关:confirm, select:select,radio:select单选模式, checkbox:select多选模式

安装

使用方法

环境控制 【可选】

示例

标准输入

stdin($msg,$validator,$processor);//等待并获取用户输入的数据

参数 类型 说明
$msg string 消息:等待用户输入前,输一条提示消息消息
$validator false/callable 验证器:用于验证用户输入的信息是否有效的方法
$processor false/callable 处理器:对用户输入的数据进行处理的方法

标准输出 output($msg,$styleType)

打印到屏幕 支持彩色文字

参数 说明
$msg string/array 消息:等待用户输入前,输一条提示消息消息
$styleType string/array error,info,comment,question,highlight,warning,[前景色,背景色]

$msg数组模式可以设置复杂的彩色文字如下示例

示例

示例大致效果如下

这是一个测试:
这是一个测试:
这是一个测试:
这是一个测试

确认对话

confirm($msg,$validator,$processor);//Cli中 确认对话

参数 说明
$msg string 消息:等待用户输入前,输一条提示消息消息
return bool true/false

$msg

列表选择

select($list,$colQty,$msg,$mul);

参数 说明
$list array 必须 可选清单
$colQty int 可选 列数,展示可选清单时,展示几列。默认:1
$msg string 可选 默认:请输入
$mul bool 可选 是否允许多选,默认:false

移动光标

cursorMove(方位,移动量) 方位:l:left r:right u:up, d:down

光标定位 (移动光标到指定位置)

cursorPosition(x,y) y行x列

clear

clear();//清除屏幕

wait (等待/倒计时/模拟loading 等场景)

wait(int $s 秒,string $msg 消息);

progressBar (进度条绘制)

progressBar(int $total 总量,int $current 当前量, string $msg 文本信息)


All versions of cli with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
ext-mbstring Version *
ext-iconv Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iry/cli contains the following files

Loading the files please wait ....