改名
This commit is contained in:
+13
-5
@@ -2,15 +2,16 @@
|
||||
|
||||
namespace Server;
|
||||
|
||||
use Note\Inject;
|
||||
use Exception;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Di\Container;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Kiri\Error\Logger;
|
||||
use Kiri\Events\EventDispatch;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Kiri;
|
||||
use Note\Inject;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use ReflectionException;
|
||||
use Server\Abstracts\BaseProcess;
|
||||
@@ -22,13 +23,13 @@ use Server\Contract\OnMessageInterface;
|
||||
use Server\Contract\OnPacketInterface;
|
||||
use Server\Contract\OnProcessInterface;
|
||||
use Server\Contract\OnReceiveInterface;
|
||||
use Server\Contract\OnTaskInterface;
|
||||
use Server\Events\OnServerBeforeStart;
|
||||
use Server\Handler\OnPipeMessage;
|
||||
use Server\Handler\OnServer;
|
||||
use Server\Handler\OnServerManager;
|
||||
use Server\Handler\OnServerReload;
|
||||
use Server\Tasker\OnServerTask;
|
||||
use Server\Handler\OnServerWorker;
|
||||
use Server\Tasker\OnServerTask;
|
||||
use Swoole\Http\Server as HServer;
|
||||
use Swoole\Process;
|
||||
use Swoole\Server;
|
||||
@@ -59,6 +60,13 @@ class ServerManager
|
||||
public Logger $logger;
|
||||
|
||||
|
||||
/**
|
||||
* @var EventDispatch
|
||||
*/
|
||||
#[Inject(EventDispatch::class)]
|
||||
public EventDispatch $eventProvider;
|
||||
|
||||
|
||||
/**
|
||||
* @var State
|
||||
*/
|
||||
@@ -66,7 +74,6 @@ class ServerManager
|
||||
public State $state;
|
||||
|
||||
|
||||
|
||||
/** @var array<string,Port> */
|
||||
public array $ports = [];
|
||||
|
||||
@@ -114,6 +121,7 @@ class ServerManager
|
||||
*/
|
||||
public function getServer(): Server|WServer|HServer|null
|
||||
{
|
||||
$this->eventProvider->dispatch(new OnServerBeforeStart());
|
||||
return $this->server;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user