1. Go to this page and download the library: Download 10quality/ayuco library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
10quality / ayuco example snippets
use Ayuco\Listener;
$ayuco = new Listener();
// or without use
$ayuco = new Ayuco\Listener()
use Ayuco\Command;
class MyCommand extends Command
{
protected $key = 'command_key';
protected $description = 'My command description.';
public function call($args = [])
{
// TODO command action.
}
}
use Ayuco\Command;
class ClearCacheCommand extends Command
{
protected $key = 'clear_cache';
protected $description = 'Clears system cache.';
public function call($args = [])
{
Cache::flush(); // Example
}
}
$ayuco->register(new ClearCacheCommand);
use Ayuco\Command;
class CacheCommand extends Command
{
protected $key = 'cache';
public function call($args = [])
{
// ayuco.php
$args[0];
// cache
$args[1];
// clear
$args[2];
}
}
use Ayuco\Command;
class CacheCommand extends Command
{
protected $key = 'cache';
public function call($args = [])
{
// ayuco.php
$args[0];
// cache
$args[1];
// clear
$args[2];
// --debug
$this->options['debug'];
// --note="..."
$this->options['note'];
}
}
use Ayuco\Coloring;
use Ayuco\Command;
class ColoringCommand extends Command
{
public function call($args = [])
{
$this->_print(Coloring::apply('red', 'Print this message in red.'));
}
}