mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
Fix type convert error
This commit is contained in:
@@ -33,7 +33,7 @@ class ServerStopCommand extends DaemonCommand
|
||||
$name = explode('.', $file);
|
||||
if (end($name) == 'pid') {
|
||||
$pid = file_get_contents($file_path . '/' . $file);
|
||||
Process::kill($pid, SIGKILL);
|
||||
Process::kill((int) $pid, SIGKILL);
|
||||
} elseif ($file === 'master.json') {
|
||||
$json = json_decode(file_get_contents($file_path . '/' . $file), true);
|
||||
Process::kill($json['pid'], SIGKILL);
|
||||
|
||||
@@ -31,11 +31,8 @@ class OnMessage implements SwooleEvent
|
||||
$conn = ManagerGM::get($frame->fd);
|
||||
set_coroutine_params(['server' => $server, 'frame' => $frame, 'connection' => $conn]);
|
||||
$dispatcher1 = new EventDispatcher(OnMessageEvent::class);
|
||||
$dispatcher1->setRuleFunction(function ($v) {
|
||||
if ($v->getRule() == '') {
|
||||
return true;
|
||||
}
|
||||
return eval('return ' . $v->getRule() . ';');
|
||||
$dispatcher1->setRuleFunction(function ($v) use ($conn) {
|
||||
return $v->connect_type === $conn->getName() && ($v->getRule() === '' || eval('return ' . $v->getRule() . ';'));
|
||||
});
|
||||
|
||||
$dispatcher = new EventDispatcher(OnSwooleEvent::class);
|
||||
|
||||
@@ -95,7 +95,7 @@ class SignalListener
|
||||
$name = explode('.', $file);
|
||||
if (end($name) == 'pid' && $name[0] !== 'manager') {
|
||||
$pid = file_get_contents($file_path . '/' . $file);
|
||||
Process::kill($pid, SIGKILL);
|
||||
Process::kill((int) $pid, SIGKILL);
|
||||
}
|
||||
unlink($file_path . '/' . $file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user