<?php namespace Ratchet\Http; use Ratchet\ConnectionInterface; use GuzzleHttp\Psr7 as gPsr; use GuzzleHttp\Psr7\Response; trait CloseResponseTrait { /** * Close a connection with an HTTP response * @param \Ratchet\ConnectionInterface $conn * @param int $code HTTP status code * @return null */ private function close(ConnectionInterface $conn, $code = 400, array $additional_headers = []) { $response = new Response($code, array_merge([ 'X-Powered-By' => \Ratchet\VERSION ], $additional_headers)); $conn->send(gPsr\str($response)); $conn->close(); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
CloseResponseTrait.php | File | 659 B | 0644 |
|
HttpRequestParser.php | File | 1.78 KB | 0644 |
|
HttpServer.php | File | 1.9 KB | 0644 |
|
HttpServerInterface.php | File | 581 B | 0644 |
|
NoOpHttpServerController.php | File | 480 B | 0644 |
|
OriginCheck.php | File | 1.83 KB | 0644 |
|
Router.php | File | 2.97 KB | 0644 |
|