改名
This commit is contained in:
@@ -58,7 +58,7 @@ class OnClose extends Callback
|
|||||||
}
|
}
|
||||||
$node = $router->search('/' . Socket::CLOSE . '::event', 'sw::socket');
|
$node = $router->search('/' . Socket::CLOSE . '::event', 'sw::socket');
|
||||||
if ($node instanceof Node) {
|
if ($node instanceof Node) {
|
||||||
$node->dispatch();
|
$node->dispatch($server, $fd);
|
||||||
}
|
}
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
$this->addError($exception);
|
$this->addError($exception);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class OnHandshake extends Callback
|
|||||||
if ($node === null) {
|
if ($node === null) {
|
||||||
return $this->disconnect($response, 502);
|
return $this->disconnect($response, 502);
|
||||||
}
|
}
|
||||||
return $node->dispatch();
|
return $node->dispatch($request, $response);
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
$this->addError($exception->getMessage());
|
$this->addError($exception->getMessage());
|
||||||
return $this->disconnect($response, 500);
|
return $this->disconnect($response, 500);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class OnMessage extends Callback
|
|||||||
if ($node === null) {
|
if ($node === null) {
|
||||||
throw new Exception('Page not found.');
|
throw new Exception('Page not found.');
|
||||||
}
|
}
|
||||||
return $node->dispatch();
|
return $node->dispatch($server, $frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,7 +425,12 @@ class Node extends Application
|
|||||||
if (empty($this->callback)) {
|
if (empty($this->callback)) {
|
||||||
return JSON::to(404, $node->_error ?? 'Page not found.');
|
return JSON::to(404, $node->_error ?? 'Page not found.');
|
||||||
}
|
}
|
||||||
return call_user_func($this->callback, \request());
|
$requestParams = func_get_args();
|
||||||
|
if (func_num_args() > 0) {
|
||||||
|
return call_user_func($this->callback, ...$requestParams);
|
||||||
|
} else {
|
||||||
|
return call_user_func($this->callback, \request());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user