From 710ec2535f5df1ed81d2dcf3b216190a4cb2f3c1 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Thu, 10 May 2012 23:14:59 -0400 Subject: [PATCH] [WAMP][BCB] Subscribe protocol compliance --- README.md | 10 +++++----- src/Ratchet/Wamp/WampServer.php | 6 ++++-- src/Ratchet/Wamp/WampServerInterface.php | 2 +- tests/Ratchet/Tests/Mock/WampComponent.php | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8412356..7998e62 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ #Ratchet -A PHP 5.3 (PSR-0) component library for serving sockets and building socket based applications. +A PHP 5.3 (PSR-0) library for serving WebSockets and building socket based applications. Build up your application through simple interfaces and re-use your application without changing any of its code just by combining different components. ##WebSockets -* Supports the RFC6455, HyBi-10, and Hixie76 protocol versions (at the same time) -* Tested on Chrome 18 - 16, Firefox 6 - 8, Safari 5, iOS 4.2, iOS 5 +* Supports the RFC6455, HyBi-10+, and Hixie76 protocol versions (at the same time) +* Tested on Chrome 18 - 16, Firefox 6 - 9, Safari 5, iOS 4.2, iOS 5 ##Requirements @@ -31,7 +31,7 @@ See https://github.com/cboden/Ratchet-examples for some out-of-the-box working d ```php WAMP->prefixes[$json[1]] = $json[2]; -// $from->WAMP->prefixes($json[1], $json[2]); break; case static::MSG_CALL: @@ -108,7 +107,10 @@ class WampServer implements WsServerInterface { break; case static::MSG_PUBLISH: - $this->_decorating->onPublish($from, $from->getUri($json[1]), $json[2]); + $exclude = (array_key_exists(3, $json) ? $json[3] : null); + $eligible = (array_key_exists(4, $json) ? $json[4] : null); + + $this->_decorating->onPublish($from, $from->getUri($json[1]), $json[2], $exclude, $eligible); break; default: diff --git a/src/Ratchet/Wamp/WampServerInterface.php b/src/Ratchet/Wamp/WampServerInterface.php index 144fabe..528d627 100644 --- a/src/Ratchet/Wamp/WampServerInterface.php +++ b/src/Ratchet/Wamp/WampServerInterface.php @@ -38,5 +38,5 @@ interface WampServerInterface extends ComponentInterface { * @param ... * @param string */ - function onPublish(ConnectionInterface $conn, $uri, $event); + function onPublish(ConnectionInterface $conn, $uri, $event, $exclude, $eligible); } \ No newline at end of file diff --git a/tests/Ratchet/Tests/Mock/WampComponent.php b/tests/Ratchet/Tests/Mock/WampComponent.php index 5e4bdc3..8d1460d 100644 --- a/tests/Ratchet/Tests/Mock/WampComponent.php +++ b/tests/Ratchet/Tests/Mock/WampComponent.php @@ -18,7 +18,7 @@ class WampComponent implements WampServerInterface { $this->last[__FUNCTION__] = func_get_args(); } - public function onPublish(ConnectionInterface $conn, $uri, $event) { + public function onPublish(ConnectionInterface $conn, $uri, $event, $exclude, $eligible) { $this->last[__FUNCTION__] = func_get_args(); }