Download the PHP package mix/cli without Composer

On this page you can find all versions of the php package mix/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

OpenMix 出品:https://openmix.org

Mix CLI

PHP CLI Interactive Commander

PHP 命令行交互指挥官

go 版本:https://github.com/mix-go/xcli

Overview

一个命令行交互与指挥管理工具,它可以让单个 CLI 可执行多种功能,同时它还包括命令行参数获取、全局异常捕获与处理等命令行开发常用功能。

Installation

Quick start

上面是采用闭包,也可以使用对象

查看整个命令行程序的帮助

查看命令行程序的版本信息

查看 hello 命令的帮助

执行 hello 命令

Flag 参数获取

参数规则 (部分UNIX风格+GNU风格)

获取选项,可以获取 stringboolintfloat 多种类型,也可以指定默认值。

获取第一个参数

获取全部参数

Daemon 后台执行

我们可以通过配合 flag 获取参数,实现通过某几个参数控制程序后台执行。

Middleware 与 Handle exception

可以使用全局中间件给所有命令捕获异常,也可以单独对某个命令配置中间件

Application

我们在编写代码时,可能会要用到 App 中的一些信息。

Singleton 单命令

当我们的 CLI 只有一个命令时,只需要配置一下 Singleton

$cmd = new Mix\Cli\Command([
    'name' => 'hello',
    'short' => 'Echo demo', 
    'run' => function () {
        // do something
    },
    'singleton' => true,
]);

命令的 Options 将会在 -h/--help 中打印

$ php app.php
Usage: app.php [OPTIONS] COMMAND [ARG...]

Command Options:
  -n, --name    Your name

Global Options:
  -h, --help    Print usage
  -v, --version Print version information

Run 'app.php COMMAND --help' for more information on a command.

Developed with Mix PHP framework. (openmix.org/mix-php)

License

Apache License Version 2.0, http://www.apache.org/licenses/


All versions of cli with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
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 mix/cli contains the following files

Loading the files please wait ....