Closed kocoten1992 closed 3 years ago
Good! There is an example to show how i can implement this on a right way?
@leocarmo you can extends it normally, it will overwrite the default command
<?php
namespace App\Console\Commands;
use SwooleTW\Http\Commands\HttpServerCommand;
class TestCommand extends HttpServerCommand
{
protected $signature = 'swoole:http {action : start|stop|restart|reload|infos}';
protected function hookAction()
{
echo 'hook between init and run';
}
}
Previously, there is no way (?) to hook up and run a script before http start.
This patch allowed user to extends our class with
hookAction
run custom script before starting server up.