diversen/cli-framework

This package is abandoned and no longer maintained. No replacement package was suggested.

A simple CLI framework built around pear-commandline

1.3.28 2016-07-22 10:29 UTC

This package is auto-updated.

Last update: 2021-07-20 10:08:32 UTC


README

A simple CLI framework built with PEAR console_commandline and PEAR console_color.

Install

You will need to have the PEAR repositories enabled in your base composer.json file:

    "repositories": [
        {
            "type": "pear",
            "url": "https://pear.php.net"
        }

    ],

composer require diversen/cli-framework

Example:

There is a simple example. You can test it by creating a file called example, and add the following piece of code.

#!/usr/bin/env php
<?php

include_once "vendor/autoload.php";

use diversen\cli\example;

example::init();
example::run();

Run the example:

chmod +x example
./example 

The example class can found be found in src/cli/example.php

The example class loads all commands found in the folder src/cli/example

There is only one base command, with two sub-commands, and it can take one optional argument. This looks like this: src/cli/commands/miau.php