WAMP onCall

Functioning onCall on WAMP
Fixed bug on Event - fluent interface (had broken factory)
This commit is contained in:
Chris Boden 2012-01-17 20:39:53 -05:00
parent 5e82fc76c6
commit b2e4578e19
3 changed files with 5 additions and 3 deletions

View File

@ -64,7 +64,9 @@ class App implements WebSocketAppInterface {
break; break;
case 2: case 2:
return $this->_app->onCall($from, $json[1], $json[2]); array_shift($json);
array_unshift($json, $from);
return call_user_func_array(array($this->_app, 'onCall'), $json);
break; break;
case 5: case 5:

View File

@ -12,6 +12,6 @@ class Event extends SendMessage {
* @param string * @param string
*/ */
public function setEvent($uri, $msg) { public function setEvent($uri, $msg) {
$this->setMessage(json_encode(array(8, $uri, (string)$msg))); return $this->setMessage(json_encode(array(8, $uri, (string)$msg)));
} }
} }

View File

@ -35,7 +35,7 @@ interface ServerInterface {
* @param ... * @param ...
* @return Ratchet\Resource\Command\CommandInterface|null * @return Ratchet\Resource\Command\CommandInterface|null
*/ */
function onCall(Connection $conn, $callID, $uri); function onCall();
/** /**
* A request to subscribe to a URI has been made * A request to subscribe to a URI has been made