viloveul / console
Viloveul Console Application based on Symfony Console
v1.0.4
2019-05-29 20:09 UTC
Requires
- php: ~7.0
- symfony/console: ~3.4|~4.0
- viloveul/config: v1.*|v1.x-dev
- viloveul/container: v1.*|v1.x-dev
Requires (Dev)
- viloveul/support: v1.*|v1.x-dev
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