Guzzle 3.6 conformance

Updated inheritance class to match API change
Use new Guzzle Header class when searching for values
Lock Ratchet into using Guzzle 3.6 to future-proof
This commit is contained in:
Chris Boden 2013-06-09 11:10:22 -04:00
parent b93581cdcd
commit b21b2007c5
4 changed files with 21 additions and 20 deletions

View File

@ -27,7 +27,7 @@
, "require": {
"php": ">=5.3.3"
, "react/socket": "0.2.*"
, "guzzle/http": "~3.0"
, "guzzle/http": "3.6.*"
, "symfony/http-foundation": "~2.1"
}
}

30
composer.lock generated
View File

@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "9ccce99ef687cb79dad8a4c581f38cc5",
"hash": "b5fee3d5d9c4f60b01030a234d8673f5",
"packages": [
{
"name": "evenement/evenement",
@ -375,17 +375,17 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v2.2.1",
"version": "v2.3.0",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
"reference": "v2.2.1"
"reference": "v2.3.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.2.1",
"reference": "v2.2.1",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.3.0-RC1",
"reference": "v2.3.0-RC1",
"shasum": ""
},
"require": {
@ -395,13 +395,13 @@
"symfony/dependency-injection": ">=2.0,<3.0"
},
"suggest": {
"symfony/dependency-injection": "2.2.*",
"symfony/http-kernel": "2.2.*"
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
"dev-master": "2.3-dev"
}
},
"autoload": {
@ -425,21 +425,21 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
"time": "2013-02-11 11:26:43"
"time": "2013-05-13 14:36:40"
},
{
"name": "symfony/http-foundation",
"version": "v2.2.1",
"version": "v2.3.0",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
"reference": "v2.2.1"
"reference": "v2.3.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.2.1",
"reference": "v2.2.1",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.3.0-RC1",
"reference": "v2.3.0-RC1",
"shasum": ""
},
"require": {
@ -448,7 +448,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
"dev-master": "2.3-dev"
}
},
"autoload": {
@ -475,7 +475,7 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com",
"time": "2013-04-06 10:15:43"
"time": "2013-05-10 06:00:03"
}
],
"packages-dev": [

View File

@ -7,7 +7,7 @@ class RequestFactory extends GuzzleRequestFactory {
/**
* {@inheritdoc}
*/
public function create($method, $url, $headers = null, $body = '') {
public function create($method, $url, $headers = null, $body = '', array $options = array()) {
$c = $this->entityEnclosingRequestClass;
$request = new $c($method, $url, $headers);
$request->setBody(EntityBody::factory($body));

View File

@ -117,10 +117,11 @@ class WsServer implements MessageComponentInterface {
return;
}
// This needs to be refactored later on, incorporated with routing
if ('' !== ($agreedSubProtocols = $this->getSubProtocolString($from->WebSocket->request->getTokenizedHeader('Sec-WebSocket-Protocol', ',')))) {
if (null !== ($subHeader = $from->WebSocket->request->getHeader('Sec-WebSocket-Protocol'))) {
if ('' !== ($agreedSubProtocols = $this->getSubProtocolString($subHeader->normalize()))) {
$response->setHeader('Sec-WebSocket-Protocol', $agreedSubProtocols);
}
}
$response->setHeader('X-Powered-By', \Ratchet\VERSION);
$from->send((string)$response);