viloveul/console

Viloveul Console Application based on Symfony Console

v1.0.4 2019-05-29 20:09 UTC

This package is auto-updated.

Last update: 2024-04-09 04:27:33 UTC


README

make sure your php version > 7.0

composer require viloveul/console

HOW

require __DIR__ . '/vendor/autoload.php';

class MyCommand extends Viloveul\Console\Command
{
    public function handle()
    {
        $this->writeNormal('Hello World');
        $this->writeInfo('Hello World');
        $this->writeError('Hello World');
        $this->writeQuestion('Hello World');
        $this->writeComment('Hello World');
    }
}

$console = new Viloveul\Console\Console();
$console->boot();

// add command
$cmd = new MyCommand("hello");
$console->add($cmd);

// run
$console->run();

then

$ php your-file hello