From 409139fabdde2dd16ef443920e670e3192581623 Mon Sep 17 00:00:00 2001 From: Melnikov Alexandr Date: Fri, 20 Oct 2017 11:21:18 +0600 Subject: [PATCH] Added context to App facade constructor --- src/Ratchet/App.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ratchet/App.php b/src/Ratchet/App.php index f1cd4dd..d3de200 100644 --- a/src/Ratchet/App.php +++ b/src/Ratchet/App.php @@ -61,8 +61,9 @@ class App { * @param int $port Port to listen on. If 80, assuming production, Flash on 843 otherwise expecting Flash to be proxied through 8843 * @param string $address IP address to bind to. Default is localhost/proxy only. '0.0.0.0' for any machine. * @param LoopInterface $loop Specific React\EventLoop to bind the application to. null will create one for you. + * @param array $context */ - public function __construct($httpHost = 'localhost', $port = 8080, $address = '127.0.0.1', LoopInterface $loop = null) { + public function __construct($httpHost = 'localhost', $port = 8080, $address = '127.0.0.1', LoopInterface $loop = null, $context = array()) { if (extension_loaded('xdebug') && getenv('RATCHET_DISABLE_XDEBUG_WARN') === false) { trigger_error('XDebug extension detected. Remember to disable this if performance testing or going live!', E_USER_WARNING); } @@ -74,7 +75,7 @@ class App { $this->httpHost = $httpHost; $this->port = $port; - $socket = new Reactor($address . ':' . $port, $loop); + $socket = new Reactor($address . ':' . $port, $loop, $context); $this->routes = new RouteCollection; $this->_server = new IoServer(new HttpServer(new Router(new UrlMatcher($this->routes, new RequestContext))), $socket, $loop);