Download the PHP package 10quality/ayuco without Composer
On this page you can find all versions of the php package 10quality/ayuco. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 10quality/ayuco
More information about 10quality/ayuco
Files in 10quality/ayuco
Package ayuco
Short Description Command-Line interface that can be used to execute commands written in PHP.
License MIT
Homepage https://github.com/10quality/ayuco
Informations about the package ayuco
Ayuco
Command-Line interface that can be used to execute commands written in PHP.
Note: Commands included in this package (excluding help command) were written for WordPress-MVC.
Usage
Create a php file that will be called in command-line, Sample, and include the following code lines:
Create a listener:
Register your commands.
Start interpreting or listening:
Use in command line:
If filename
is named ayuco.php
and command_key
is clear_cache
, command in command-line will be:
Arguments and command options
Send arguments right after the command_key
, for example:
In the example above, cache
will be the command key and clear
will be an argument (in order, it will be $arg[2]
).
Send arguments as command options with the prefix --
, for example:
Create a custom command
Create your own class command by extending from Ayuco base command class:
Example for a clear cache command.
Registration in listener would be:
Arguments and options
For this command:
The arguments can be accessed like:
For this command:
The options can be accessed like:
Coloring output
Change the coloring of the output printed in the console using class Ayuco\Coloring
static method apply()
:
You can read more about coloring here.
Help command
AYUCO automatically will register its own help
command. This command can be used to display in command-line
the list of registered commands, use it like:
Requirements
- PHP >= 5.4
Coding guidelines
PSR-4.
LICENSE
The MIT License (MIT)
Copyright (c) 2016 10Quality.