改名
This commit is contained in:
@@ -270,7 +270,6 @@ class ServerManager
|
|||||||
* @param int $port
|
* @param int $port
|
||||||
* @param int $mode
|
* @param int $mode
|
||||||
* @param array $settings
|
* @param array $settings
|
||||||
* @throws NotFindClassException
|
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
*/
|
*/
|
||||||
@@ -300,7 +299,7 @@ class ServerManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while ($this->checkPortIsAlready($port)) {
|
while ($this->checkPortIsAlready($port)) {
|
||||||
Process::kill($pid,SIGTERM);
|
Process::kill($pid, SIGTERM);
|
||||||
usleep(300);
|
usleep(300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,7 +328,6 @@ class ServerManager
|
|||||||
/**
|
/**
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @param array $settings
|
* @param array $settings
|
||||||
* @throws NotFindClassException
|
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@@ -339,13 +337,14 @@ class ServerManager
|
|||||||
$this->addTaskListener($settings['events']);
|
$this->addTaskListener($settings['events']);
|
||||||
}
|
}
|
||||||
$this->addServiceEvents($settings['events'] ?? [], $this->server);
|
$this->addServiceEvents($settings['events'] ?? [], $this->server);
|
||||||
|
Kiri::getDi()->setBindings(SwooleServerInterface::class,
|
||||||
|
$this->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $events
|
* @param array $events
|
||||||
* @param Server|Port $server
|
* @param Server|Port $server
|
||||||
* @throws NotFindClassException
|
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
*/
|
*/
|
||||||
private function addServiceEvents(array $events, Server|Port $server)
|
private function addServiceEvents(array $events, Server|Port $server)
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Server;
|
||||||
|
|
||||||
|
|
||||||
|
use Swoole\Server;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin Server
|
||||||
|
*/
|
||||||
|
interface SwooleServerInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -201,10 +201,6 @@ class Container extends BaseObject implements ContainerInterface
|
|||||||
foreach ($this->getPropertyNote($reflect) as $property => $inject) {
|
foreach ($this->getPropertyNote($reflect) as $property => $inject) {
|
||||||
/** @var Inject $inject */
|
/** @var Inject $inject */
|
||||||
$inject->execute($object, $property);
|
$inject->execute($object, $property);
|
||||||
|
|
||||||
if ($object::class == Server::class){
|
|
||||||
var_dump($object, $property);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user