2017 © Pedro Peláez
 

library ayuco

Command-Line interface that can be used to execute commands written in PHP.

image

10quality/ayuco

Command-Line interface that can be used to execute commands written in PHP.

  • Saturday, May 14, 2016
  • by amostajo
  • Repository
  • 2 Watchers
  • 0 Stars
  • 188 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

Ayuco

Command-line interface for the Wordpress-MVC framework., (*1)

Ayuco works outside this framework aswell, and can be used to execute command written in PHP., (*2)

Usage

use Ayuco\Listener;

Create a listener variable:, (*3)

$ayuco = new Listener();

// or without initial use
$ayuco = new Ayuco\Listener()

Register your commands., (*4)

$ayuco->register($command1)
    ->register($command2);

Start interpreting or listening:, (*5)

$ayuco->interpret();

Use in command line:, (*6)

php filename command_key arguments

If filename is ayuco.php and command_key is clear_cache, command will be:, (*7)

php ayuco.php clear_cache

Create a custom command

Create your own class command by extending from Ayuco base command class:, (*8)

use Ayuco\Command;

class MyCommand extends Command
{
    protected $key = 'command_key';

    public function call($args = [])
    {
        // TODO command action.
    }
}

Example for a clear cache command., (*9)

use Ayuco\Command;

class ClearCacheCommand extends Command
{
    protected $key = 'clear_cache';

    public function call($args = [])
    {
        Cache::flush(); // Example
    }
}

Registration in listener would be:, (*10)

$ayuco->register(new ClearCacheCommand);

Requirements

  • PHP >= 5.4

Coding guidelines

PSR-4., (*11)

LICENSE

The MIT License (MIT), (*12)

Copyright (c) 2016 10Quality - http://www.10quality.com, (*13)

The Versions

14/05 2016

v1.0.x-dev

1.0.9999999.9999999-dev https://github.com/10quality/ayuco

Command-Line interface that can be used to execute commands written in PHP.

  Sources   Download

MIT

The Development Requires

php commands command-line

12/05 2016

dev-master

9999999-dev https://github.com/10quality/ayuco

Command-line interface for the Wordpress-MVC framework.

  Sources   Download

MIT

The Development Requires

php commands command-line

12/05 2016

v1.0.0

1.0.0.0 https://github.com/10quality/ayuco

Command-line interface for the Wordpress-MVC framework.

  Sources   Download

MIT

The Development Requires

php commands command-line