This commit is contained in:
2021-11-19 14:46:07 +08:00
parent 065555a80e
commit 39394f76d5
2 changed files with 15 additions and 4 deletions
+8
View File
@@ -0,0 +1,8 @@
<?php
namespace Server\Events;
class OnServerBeforeStart
{
}
+7 -4
View File
@@ -7,9 +7,10 @@ namespace Server;
use Annotation\Inject;
use Exception;
use Kiri\Abstracts\Config;
use Kiri\Events\EventProvider;
use Kiri\Events\EventDispatch;
use Kiri\Exception\ConfigException;
use Kiri\Kiri;
use Server\Events\OnServerBeforeStart;
use Swoole\Coroutine;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -29,10 +30,10 @@ class ServerCommand extends Command
/**
* @var EventProvider
* @var EventDispatch
*/
#[Inject(EventProvider::class)]
public EventProvider $eventProvider;
#[Inject(EventDispatch::class)]
public EventDispatch $eventProvider;
/**
@@ -105,6 +106,8 @@ class ServerCommand extends Command
Kiri::app()->getRouter()->read_files();
$this->eventProvider->dispatch(new OnServerBeforeStart());
$manager->start();
return 1;