From c47d040a63bb09a05817479fac6272fe7fcc58ae Mon Sep 17 00:00:00 2001 From: Michael Crumm Date: Sat, 12 Mar 2016 13:57:50 -0800 Subject: [PATCH] Use ratchet/pawl^0.2 --- composer.json | 2 +- composer.lock | 1140 +++++++++++++++++++++------------------- src/RealTimeClient.php | 14 +- 3 files changed, 600 insertions(+), 556 deletions(-) diff --git a/composer.json b/composer.json index fbb60e8..8e091e6 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ }], "require": { "php": ">=5.5", - "ratchet/pawl": "^0.1", + "ratchet/pawl": "^0.2", "evenement/evenement": "2.0.*", "guzzlehttp/guzzle": "~6.0", "react/event-loop": "^0.4.1", diff --git a/composer.lock b/composer.lock index 57f95a7..e132bd4 100644 --- a/composer.lock +++ b/composer.lock @@ -1,59 +1,12 @@ { "_readme": [ "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", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d1c41343afefe04adc5761bfb1416a1c", + "hash": "a526a0fa1c0a3affd286c9f6147778b4", + "content-hash": "f25700093a1296a0318daeac496df748", "packages": [ - { - "name": "cboden/ratchet", - "version": "v0.3.3", - "source": { - "type": "git", - "url": "https://github.com/ratchetphp/Ratchet.git", - "reference": "6b247c05251b4b5cbd14243366b649f99a0e5681" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/6b247c05251b4b5cbd14243366b649f99a0e5681", - "reference": "6b247c05251b4b5cbd14243366b649f99a0e5681", - "shasum": "" - }, - "require": { - "guzzle/http": "^3.6", - "php": ">=5.3.9", - "react/socket": "^0.3 || ^0.4", - "symfony/http-foundation": "^2.2", - "symfony/routing": "^2.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Ratchet\\": "src/Ratchet" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "role": "Developer" - } - ], - "description": "PHP WebSocket library", - "homepage": "http://socketo.me", - "keywords": [ - "Ratchet", - "WebSockets", - "server", - "sockets" - ], - "time": "2015-05-27 12:51:05" - }, { "name": "evenement/evenement", "version": "v2.0.0", @@ -100,208 +53,6 @@ ], "time": "2012-11-02 14:49:47" }, - { - "name": "guzzle/common", - "version": "v3.9.2", - "target-dir": "Guzzle/Common", - "source": { - "type": "git", - "url": "https://github.com/Guzzle3/common.git", - "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", - "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", - "shasum": "" - }, - "require": { - "php": ">=5.3.2", - "symfony/event-dispatcher": ">=2.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.7-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle\\Common": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Common libraries used by Guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "collection", - "common", - "event", - "exception" - ], - "abandoned": "guzzle/guzzle", - "time": "2014-08-11 04:32:36" - }, - { - "name": "guzzle/http", - "version": "v3.9.2", - "target-dir": "Guzzle/Http", - "source": { - "type": "git", - "url": "https://github.com/Guzzle3/http.git", - "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", - "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", - "shasum": "" - }, - "require": { - "guzzle/common": "self.version", - "guzzle/parser": "self.version", - "guzzle/stream": "self.version", - "php": ">=5.3.2" - }, - "suggest": { - "ext-curl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.7-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle\\Http": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "HTTP libraries used by Guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "client", - "curl", - "http", - "http client" - ], - "abandoned": "guzzle/guzzle", - "time": "2014-08-11 04:32:36" - }, - { - "name": "guzzle/parser", - "version": "v3.9.2", - "target-dir": "Guzzle/Parser", - "source": { - "type": "git", - "url": "https://github.com/Guzzle3/parser.git", - "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", - "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.7-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle\\Parser": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Interchangeable parsers used by Guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "URI Template", - "cookie", - "http", - "message", - "url" - ], - "abandoned": "guzzle/guzzle", - "time": "2014-02-05 18:29:46" - }, - { - "name": "guzzle/stream", - "version": "v3.9.2", - "target-dir": "Guzzle/Stream", - "source": { - "type": "git", - "url": "https://github.com/Guzzle3/stream.git", - "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", - "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0", - "shasum": "" - }, - "require": { - "guzzle/common": "self.version", - "php": ">=5.3.2" - }, - "suggest": { - "guzzle/http": "To convert Guzzle request objects to PHP streams" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.7-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle\\Stream": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle stream wrapper component", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "component", - "stream" - ], - "abandoned": "guzzle/guzzle", - "time": "2014-05-01 21:36:02" - }, { "name": "guzzlehttp/guzzle", "version": "6.1.1", @@ -417,16 +168,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" + "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b", + "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b", "shasum": "" }, "require": { @@ -471,7 +222,7 @@ "stream", "uri" ], - "time": "2015-11-03 01:34:55" + "time": "2016-02-18 21:54:00" }, { "name": "psr/http-message", @@ -524,21 +275,21 @@ }, { "name": "ratchet/pawl", - "version": "v0.1.2", + "version": "v0.2", "source": { "type": "git", "url": "https://github.com/ratchetphp/Pawl.git", - "reference": "b58948f6244e07bfcc8c8b824862ce41b1dad0d3" + "reference": "dc795c67b48b6f6dd779288d69a042d722349b0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ratchetphp/Pawl/zipball/b58948f6244e07bfcc8c8b824862ce41b1dad0d3", - "reference": "b58948f6244e07bfcc8c8b824862ce41b1dad0d3", + "url": "https://api.github.com/repos/ratchetphp/Pawl/zipball/dc795c67b48b6f6dd779288d69a042d722349b0b", + "reference": "dc795c67b48b6f6dd779288d69a042d722349b0b", "shasum": "" }, "require": { - "cboden/ratchet": "0.3.*", "php": ">=5.4", + "ratchet/rfc6455": "0.2.*", "react/socket-client": "0.4.*" }, "type": "library", @@ -558,35 +309,78 @@ "client", "websocket" ], - "time": "2014-11-09 20:47:17" + "time": "2016-03-12 01:36:25" }, { - "name": "react/cache", - "version": "v0.4.0", + "name": "ratchet/rfc6455", + "version": "v0.2", "source": { "type": "git", - "url": "https://github.com/reactphp/cache.git", - "reference": "9882ab5d8b00617baae83c6996f5a34668c11beb" + "url": "https://github.com/ratchetphp/RFC6455.git", + "reference": "cbd376e1b3d332466d8d5158abd5030e2a023089" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/9882ab5d8b00617baae83c6996f5a34668c11beb", - "reference": "9882ab5d8b00617baae83c6996f5a34668c11beb", + "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/cbd376e1b3d332466d8d5158abd5030e2a023089", + "reference": "cbd376e1b3d332466d8d5158abd5030e2a023089", "shasum": "" }, "require": { - "php": ">=5.4.0", - "react/promise": "~2.0" + "guzzlehttp/psr7": "^1.0", + "php": ">=5.4.2" + }, + "require-dev": { + "react/http": "^0.4.1", + "react/socket-client": "^0.4.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" + "autoload": { + "psr-4": { + "Ratchet\\RFC6455\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" + } + ], + "description": "RFC6455 WebSocket protocol handler", + "homepage": "http://socketo.me", + "keywords": [ + "WebSockets", + "rfc6455", + "websocket" + ], + "time": "2016-02-20 21:26:08" + }, + { + "name": "react/cache", + "version": "v0.4.1", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "558f614891341b1d817a8cdf9a358948ec49638f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/558f614891341b1d817a8cdf9a358948ec49638f", + "reference": "558f614891341b1d817a8cdf9a358948ec49638f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "~2.0|~1.1" + }, + "type": "library", "autoload": { "psr-4": { - "React\\Cache\\": "" + "React\\Cache\\": "src\\" } }, "notification-url": "https://packagist.org/downloads/", @@ -597,27 +391,27 @@ "keywords": [ "cache" ], - "time": "2014-02-02 01:11:26" + "time": "2016-02-25 18:17:16" }, { "name": "react/dns", - "version": "v0.4.1", + "version": "v0.4.2", "source": { "type": "git", "url": "https://github.com/reactphp/dns.git", - "reference": "8c5ccc35dcb4b06b70eb9201842363fac7b0f3cf" + "reference": "62f6201e487df8add209cc42f05ffca33ee1ba05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/8c5ccc35dcb4b06b70eb9201842363fac7b0f3cf", - "reference": "8c5ccc35dcb4b06b70eb9201842363fac7b0f3cf", + "url": "https://api.github.com/repos/reactphp/dns/zipball/62f6201e487df8add209cc42f05ffca33ee1ba05", + "reference": "62f6201e487df8add209cc42f05ffca33ee1ba05", "shasum": "" }, "require": { - "php": ">=5.4.0", - "react/cache": "0.4.*", - "react/promise": "~2.0", - "react/socket": "0.4.*" + "php": ">=5.3.0", + "react/cache": "~0.4.0|~0.3.0", + "react/promise": "~2.0|~1.1", + "react/socket": "~0.4.0|~0.3.0" }, "type": "library", "extra": { @@ -627,7 +421,7 @@ }, "autoload": { "psr-4": { - "React\\Dns\\": "" + "React\\Dns\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -639,7 +433,7 @@ "dns", "dns-resolver" ], - "time": "2014-04-12 14:09:10" + "time": "2016-02-24 23:45:36" }, { "name": "react/event-loop", @@ -730,23 +524,23 @@ }, { "name": "react/socket", - "version": "v0.4.2", + "version": "v0.4.3", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "a6acf405ca53fc6cfbfe7c77778ededff46aa7cc" + "reference": "ce015ec5879b96f5d30905f035f223aa85013fcc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/a6acf405ca53fc6cfbfe7c77778ededff46aa7cc", - "reference": "a6acf405ca53fc6cfbfe7c77778ededff46aa7cc", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ce015ec5879b96f5d30905f035f223aa85013fcc", + "reference": "ce015ec5879b96f5d30905f035f223aa85013fcc", "shasum": "" }, "require": { - "evenement/evenement": "~2.0", - "php": ">=5.4.0", - "react/event-loop": "0.4.*", - "react/stream": "0.4.*" + "evenement/evenement": "~2.0|~1.0", + "php": ">=5.3.0", + "react/event-loop": "0.4.*|0.3.*", + "react/stream": "0.4.*|0.3.*" }, "type": "library", "extra": { @@ -767,7 +561,7 @@ "keywords": [ "Socket" ], - "time": "2014-05-25 17:02:16" + "time": "2016-03-01 20:10:35" }, { "name": "react/socket-client", @@ -852,257 +646,12 @@ "license": [ "MIT" ], - "description": "Basic readable and writable stream interfaces that support piping.", - "keywords": [ - "pipe", - "stream" - ], - "time": "2015-10-07 18:32:58" - }, - { - "name": "symfony/event-dispatcher", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d36355e026905fa5229e1ed7b4e9eda2e67adfcf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d36355e026905fa5229e1ed7b4e9eda2e67adfcf", - "reference": "d36355e026905fa5229e1ed7b4e9eda2e67adfcf", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 23:35:59" - }, - { - "name": "symfony/http-foundation", - "version": "v2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "5ed0ec39ef684bec84d1fd9f2a55104e403b7e49" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5ed0ec39ef684bec84d1fd9f2a55104e403b7e49", - "reference": "5ed0ec39ef684bec84d1fd9f2a55104e403b7e49", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-php54": "~1.0" - }, - "require-dev": { - "symfony/expression-language": "~2.4|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com", - "time": "2015-11-27 11:03:19" - }, - { - "name": "symfony/polyfill-php54", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc", - "reference": "2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php54\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2015-11-04 20:28:58" - }, - { - "name": "symfony/routing", - "version": "v2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "f76830dc0f8068df36226dc822e7fc1f5f73be46" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/f76830dc0f8068df36226dc822e7fc1f5f73be46", - "reference": "f76830dc0f8068df36226dc822e7fc1f5f73be46", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", - "psr/log": "~1.0", - "symfony/config": "~2.7|~3.0.0", - "symfony/expression-language": "~2.4|~3.0.0", - "symfony/http-foundation": "~2.3|~3.0.0", - "symfony/yaml": "~2.0,>=2.0.5|~3.0.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", - "symfony/expression-language": "For using expression matching", - "symfony/yaml": "For using the YAML loader" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Routing\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Routing Component", - "homepage": "https://symfony.com", + "description": "Basic readable and writable stream interfaces that support piping.", "keywords": [ - "router", - "routing", - "uri", - "url" + "pipe", + "stream" ], - "time": "2015-11-26 07:00:59" + "time": "2015-10-07 18:32:58" } ], "packages-dev": [ @@ -1327,6 +876,54 @@ "homepage": "http://apigen.org/", "time": "2015-10-11 14:55:30" }, + { + "name": "cboden/ratchet", + "version": "v0.3.3", + "source": { + "type": "git", + "url": "https://github.com/ratchetphp/Ratchet.git", + "reference": "6b247c05251b4b5cbd14243366b649f99a0e5681" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/6b247c05251b4b5cbd14243366b649f99a0e5681", + "reference": "6b247c05251b4b5cbd14243366b649f99a0e5681", + "shasum": "" + }, + "require": { + "guzzle/http": "^3.6", + "php": ">=5.3.9", + "react/socket": "^0.3 || ^0.4", + "symfony/http-foundation": "^2.2", + "symfony/routing": "^2.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ratchet\\": "src/Ratchet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" + } + ], + "description": "PHP WebSocket library", + "homepage": "http://socketo.me", + "keywords": [ + "Ratchet", + "WebSockets", + "server", + "sockets" + ], + "time": "2015-05-27 12:51:05" + }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -1427,11 +1024,213 @@ ], "description": "Faker is a PHP library that generates fake data for you.", "keywords": [ - "data", - "faker", - "fixtures" + "data", + "faker", + "fixtures" + ], + "time": "2015-05-29 06:29:14" + }, + { + "name": "guzzle/common", + "version": "v3.9.2", + "target-dir": "Guzzle/Common", + "source": { + "type": "git", + "url": "https://github.com/Guzzle3/common.git", + "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", + "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/event-dispatcher": ">=2.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Common": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Common libraries used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "collection", + "common", + "event", + "exception" + ], + "abandoned": "guzzle/guzzle", + "time": "2014-08-11 04:32:36" + }, + { + "name": "guzzle/http", + "version": "v3.9.2", + "target-dir": "Guzzle/Http", + "source": { + "type": "git", + "url": "https://github.com/Guzzle3/http.git", + "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", + "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", + "shasum": "" + }, + "require": { + "guzzle/common": "self.version", + "guzzle/parser": "self.version", + "guzzle/stream": "self.version", + "php": ">=5.3.2" + }, + "suggest": { + "ext-curl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Http": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "HTTP libraries used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "client", + "curl", + "http", + "http client" + ], + "abandoned": "guzzle/guzzle", + "time": "2014-08-11 04:32:36" + }, + { + "name": "guzzle/parser", + "version": "v3.9.2", + "target-dir": "Guzzle/Parser", + "source": { + "type": "git", + "url": "https://github.com/Guzzle3/parser.git", + "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", + "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Parser": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Interchangeable parsers used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "URI Template", + "cookie", + "http", + "message", + "url" + ], + "abandoned": "guzzle/guzzle", + "time": "2014-02-05 18:29:46" + }, + { + "name": "guzzle/stream", + "version": "v3.9.2", + "target-dir": "Guzzle/Stream", + "source": { + "type": "git", + "url": "https://github.com/Guzzle3/stream.git", + "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", + "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0", + "shasum": "" + }, + "require": { + "guzzle/common": "self.version", + "php": ">=5.3.2" + }, + "suggest": { + "guzzle/http": "To convert Guzzle request objects to PHP streams" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Stream": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle stream wrapper component", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "component", + "stream" ], - "time": "2015-05-29 06:29:14" + "abandoned": "guzzle/guzzle", + "time": "2014-05-01 21:36:02" }, { "name": "herrera-io/json", @@ -3662,6 +3461,119 @@ "homepage": "https://symfony.com", "time": "2015-11-30 12:35:10" }, + { + "name": "symfony/event-dispatcher", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "d36355e026905fa5229e1ed7b4e9eda2e67adfcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d36355e026905fa5229e1ed7b4e9eda2e67adfcf", + "reference": "d36355e026905fa5229e1ed7b4e9eda2e67adfcf", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 23:35:59" + }, + { + "name": "symfony/http-foundation", + "version": "v2.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "5ed0ec39ef684bec84d1fd9f2a55104e403b7e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5ed0ec39ef684bec84d1fd9f2a55104e403b7e49", + "reference": "5ed0ec39ef684bec84d1fd9f2a55104e403b7e49", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-php54": "~1.0" + }, + "require-dev": { + "symfony/expression-language": "~2.4|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2015-11-27 11:03:19" + }, { "name": "symfony/options-resolver", "version": "v2.6.12", @@ -3773,6 +3685,138 @@ ], "time": "2015-11-04 20:28:58" }, + { + "name": "symfony/polyfill-php54", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php54.git", + "reference": "2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc", + "reference": "2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php54\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2015-11-04 20:28:58" + }, + { + "name": "symfony/routing", + "version": "v2.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "f76830dc0f8068df36226dc822e7fc1f5f73be46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/f76830dc0f8068df36226dc822e7fc1f5f73be46", + "reference": "f76830dc0f8068df36226dc822e7fc1f5f73be46", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/common": "~2.2", + "psr/log": "~1.0", + "symfony/config": "~2.7|~3.0.0", + "symfony/expression-language": "~2.4|~3.0.0", + "symfony/http-foundation": "~2.3|~3.0.0", + "symfony/yaml": "~2.0,>=2.0.5|~3.0.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/dependency-injection": "For loading routes from a service", + "symfony/expression-language": "For using expression matching", + "symfony/yaml": "For using the YAML loader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "time": "2015-11-26 07:00:59" + }, { "name": "symfony/yaml", "version": "v2.8.0", diff --git a/src/RealTimeClient.php b/src/RealTimeClient.php index 1c41526..0e5ee7d 100644 --- a/src/RealTimeClient.php +++ b/src/RealTimeClient.php @@ -3,7 +3,7 @@ use Evenement\EventEmitterTrait; use GuzzleHttp; -use Ratchet\Client\Factory as WebSocketFactory; +use Ratchet\Client\Connector; use Ratchet\Client\WebSocket; use React\EventLoop\LoopInterface; use React\Promise; @@ -17,9 +17,9 @@ class RealTimeClient extends ApiClient use EventEmitterTrait; /** - * @var WebSocketFactory Factory to create WebSocket connections. + * @var Connector Factory to create WebSocket connections. */ - protected $wsFactory; + protected $connector; /** * @var WebSocket A websocket connection to the Slack API. @@ -72,16 +72,16 @@ class RealTimeClient extends ApiClient * * @param LoopInterface $loop Event Loop. * @param GuzzleHttp\ClientInterface $httpClient Guzzle HTTP Client. - * @param WebSocketFactory $wsFactory WebSocketFactory to connect to Slack RTM. + * @param Connector $connector Connects to Slack RTM. */ public function __construct( LoopInterface $loop, GuzzleHttp\ClientInterface $httpClient = null, - WebSocketFactory $wsFactory = null + Connector $connector = null ) { parent::__construct($loop, $httpClient); - $this->wsFactory = $wsFactory ?: new WebSocketFactory($loop); + $this->connector = $connector ?: new Connector($loop); } /** @@ -293,7 +293,7 @@ public function postMessage(Message $message) */ private function newWebSocket($url) { - return $this->wsFactory->__invoke($url)->then(function (WebSocket $socket) { + return $this->connector->__invoke($url)->then(function (WebSocket $socket) { $socket->on('message', function ($data) { // parse the message and get the event name $this->onMessage(Payload::fromJson($data));