Merge branch 'refs/heads/lyrixx-cs'
This commit is contained in:
commit
1153cfc9d4
@ -2,7 +2,7 @@
|
||||
namespace Ratchet;
|
||||
|
||||
/**
|
||||
* Wraps ConnectionInterface objects via the decorator pattern but allows
|
||||
* Wraps ConnectionInterface objects via the decorator pattern but allows
|
||||
* parameters to bubble through with magic methods
|
||||
* @todo It sure would be nice if I could make most of this a trait...
|
||||
*/
|
||||
@ -26,16 +26,16 @@ abstract class AbstractConnectionDecorator implements ConnectionInterface {
|
||||
public function __set($name, $value) {
|
||||
$this->wrappedConn->$name = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __get($name) {
|
||||
return $this->wrappedConn->$name;
|
||||
}
|
||||
|
||||
|
||||
public function __isset($name) {
|
||||
return isset($this->wrappedConn->$name);
|
||||
}
|
||||
|
||||
|
||||
public function __unset($name) {
|
||||
unset($this->wrappedConn->$name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -128,4 +128,4 @@ class App {
|
||||
public function run() {
|
||||
$this->_server->run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,4 +28,4 @@ interface ComponentInterface {
|
||||
* @throws \Exception
|
||||
*/
|
||||
function onError(ConnectionInterface $conn, \Exception $e);
|
||||
}
|
||||
}
|
||||
|
@ -23,4 +23,4 @@ interface ConnectionInterface {
|
||||
* Close the connection
|
||||
*/
|
||||
function close();
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ use Guzzle\Http\EntityBody;
|
||||
class RequestFactory extends GuzzleRequestFactory {
|
||||
|
||||
protected static $ratchetInstance;
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@ -20,7 +20,7 @@ class RequestFactory extends GuzzleRequestFactory {
|
||||
|
||||
return static::$ratchetInstance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@ -31,4 +31,4 @@ class RequestFactory extends GuzzleRequestFactory {
|
||||
|
||||
return $request;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,4 +53,4 @@ class HttpRequestParser implements MessageInterface {
|
||||
public function isEom($message) {
|
||||
return (boolean)strpos($message, static::EOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,4 +76,4 @@ class OriginCheck implements HttpServerInterface {
|
||||
$conn->send((string)$response);
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace Ratchet;
|
||||
|
||||
interface MessageComponentInterface extends ComponentInterface, MessageInterface {
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,4 @@ interface MessageInterface {
|
||||
* @throws \Exception
|
||||
*/
|
||||
function onMessage(ConnectionInterface $from, $msg);
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,4 @@ class EchoServer implements MessageComponentInterface {
|
||||
public function onError(ConnectionInterface $conn, \Exception $e) {
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -185,4 +185,4 @@ class FlashPolicy implements MessageComponentInterface {
|
||||
public function validatePorts($port) {
|
||||
return (bool)preg_match('/^(\*|(\d+[,-]?)*\d+)$/', $port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,4 +35,4 @@ class IoConnection implements ConnectionInterface {
|
||||
public function close() {
|
||||
$this->conn->end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,4 +108,4 @@ class IpBlackList implements MessageComponentInterface {
|
||||
$this->_decorating->onError($conn, $e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,4 @@ interface HandlerInterface {
|
||||
* @return array
|
||||
*/
|
||||
function unserialize($raw);
|
||||
}
|
||||
}
|
||||
|
@ -30,4 +30,4 @@ class PhpBinaryHandler implements HandlerInterface {
|
||||
|
||||
return $returnData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,4 +35,4 @@ class PhpHandler implements HandlerInterface {
|
||||
|
||||
return $returnData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,4 +165,4 @@ class SessionProvider implements MessageComponentInterface, WsServerInterface {
|
||||
protected function toClassCase($langDef) {
|
||||
return str_replace(' ', '', ucwords(str_replace('_', ' ', $langDef)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,4 +51,4 @@ class VirtualProxy extends SessionHandlerProxy {
|
||||
public function setName($name) {
|
||||
throw new \RuntimeException("Can not change session name in VirtualProxy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class VirtualSessionStorage extends NativeSessionStorage {
|
||||
// get the data from the bags?
|
||||
// serialize the data
|
||||
// save the data using the saveHandler
|
||||
// $this->saveHandler->write($this->saveHandler->getId(),
|
||||
// $this->saveHandler->write($this->saveHandler->getId(),
|
||||
|
||||
if (!$this->saveHandler->isWrapper() && !$this->getSaveHandler()->isSessionHandlerInterface()) {
|
||||
$this->saveHandler->setActive(false);
|
||||
@ -79,4 +79,4 @@ class VirtualSessionStorage extends NativeSessionStorage {
|
||||
|
||||
$this->saveHandler = $saveHandler;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace Ratchet\Wamp;
|
||||
|
||||
class Exception extends \Exception {
|
||||
}
|
||||
}
|
||||
|
@ -28,4 +28,4 @@ class JsonException extends Exception {
|
||||
|
||||
parent::__construct($msg, $code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -154,4 +154,4 @@ class ServerProtocol implements MessageComponentInterface, WsServerInterface {
|
||||
public function onError(ConnectionInterface $conn, \Exception $e) {
|
||||
return $this->_decorating->onError($this->connections[$conn], $e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,4 +111,4 @@ class TopicManager implements WsServerInterface, WampServerInterface {
|
||||
|
||||
return $this->topicLookup[$topic];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,4 +66,4 @@ class WampServer implements MessageComponentInterface, WsServerInterface {
|
||||
public function getSubProtocols() {
|
||||
return $this->wampProtocol->getSubProtocols();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,4 +40,4 @@ interface WampServerInterface extends ComponentInterface {
|
||||
* @param array $eligible A list of session Ids the message should be send to (whitelist)
|
||||
*/
|
||||
function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible);
|
||||
}
|
||||
}
|
||||
|
@ -28,4 +28,4 @@ class ToggleableValidator implements ValidatorInterface {
|
||||
|
||||
return $this->validator->checkEncoding($str, $encoding);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,4 +90,4 @@ class Validator {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,4 @@ interface ValidatorInterface {
|
||||
* @return bool
|
||||
*/
|
||||
function checkEncoding($str, $encoding);
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,4 @@ interface DataInterface {
|
||||
* @return string
|
||||
*/
|
||||
function getContents();
|
||||
}
|
||||
}
|
||||
|
@ -35,4 +35,4 @@ interface FrameInterface extends DataInterface {
|
||||
* @return string
|
||||
*/
|
||||
function getMaskingKey();
|
||||
}
|
||||
}
|
||||
|
@ -117,4 +117,4 @@ class Hixie76 implements VersionInterface {
|
||||
. $code
|
||||
, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,4 @@ class Connection extends AbstractConnectionDecorator {
|
||||
public function close() {
|
||||
$this->getConnection()->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,4 +83,4 @@ class Frame implements FrameInterface {
|
||||
public function extractOverflow() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,4 +12,4 @@ class HyBi10 extends RFC6455 {
|
||||
public function getVersionNumber() {
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,4 +12,4 @@ interface MessageInterface extends DataInterface {
|
||||
* @return int
|
||||
*/
|
||||
function getOpcode();
|
||||
}
|
||||
}
|
||||
|
@ -30,4 +30,4 @@ class Connection extends AbstractConnectionDecorator {
|
||||
|
||||
$this->getConnection()->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ class Frame implements FrameInterface {
|
||||
$bits += 16;
|
||||
}
|
||||
|
||||
// If the value of the initial payload length are is 127 an additional 48 bits are used to describe length
|
||||
// If the value of the initial payload length are is 127 an additional 48 bits are used to describe length
|
||||
// Note: The documentation specifies the length is to be 63 bits, but I think that's a typo and is 64 (16+48)
|
||||
if ($check === 127) {
|
||||
$bits += 48;
|
||||
@ -447,4 +447,4 @@ class Frame implements FrameInterface {
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -134,4 +134,4 @@ class HandshakeVerifier {
|
||||
*/
|
||||
public function verifyExtensions($val) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -104,4 +104,4 @@ class Message implements MessageInterface, \Countable {
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,4 +54,4 @@ interface VersionInterface extends MessageInterface {
|
||||
* @todo Change to use other classes, this will be removed eventually
|
||||
*/
|
||||
//function frame($message, $mask = true);
|
||||
}
|
||||
}
|
||||
|
@ -87,4 +87,4 @@ class VersionManager {
|
||||
public function getSupportedVersionString() {
|
||||
return $this->versionString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -224,4 +224,4 @@ class WsServer implements HttpServerInterface {
|
||||
$conn->send((string)$response);
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,4 +11,4 @@ interface WsServerInterface {
|
||||
* @temporary This method may be removed in future version (note that will not break code, just make some code obsolete)
|
||||
*/
|
||||
function getSubProtocols();
|
||||
}
|
||||
}
|
||||
|
@ -47,4 +47,4 @@ abstract class AbstractMessageComponentTestCase extends \PHPUnit_Framework_TestC
|
||||
$this->_app->expects($this->once())->method('onMessage')->with($this->isExpectedConnection(), $value);
|
||||
$this->_serv->onMessage($this->_conn, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,4 @@ class Component implements MessageComponentInterface, WsServerInterface {
|
||||
public function getSubProtocols() {
|
||||
return $this->protocols;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ class Connection implements ConnectionInterface {
|
||||
public function close() {
|
||||
$this->last[__FUNCTION__] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,4 @@ class ConnectionDecorator extends AbstractConnectionDecorator {
|
||||
|
||||
$this->getConnection()->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,4 +40,4 @@ class WampComponent implements WampServerInterface, WsServerInterface {
|
||||
public function onError(ConnectionInterface $conn, \Exception $e) {
|
||||
$this->last[__FUNCTION__] = func_get_args();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,4 @@ class NullComponent implements MessageComponentInterface, WsServerInterface, Wam
|
||||
public function getSubProtocols() {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ use Ratchet\WebSocket\WsServerInterface;
|
||||
use Ratchet\Wamp\WampServerInterface;
|
||||
|
||||
interface WsWampServerInterface extends WsServerInterface, WampServerInterface {
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ use Ratchet\MessageComponentInterface;
|
||||
use Ratchet\WebSocket\WsServerInterface;
|
||||
|
||||
interface WsMessageComponentInterface extends MessageComponentInterface, WsServerInterface {
|
||||
}
|
||||
}
|
||||
|
@ -50,4 +50,4 @@ class GuzzleTest extends \PHPUnit_Framework_TestCase {
|
||||
$ref = new \ReflectionMethod('Guzzle\Http\Message\RequestFactory', 'create');
|
||||
$this->assertEquals(2, $ref->getNumberOfRequiredParameters());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -144,4 +144,4 @@ class AbstractConnectionDecoratorTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->setExpectedException('PHPUnit_Framework_Error');
|
||||
$var = $this->l2->nonExistant;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,4 +64,4 @@ class RequestFactoryTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->assertEquals($parts['body'], (string)$object->getBody());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,4 +48,4 @@ class HttpRequestParserTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->assertInstanceOf('\Guzzle\Http\Message\RequestInterface', $return);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,4 +61,4 @@ class HttpServerTest extends AbstractMessageComponentTestCase {
|
||||
|
||||
$this->_serv->onMessage($this->_conn, "GET / HTTP/1.1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -149,4 +149,4 @@ class FlashPolicyTest extends \PHPUnit_Framework_TestCase {
|
||||
$conn = $this->getMock('\Ratchet\ConnectionInterface');
|
||||
$this->_policy->onClose($conn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,4 +29,4 @@ class IoConnectionTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testSendReturnsSelf() {
|
||||
$this->assertSame($this->conn, $this->conn->send('fluent interface'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,4 +115,4 @@ class IoServerTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->server->handleData('f', $conn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,4 +122,4 @@ class IpBlackListTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
return $conn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,4 +33,4 @@ class PhpHandlerTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testUnserialize($in, $expected) {
|
||||
$this->assertEquals($expected, $this->_handler->unserialize($in));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,4 +264,4 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->_comp->onOpen($conn);
|
||||
$this->_comp->onMessage($conn, $message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,4 +193,4 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->assertEquals($subs, $mngr->getSubProtocols());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,4 +74,4 @@ class WampConnectionTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,4 +46,4 @@ class WampServerTest extends AbstractMessageComponentTestCase {
|
||||
$this->_conn->expects($this->once())->method('close');
|
||||
$this->_serv->onMessage($this->_conn, json_encode(array('valid' => 'json', 'invalid' => 'protocol')));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,4 +80,4 @@ class Hixie76Test extends \PHPUnit_Framework_TestCase {
|
||||
$mockApp->expects($this->once())->method('onOpen');
|
||||
$server->onMessage($mockConn, $body . $this->_crlf . $this->_crlf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,4 +64,4 @@ class HyBi10Test extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->assertEquals($string, $frame->getPayload());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
while (strlen($in) >= 8) {
|
||||
$out .= static::encode(substr($in, 0, 8));
|
||||
$in = substr($in, 8);
|
||||
$in = substr($in, 8);
|
||||
}
|
||||
|
||||
return $out;
|
||||
@ -500,4 +500,4 @@ class FrameTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
return $randomString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,4 +167,4 @@ class HandshakeVerifierTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testVersionEquals13($expected, $in) {
|
||||
$this->assertEquals($expected, $this->_v->verifyVersion($in));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,4 +60,4 @@ class MessageTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->assertEquals(28, $this->message->getPayloadLength());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -148,4 +148,4 @@ class RFC6455Test extends \PHPUnit_Framework_TestCase {
|
||||
public function testNewFrame() {
|
||||
$this->assertInstanceOf('\\Ratchet\\WebSocket\\Version\\RFC6455\\Frame', $this->version->newFrame());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,4 +88,4 @@ class VersionManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals(2, count($values));
|
||||
$this->assertFalse(array_search(0, $values));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,4 +48,4 @@ class WsServerTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->assertSame($expected, $method->invokeArgs($this->serv, array($req)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user