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
Requires
- php: >=5.3.0
- diversen/simple-php-classes: ^1.4
- pear-pear.php.net/console_color: ^1.0
- pear-pear.php.net/console_commandline: ^1.2
- pear-pear.php.net/pear: ^1.10
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