├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── misc.xml ├── modules.xml └── vcs.xml ├── Android Chat PHP Ratchet sockets.iml ├── README.md ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── libs │ └── autobahn-0.5.0.jar ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── squalala │ │ └── chatapp │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── squalala │ │ └── chatapp │ │ ├── ChatActivity.java │ │ ├── Message.java │ │ ├── NameActivity.java │ │ ├── adapter │ │ └── MessagesAdapter.java │ │ ├── common │ │ └── ChatConstant.java │ │ ├── holder │ │ └── MessageViewHolder.java │ │ └── utils │ │ └── ChatUtils.java │ └── res │ ├── drawable │ ├── bubble_me.xml │ └── bubble_you.xml │ ├── layout │ ├── activity_chat.xml │ ├── activity_name.xml │ ├── item_message_left.xml │ └── item_message_right.xml │ ├── menu │ └── menu_main.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── sockets ├── bin └── chat-server.php ├── composer.json ├── composer.lock ├── composer.phar ├── src └── MyApp │ └── Chat.php └── vendor ├── MyApp ├── Chat.php └── src │ └── Chat.php ├── autoload.php ├── cboden └── ratchet │ ├── .gitignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── composer.json │ ├── phpunit.xml.dist │ ├── src │ └── Ratchet │ │ ├── AbstractConnectionDecorator.php │ │ ├── App.php │ │ ├── ComponentInterface.php │ │ ├── ConnectionInterface.php │ │ ├── Http │ │ ├── Guzzle │ │ │ └── Http │ │ │ │ └── Message │ │ │ │ └── RequestFactory.php │ │ ├── HttpRequestParser.php │ │ ├── HttpServer.php │ │ ├── HttpServerInterface.php │ │ ├── OriginCheck.php │ │ └── Router.php │ │ ├── MessageComponentInterface.php │ │ ├── MessageInterface.php │ │ ├── Server │ │ ├── EchoServer.php │ │ ├── FlashPolicy.php │ │ ├── IoConnection.php │ │ ├── IoServer.php │ │ └── IpBlackList.php │ │ ├── Session │ │ ├── Serialize │ │ │ ├── HandlerInterface.php │ │ │ ├── PhpBinaryHandler.php │ │ │ └── PhpHandler.php │ │ ├── SessionProvider.php │ │ └── Storage │ │ │ ├── Proxy │ │ │ └── VirtualProxy.php │ │ │ └── VirtualSessionStorage.php │ │ ├── Wamp │ │ ├── Exception.php │ │ ├── JsonException.php │ │ ├── ServerProtocol.php │ │ ├── Topic.php │ │ ├── TopicManager.php │ │ ├── WampConnection.php │ │ ├── WampServer.php │ │ └── WampServerInterface.php │ │ └── WebSocket │ │ ├── Encoding │ │ ├── ToggleableValidator.php │ │ ├── Validator.php │ │ └── ValidatorInterface.php │ │ ├── Version │ │ ├── DataInterface.php │ │ ├── FrameInterface.php │ │ ├── Hixie76.php │ │ ├── Hixie76 │ │ │ ├── Connection.php │ │ │ └── Frame.php │ │ ├── HyBi10.php │ │ ├── MessageInterface.php │ │ ├── RFC6455.php │ │ ├── RFC6455 │ │ │ ├── Connection.php │ │ │ ├── Frame.php │ │ │ ├── HandshakeVerifier.php │ │ │ └── Message.php │ │ └── VersionInterface.php │ │ ├── VersionManager.php │ │ ├── WsServer.php │ │ └── WsServerInterface.php │ └── tests │ ├── autobahn │ ├── bin │ │ ├── fuzzingserver-noutf8.php │ │ └── fuzzingserver.php │ ├── fuzzingclient-all.json │ ├── fuzzingclient-profile.json │ └── fuzzingclient-quick.json │ ├── bootstrap.php │ ├── helpers │ └── Ratchet │ │ ├── AbstractMessageComponentTestCase.php │ │ ├── Mock │ │ ├── Component.php │ │ ├── Connection.php │ │ ├── ConnectionDecorator.php │ │ └── WampComponent.php │ │ ├── NullComponent.php │ │ ├── Wamp │ │ └── Stub │ │ │ └── WsWampServerInterface.php │ │ └── WebSocket │ │ └── Stub │ │ └── WsMessageComponentInterface.php │ ├── integration │ └── GuzzleTest.php │ └── unit │ ├── AbstractConnectionDecoratorTest.php │ ├── Http │ ├── Guzzle │ │ └── Http │ │ │ └── Message │ │ │ └── RequestFactoryTest.php │ ├── HttpRequestParserTest.php │ ├── HttpServerTest.php │ ├── OriginCheckTest.php │ └── RouterTest.php │ ├── Server │ ├── EchoServerTest.php │ ├── FlashPolicyComponentTest.php │ ├── IoConnectionTest.php │ ├── IoServerTest.php │ └── IpBlackListComponentTest.php │ ├── Session │ ├── Serialize │ │ └── PhpHandlerTest.php │ └── SessionComponentTest.php │ ├── Wamp │ ├── ServerProtocolTest.php │ ├── TopicManagerTest.php │ ├── TopicTest.php │ ├── WampConnectionTest.php │ └── WampServerTest.php │ └── WebSocket │ ├── Version │ ├── Hixie76Test.php │ ├── HyBi10Test.php │ ├── RFC6455 │ │ ├── FrameTest.php │ │ ├── HandshakeVerifierTest.php │ │ └── MessageTest.php │ └── RFC6455Test.php │ ├── VersionManagerTest.php │ └── WsServerTest.php ├── composer ├── ClassLoader.php ├── autoload_classmap.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php └── installed.json ├── evenement └── evenement │ ├── .gitignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── composer.json │ ├── phpunit.xml.dist │ ├── src │ └── Evenement │ │ ├── EventEmitter.php │ │ ├── EventEmitterInterface.php │ │ └── EventEmitterTrait.php │ └── tests │ ├── Evenement │ └── Tests │ │ ├── EventEmitterTest.php │ │ └── Listener.php │ └── bootstrap.php ├── guzzle ├── common │ └── Guzzle │ │ └── Common │ │ ├── AbstractHasDispatcher.php │ │ ├── Collection.php │ │ ├── Event.php │ │ ├── Exception │ │ ├── BadMethodCallException.php │ │ ├── ExceptionCollection.php │ │ ├── GuzzleException.php │ │ ├── InvalidArgumentException.php │ │ ├── RuntimeException.php │ │ └── UnexpectedValueException.php │ │ ├── FromConfigInterface.php │ │ ├── HasDispatcherInterface.php │ │ ├── ToArrayInterface.php │ │ ├── Version.php │ │ └── composer.json ├── http │ └── Guzzle │ │ └── Http │ │ ├── AbstractEntityBodyDecorator.php │ │ ├── CachingEntityBody.php │ │ ├── Client.php │ │ ├── ClientInterface.php │ │ ├── Curl │ │ ├── CurlHandle.php │ │ ├── CurlMulti.php │ │ ├── CurlMultiInterface.php │ │ ├── CurlMultiProxy.php │ │ ├── CurlVersion.php │ │ └── RequestMediator.php │ │ ├── EntityBody.php │ │ ├── EntityBodyInterface.php │ │ ├── Exception │ │ ├── BadResponseException.php │ │ ├── ClientErrorResponseException.php │ │ ├── CouldNotRewindStreamException.php │ │ ├── CurlException.php │ │ ├── HttpException.php │ │ ├── MultiTransferException.php │ │ ├── RequestException.php │ │ ├── ServerErrorResponseException.php │ │ └── TooManyRedirectsException.php │ │ ├── IoEmittingEntityBody.php │ │ ├── Message │ │ ├── AbstractMessage.php │ │ ├── EntityEnclosingRequest.php │ │ ├── EntityEnclosingRequestInterface.php │ │ ├── Header.php │ │ ├── Header │ │ │ ├── CacheControl.php │ │ │ ├── HeaderCollection.php │ │ │ ├── HeaderFactory.php │ │ │ ├── HeaderFactoryInterface.php │ │ │ ├── HeaderInterface.php │ │ │ └── Link.php │ │ ├── MessageInterface.php │ │ ├── PostFile.php │ │ ├── PostFileInterface.php │ │ ├── Request.php │ │ ├── RequestFactory.php │ │ ├── RequestFactoryInterface.php │ │ ├── RequestInterface.php │ │ └── Response.php │ │ ├── Mimetypes.php │ │ ├── QueryAggregator │ │ ├── CommaAggregator.php │ │ ├── DuplicateAggregator.php │ │ ├── PhpAggregator.php │ │ └── QueryAggregatorInterface.php │ │ ├── QueryString.php │ │ ├── ReadLimitEntityBody.php │ │ ├── RedirectPlugin.php │ │ ├── Resources │ │ └── cacert.pem │ │ ├── StaticClient.php │ │ ├── Url.php │ │ └── composer.json ├── parser │ └── Guzzle │ │ └── Parser │ │ ├── Cookie │ │ ├── CookieParser.php │ │ └── CookieParserInterface.php │ │ ├── Message │ │ ├── AbstractMessageParser.php │ │ ├── MessageParser.php │ │ ├── MessageParserInterface.php │ │ └── PeclHttpMessageParser.php │ │ ├── ParserRegistry.php │ │ ├── UriTemplate │ │ ├── PeclUriTemplate.php │ │ ├── UriTemplate.php │ │ └── UriTemplateInterface.php │ │ ├── Url │ │ ├── UrlParser.php │ │ └── UrlParserInterface.php │ │ └── composer.json └── stream │ └── Guzzle │ └── Stream │ ├── PhpStreamRequestFactory.php │ ├── Stream.php │ ├── StreamInterface.php │ ├── StreamRequestFactoryInterface.php │ └── composer.json ├── react ├── event-loop │ ├── ExtEventLoop.php │ ├── Factory.php │ ├── LibEvLoop.php │ ├── LibEventLoop.php │ ├── LoopInterface.php │ ├── README.md │ ├── StreamSelectLoop.php │ ├── Tick │ │ ├── FutureTickQueue.php │ │ └── NextTickQueue.php │ ├── Timer │ │ ├── Timer.php │ │ ├── TimerInterface.php │ │ └── Timers.php │ └── composer.json ├── socket │ ├── .gitignore │ ├── .travis.yml │ ├── README.md │ ├── composer.json │ ├── phpunit.xml.dist │ ├── src │ │ ├── Connection.php │ │ ├── ConnectionException.php │ │ ├── ConnectionInterface.php │ │ ├── Server.php │ │ └── ServerInterface.php │ └── tests │ │ ├── ConnectionTest.php │ │ ├── ServerTest.php │ │ ├── Stub │ │ ├── CallableStub.php │ │ ├── ConnectionStub.php │ │ └── ServerStub.php │ │ ├── TestCase.php │ │ └── bootstrap.php └── stream │ ├── .gitignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── composer.json │ ├── phpunit.xml.dist │ ├── src │ ├── Buffer.php │ ├── BufferedSink.php │ ├── CompositeStream.php │ ├── DuplexStreamInterface.php │ ├── ReadableStream.php │ ├── ReadableStreamInterface.php │ ├── Stream.php │ ├── ThroughStream.php │ ├── Util.php │ ├── WritableStream.php │ └── WritableStreamInterface.php │ └── tests │ ├── BufferTest.php │ ├── BufferedSinkTest.php │ ├── CallableStub.php │ ├── CompositeStreamTest.php │ ├── ReadableStreamTest.php │ ├── StreamTest.php │ ├── Stub │ └── ReadableStreamStub.php │ ├── TestCase.php │ ├── ThroughStreamTest.php │ ├── UtilTest.php │ ├── WritableStreamTest.php │ └── bootstrap.php └── symfony ├── event-dispatcher ├── .gitignore ├── CHANGELOG.md ├── ContainerAwareEventDispatcher.php ├── Debug │ ├── TraceableEventDispatcher.php │ ├── TraceableEventDispatcherInterface.php │ └── WrappedListener.php ├── DependencyInjection │ └── RegisterListenersPass.php ├── Event.php ├── EventDispatcher.php ├── EventDispatcherInterface.php ├── EventSubscriberInterface.php ├── GenericEvent.php ├── ImmutableEventDispatcher.php ├── LICENSE ├── README.md ├── Tests │ ├── AbstractEventDispatcherTest.php │ ├── ContainerAwareEventDispatcherTest.php │ ├── Debug │ │ └── TraceableEventDispatcherTest.php │ ├── DependencyInjection │ │ └── RegisterListenersPassTest.php │ ├── EventDispatcherTest.php │ ├── EventTest.php │ ├── GenericEventTest.php │ └── ImmutableEventDispatcherTest.php ├── composer.json └── phpunit.xml.dist ├── http-foundation ├── .gitignore ├── AcceptHeader.php ├── AcceptHeaderItem.php ├── ApacheRequest.php ├── BinaryFileResponse.php ├── CHANGELOG.md ├── Cookie.php ├── ExpressionRequestMatcher.php ├── File │ ├── Exception │ │ ├── AccessDeniedException.php │ │ ├── FileException.php │ │ ├── FileNotFoundException.php │ │ ├── UnexpectedTypeException.php │ │ └── UploadException.php │ ├── File.php │ ├── MimeType │ │ ├── ExtensionGuesser.php │ │ ├── ExtensionGuesserInterface.php │ │ ├── FileBinaryMimeTypeGuesser.php │ │ ├── FileinfoMimeTypeGuesser.php │ │ ├── MimeTypeExtensionGuesser.php │ │ ├── MimeTypeGuesser.php │ │ └── MimeTypeGuesserInterface.php │ └── UploadedFile.php ├── FileBag.php ├── HeaderBag.php ├── IpUtils.php ├── JsonResponse.php ├── LICENSE ├── ParameterBag.php ├── README.md ├── RedirectResponse.php ├── Request.php ├── RequestMatcher.php ├── RequestMatcherInterface.php ├── RequestStack.php ├── Resources │ └── stubs │ │ └── SessionHandlerInterface.php ├── Response.php ├── ResponseHeaderBag.php ├── ServerBag.php ├── Session │ ├── Attribute │ │ ├── AttributeBag.php │ │ ├── AttributeBagInterface.php │ │ └── NamespacedAttributeBag.php │ ├── Flash │ │ ├── AutoExpireFlashBag.php │ │ ├── FlashBag.php │ │ └── FlashBagInterface.php │ ├── Session.php │ ├── SessionBagInterface.php │ ├── SessionInterface.php │ └── Storage │ │ ├── Handler │ │ ├── LegacyPdoSessionHandler.php │ │ ├── MemcacheSessionHandler.php │ │ ├── MemcachedSessionHandler.php │ │ ├── MongoDbSessionHandler.php │ │ ├── NativeFileSessionHandler.php │ │ ├── NativeSessionHandler.php │ │ ├── NullSessionHandler.php │ │ ├── PdoSessionHandler.php │ │ └── WriteCheckSessionHandler.php │ │ ├── MetadataBag.php │ │ ├── MockArraySessionStorage.php │ │ ├── MockFileSessionStorage.php │ │ ├── NativeSessionStorage.php │ │ ├── PhpBridgeSessionStorage.php │ │ ├── Proxy │ │ ├── AbstractProxy.php │ │ ├── NativeProxy.php │ │ └── SessionHandlerProxy.php │ │ └── SessionStorageInterface.php ├── StreamedResponse.php ├── Tests │ ├── AcceptHeaderItemTest.php │ ├── AcceptHeaderTest.php │ ├── ApacheRequestTest.php │ ├── BinaryFileResponseTest.php │ ├── CookieTest.php │ ├── ExpressionRequestMatcherTest.php │ ├── File │ │ ├── FakeFile.php │ │ ├── FileTest.php │ │ ├── Fixtures │ │ │ ├── .unknownextension │ │ │ ├── directory │ │ │ │ └── .empty │ │ │ ├── test │ │ │ └── test.gif │ │ ├── MimeType │ │ │ └── MimeTypeTest.php │ │ └── UploadedFileTest.php │ ├── FileBagTest.php │ ├── HeaderBagTest.php │ ├── IpUtilsTest.php │ ├── JsonResponseTest.php │ ├── ParameterBagTest.php │ ├── RedirectResponseTest.php │ ├── RequestMatcherTest.php │ ├── RequestStackTest.php │ ├── RequestTest.php │ ├── ResponseHeaderBagTest.php │ ├── ResponseTest.php │ ├── ResponseTestCase.php │ ├── ServerBagTest.php │ ├── Session │ │ ├── Attribute │ │ │ ├── AttributeBagTest.php │ │ │ └── NamespacedAttributeBagTest.php │ │ ├── Flash │ │ │ ├── AutoExpireFlashBagTest.php │ │ │ └── FlashBagTest.php │ │ ├── SessionTest.php │ │ └── Storage │ │ │ ├── Handler │ │ │ ├── LegacyPdoSessionHandlerTest.php │ │ │ ├── MemcacheSessionHandlerTest.php │ │ │ ├── MemcachedSessionHandlerTest.php │ │ │ ├── MongoDbSessionHandlerTest.php │ │ │ ├── NativeFileSessionHandlerTest.php │ │ │ ├── NativeSessionHandlerTest.php │ │ │ ├── NullSessionHandlerTest.php │ │ │ ├── PdoSessionHandlerTest.php │ │ │ └── WriteCheckSessionHandlerTest.php │ │ │ ├── MetadataBagTest.php │ │ │ ├── MockArraySessionStorageTest.php │ │ │ ├── MockFileSessionStorageTest.php │ │ │ ├── NativeSessionStorageTest.php │ │ │ ├── PhpBridgeSessionStorageTest.php │ │ │ └── Proxy │ │ │ ├── AbstractProxyTest.php │ │ │ ├── NativeProxyTest.php │ │ │ └── SessionHandlerProxyTest.php │ └── StreamedResponseTest.php ├── composer.json └── phpunit.xml.dist └── routing ├── .gitignore ├── Annotation └── Route.php ├── CHANGELOG.md ├── CompiledRoute.php ├── Exception ├── ExceptionInterface.php ├── InvalidParameterException.php ├── MethodNotAllowedException.php ├── MissingMandatoryParametersException.php ├── ResourceNotFoundException.php └── RouteNotFoundException.php ├── Generator ├── ConfigurableRequirementsInterface.php ├── Dumper │ ├── GeneratorDumper.php │ ├── GeneratorDumperInterface.php │ └── PhpGeneratorDumper.php ├── UrlGenerator.php └── UrlGeneratorInterface.php ├── LICENSE ├── Loader ├── AnnotationClassLoader.php ├── AnnotationDirectoryLoader.php ├── AnnotationFileLoader.php ├── ClosureLoader.php ├── PhpFileLoader.php ├── XmlFileLoader.php ├── YamlFileLoader.php └── schema │ └── routing │ └── routing-1.0.xsd ├── Matcher ├── ApacheUrlMatcher.php ├── Dumper │ ├── ApacheMatcherDumper.php │ ├── DumperCollection.php │ ├── DumperPrefixCollection.php │ ├── DumperRoute.php │ ├── MatcherDumper.php │ ├── MatcherDumperInterface.php │ └── PhpMatcherDumper.php ├── RedirectableUrlMatcher.php ├── RedirectableUrlMatcherInterface.php ├── RequestMatcherInterface.php ├── TraceableUrlMatcher.php ├── UrlMatcher.php └── UrlMatcherInterface.php ├── README.md ├── RequestContext.php ├── RequestContextAwareInterface.php ├── Route.php ├── RouteCollection.php ├── RouteCompiler.php ├── RouteCompilerInterface.php ├── Router.php ├── RouterInterface.php ├── Tests ├── Annotation │ └── RouteTest.php ├── CompiledRouteTest.php ├── Fixtures │ ├── AnnotatedClasses │ │ ├── AbstractClass.php │ │ ├── BarClass.php │ │ └── FooClass.php │ ├── CustomXmlFileLoader.php │ ├── RedirectableUrlMatcher.php │ ├── annotated.php │ ├── dumper │ │ ├── url_matcher1.apache │ │ ├── url_matcher1.php │ │ ├── url_matcher2.apache │ │ ├── url_matcher2.php │ │ └── url_matcher3.php │ ├── empty.yml │ ├── foo.xml │ ├── foo1.xml │ ├── incomplete.yml │ ├── legacy_validpattern.xml │ ├── legacy_validpattern.yml │ ├── missing_id.xml │ ├── missing_path.xml │ ├── namespaceprefix.xml │ ├── nonesense_resource_plus_path.yml │ ├── nonesense_type_without_resource.yml │ ├── nonvalid.xml │ ├── nonvalid.yml │ ├── nonvalid2.yml │ ├── nonvalidkeys.yml │ ├── nonvalidnode.xml │ ├── nonvalidroute.xml │ ├── null_values.xml │ ├── special_route_name.yml │ ├── validpattern.php │ ├── validpattern.xml │ ├── validpattern.yml │ ├── validresource.php │ ├── validresource.xml │ ├── validresource.yml │ ├── with_define_path_variable.php │ └── withdoctype.xml ├── Generator │ ├── Dumper │ │ └── PhpGeneratorDumperTest.php │ └── UrlGeneratorTest.php ├── Loader │ ├── AbstractAnnotationLoaderTest.php │ ├── AnnotationClassLoaderTest.php │ ├── AnnotationDirectoryLoaderTest.php │ ├── AnnotationFileLoaderTest.php │ ├── ClosureLoaderTest.php │ ├── PhpFileLoaderTest.php │ ├── XmlFileLoaderTest.php │ └── YamlFileLoaderTest.php ├── Matcher │ ├── Dumper │ │ ├── DumperCollectionTest.php │ │ ├── DumperPrefixCollectionTest.php │ │ ├── LegacyApacheMatcherDumperTest.php │ │ └── PhpMatcherDumperTest.php │ ├── LegacyApacheUrlMatcherTest.php │ ├── RedirectableUrlMatcherTest.php │ ├── TraceableUrlMatcherTest.php │ └── UrlMatcherTest.php ├── RequestContextTest.php ├── RouteCollectionTest.php ├── RouteCompilerTest.php ├── RouteTest.php └── RouterTest.php ├── composer.json └── phpunit.xml.dist /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Android Chat PHP Ratchet sockets -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 1.7 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Android Chat PHP Ratchet sockets.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

What is this ?

2 | A little example that show you how to built a chat application by combining Android and PHP Ratchet for sockets :D 3 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "com.squalala.chatapp" 9 | minSdkVersion 9 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | 25 | compile 'com.android.support:appcompat-v7:22.2.0' 26 | 27 | compile 'com.android.support:recyclerview-v7:22.2.0' 28 | compile 'com.jakewharton:butterknife:7.0.1' 29 | } 30 | -------------------------------------------------------------------------------- /app/libs/autobahn-0.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/app/libs/autobahn-0.5.0.jar -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/brio/Documents/Programmation/adt-bundle-linux-x86_64-20130522/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/squalala/chatapp/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.squalala.chatapp; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/squalala/chatapp/Message.java: -------------------------------------------------------------------------------- 1 | package com.squalala.chatapp; 2 | 3 | /** 4 | * Created by Back Packer 5 | * Date : 09/07/15 6 | */ 7 | public class Message { 8 | 9 | private String name; 10 | private String message; 11 | 12 | /** 13 | * Pour savoir si c'est notre message ou non 14 | */ 15 | private boolean me; 16 | 17 | public Message(String name, String message, boolean me) { 18 | this.name = name; 19 | this.message = message; 20 | this.me = me; 21 | } 22 | 23 | public Message(String name, String message) { 24 | this.name = name; 25 | this.message = message; 26 | } 27 | 28 | public String getMessage() { 29 | return message; 30 | } 31 | 32 | public void setMessage(String message) { 33 | this.message = message; 34 | } 35 | 36 | public String getName() { 37 | return name; 38 | } 39 | 40 | public void setName(String name) { 41 | this.name = name; 42 | } 43 | 44 | public boolean isMe() { 45 | return me; 46 | } 47 | 48 | public void setMe(boolean me) { 49 | this.me = me; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/squalala/chatapp/NameActivity.java: -------------------------------------------------------------------------------- 1 | package com.squalala.chatapp; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.text.TextUtils; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.EditText; 10 | 11 | import com.squalala.chatapp.common.ChatConstant; 12 | 13 | import butterknife.Bind; 14 | import butterknife.ButterKnife; 15 | 16 | /** 17 | * Created by Back Packer 18 | * Date : 09/07/15 19 | */ 20 | public class NameActivity extends AppCompatActivity { 21 | 22 | @Bind(R.id.edit_name) 23 | EditText editName; 24 | 25 | @Bind(R.id.btnJoin) 26 | Button btnJoin; 27 | 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | setContentView(R.layout.activity_name); 33 | 34 | ButterKnife.bind(this); 35 | 36 | btnJoin.setOnClickListener(new View.OnClickListener() { 37 | @Override 38 | public void onClick(View view) { 39 | 40 | if (!TextUtils.isEmpty(getName())) { 41 | Intent intent = new Intent(NameActivity.this, ChatActivity.class); 42 | intent.putExtra(ChatConstant.TAG_NAME, getName()); 43 | startActivity(intent); 44 | finish(); 45 | } 46 | 47 | 48 | } 49 | }); 50 | 51 | 52 | 53 | } 54 | 55 | private String getName() { 56 | return editName.getText().toString().trim(); 57 | } 58 | 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/squalala/chatapp/common/ChatConstant.java: -------------------------------------------------------------------------------- 1 | package com.squalala.chatapp.common; 2 | 3 | /** 4 | * Created by Back Packer 5 | * Date : 09/07/15 6 | */ 7 | public class ChatConstant { 8 | 9 | public static final String TAG_NAME = "name"; 10 | 11 | public static final String TAG_MESSAGE = "message"; 12 | 13 | public static final String URL = "ws://192.168.1.11:8080"; 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/squalala/chatapp/holder/MessageViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.squalala.chatapp.holder; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | 7 | import com.squalala.chatapp.Message; 8 | import com.squalala.chatapp.R; 9 | 10 | import butterknife.Bind; 11 | import butterknife.ButterKnife; 12 | 13 | /** 14 | * Created by Back Packer 15 | * Date : 09/07/15 16 | */ 17 | public class MessageViewHolder extends RecyclerView.ViewHolder { 18 | 19 | @Bind(R.id.name) TextView txtName; 20 | @Bind(R.id.message) TextView txtMessage; 21 | 22 | public MessageViewHolder(View itemView) { 23 | super(itemView); 24 | 25 | ButterKnife.bind(this, itemView); 26 | } 27 | 28 | public void bind(Message message) { 29 | txtName.setText(message.getName()); 30 | txtMessage.setText(message.getMessage()); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/squalala/chatapp/utils/ChatUtils.java: -------------------------------------------------------------------------------- 1 | package com.squalala.chatapp.utils; 2 | 3 | import com.squalala.chatapp.Message; 4 | import com.squalala.chatapp.common.ChatConstant; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | /** 10 | * Created by Back Packer 11 | * Date : 09/07/15 12 | */ 13 | public class ChatUtils { 14 | 15 | 16 | /** 17 | * Ici on parse le JSON reçu du serveur 18 | * 19 | */ 20 | public static Message jsonToMessage(String json) { 21 | 22 | 23 | Message message = null; 24 | 25 | try { 26 | JSONObject jsonObject = new JSONObject(json); 27 | 28 | message = new Message( 29 | jsonObject.getString(ChatConstant.TAG_NAME), 30 | jsonObject.getString(ChatConstant.TAG_MESSAGE), 31 | // On met "false" car ce n'est pas notre message 32 | false 33 | ); 34 | 35 | return message; 36 | 37 | } catch (JSONException e) { 38 | e.printStackTrace(); 39 | } 40 | 41 | return null; 42 | } 43 | 44 | 45 | public static String messageToJson(Message message) { 46 | 47 | JSONObject jsonObject = new JSONObject(); 48 | 49 | try { 50 | 51 | jsonObject.put(ChatConstant.TAG_NAME, message.getName()); 52 | jsonObject.put(ChatConstant.TAG_MESSAGE, message.getMessage()); 53 | 54 | } catch (JSONException e) { 55 | e.printStackTrace(); 56 | } 57 | 58 | return jsonObject.toString(); 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bubble_me.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bubble_you.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_message_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_message_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #0084ff 5 | #f1f0f0 6 | #777777 7 | 8 | #02c754 9 | #006633 10 | #99000000 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ChatApp 3 | 4 | Hello world! 5 | Settings 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /sockets/bin/chat-server.php: -------------------------------------------------------------------------------- 1 | run(); 22 | 23 | 24 | -------------------------------------------------------------------------------- /sockets/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": { 3 | "psr-0": { 4 | "MyApp": "src" 5 | } 6 | }, 7 | "require": { 8 | "cboden/ratchet": "^0.3.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sockets/composer.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/sockets/composer.phar -------------------------------------------------------------------------------- /sockets/src/MyApp/Chat.php: -------------------------------------------------------------------------------- 1 | clients = new \SplObjectStorage; 11 | } 12 | 13 | public function onOpen(ConnectionInterface $conn) { 14 | // une nouvelle connexion, on l'enregistre ! 15 | $this->clients->attach($conn); 16 | 17 | 18 | echo "Un nouvel utilisateur ! ({$conn->resourceId})\n"; 19 | } 20 | 21 | public function onMessage(ConnectionInterface $from, $msg) { 22 | 23 | $numRecv = count($this->clients) - 1; 24 | echo sprintf('Connection %d a envoyé un message "%s" to %d aux autres connection%s' . "\n" 25 | , $from->resourceId, $msg, $numRecv, $numRecv == 1 ? '' : 's'); 26 | 27 | /* 28 | * On envoit le message à tous les autres utilisateur sauf nous même 29 | * 30 | */ 31 | foreach ($this->clients as $client) { 32 | if ($from !== $client) { 33 | $client->send($msg); 34 | } 35 | } 36 | } 37 | 38 | public function onClose(ConnectionInterface $conn) { 39 | // connexion fermé, on se débarasse du client 40 | $this->clients->detach($conn); 41 | 42 | echo "L'utilisateur {$conn->resourceId} s'est déconnecté\n"; 43 | } 44 | 45 | public function onError(ConnectionInterface $conn, \Exception $e) { 46 | echo "Une erreur s'est produite : {$e->getMessage()}\n"; 47 | 48 | $conn->close(); 49 | } 50 | } -------------------------------------------------------------------------------- /sockets/vendor/MyApp/Chat.php: -------------------------------------------------------------------------------- 1 | clients = new \SplObjectStorage; 11 | } 12 | 13 | public function onOpen(ConnectionInterface $conn) { 14 | // Store the new connection to send messages to later 15 | $this->clients->attach($conn); 16 | 17 | echo "New connection! ({$conn->resourceId})\n"; 18 | } 19 | 20 | public function onMessage(ConnectionInterface $from, $msg) { 21 | $numRecv = count($this->clients) - 1; 22 | echo sprintf('Connection %d sending message "%s" to %d other connection%s' . "\n" 23 | , $from->resourceId, $msg, $numRecv, $numRecv == 1 ? '' : 's'); 24 | 25 | foreach ($this->clients as $client) { 26 | if ($from !== $client) { 27 | // The sender is not the receiver, send to each client connected 28 | $client->send($msg); 29 | } 30 | } 31 | } 32 | 33 | public function onClose(ConnectionInterface $conn) { 34 | // The connection is closed, remove it, as we can no longer send it messages 35 | $this->clients->detach($conn); 36 | 37 | echo "Connection {$conn->resourceId} has disconnected\n"; 38 | } 39 | 40 | public function onError(ConnectionInterface $conn, \Exception $e) { 41 | echo "An error has occurred: {$e->getMessage()}\n"; 42 | 43 | $conn->close(); 44 | } 45 | } -------------------------------------------------------------------------------- /sockets/vendor/MyApp/src/Chat.php: -------------------------------------------------------------------------------- 1 | clients = new \SplObjectStorage; 11 | } 12 | 13 | public function onOpen(ConnectionInterface $conn) { 14 | // Store the new connection to send messages to later 15 | $this->clients->attach($conn); 16 | 17 | echo "New connection! ({$conn->resourceId})\n"; 18 | } 19 | 20 | public function onMessage(ConnectionInterface $from, $msg) { 21 | $numRecv = count($this->clients) - 1; 22 | echo sprintf('Connection %d sending message "%s" to %d other connection%s' . "\n" 23 | , $from->resourceId, $msg, $numRecv, $numRecv == 1 ? '' : 's'); 24 | 25 | foreach ($this->clients as $client) { 26 | if ($from !== $client) { 27 | // The sender is not the receiver, send to each client connected 28 | $client->send($msg); 29 | } 30 | } 31 | } 32 | 33 | public function onClose(ConnectionInterface $conn) { 34 | // The connection is closed, remove it, as we can no longer send it messages 35 | $this->clients->detach($conn); 36 | 37 | echo "Connection {$conn->resourceId} has disconnected\n"; 38 | } 39 | 40 | public function onError(ConnectionInterface $conn, \Exception $e) { 41 | echo "An error has occurred: {$e->getMessage()}\n"; 42 | 43 | $conn->close(); 44 | } 45 | } -------------------------------------------------------------------------------- /sockets/vendor/autoload.php: -------------------------------------------------------------------------------- 1 | > ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;' 13 | - composer install --dev --prefer-source 14 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2015 Chris Boden 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/Makefile: -------------------------------------------------------------------------------- 1 | # This file is intended to ease the author's development and testing process 2 | # Users do not need to use `make`; Ratchet does not need to be compiled 3 | 4 | test: 5 | phpunit 6 | 7 | cover: 8 | phpunit --coverage-text --coverage-html=reports/coverage 9 | 10 | abtests: 11 | ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8001 LibEvent & 12 | ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8002 StreamSelect & 13 | ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-noutf8.php 8003 StreamSelect & 14 | ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8004 LibEv & 15 | wstest -m testeeserver -w ws://localhost:8000 & 16 | wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-all.json 17 | killall php wstest 18 | 19 | abtest: 20 | ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8000 StreamSelect & 21 | wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-quick.json 22 | killall php 23 | 24 | profile: 25 | php -d 'xdebug.profiler_enable=1' tests/autobahn/bin/fuzzingserver.php 8000 LibEvent & 26 | wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-profile.json 27 | killall php 28 | 29 | apidocs: 30 | apigen --title Ratchet -d reports/api -s src/ \ 31 | -s vendor/react \ 32 | -s vendor/guzzle \ 33 | -s vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session \ 34 | -s vendor/symfony/routing/Symfony/Component/Routing \ 35 | -s vendor/evenement/evenement/src/Evenement 36 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cboden/ratchet" 3 | , "type": "library" 4 | , "description": "PHP WebSocket library" 5 | , "keywords": ["WebSockets", "Server", "Ratchet", "Sockets"] 6 | , "homepage": "http://socketo.me" 7 | , "license": "MIT" 8 | , "authors": [ 9 | { 10 | "name": "Chris Boden" 11 | , "email": "cboden@gmail.com" 12 | , "role": "Developer" 13 | } 14 | ] 15 | , "support": { 16 | "forum": "https://groups.google.com/forum/#!forum/ratchet-php" 17 | , "issues": "https://github.com/ratchetphp/Ratchet/issues" 18 | , "irc": "irc://irc.freenode.org/reactphp" 19 | } 20 | , "autoload": { 21 | "psr-4": { 22 | "Ratchet\\": "src/Ratchet" 23 | } 24 | } 25 | , "require": { 26 | "php": ">=5.3.9" 27 | , "react/socket": "^0.3 || ^0.4" 28 | , "guzzle/http": "^3.6" 29 | , "symfony/http-foundation": "^2.2" 30 | , "symfony/routing": "^2.2" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | ./tests/unit/ 16 | 17 | 18 | 19 | 20 | 21 | ./tests/integration/ 22 | 23 | 24 | 25 | 26 | 27 | ./src/ 28 | 29 | 30 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php: -------------------------------------------------------------------------------- 1 | wrappedConn = $conn; 17 | } 18 | 19 | /** 20 | * @return ConnectionInterface 21 | */ 22 | protected function getConnection() { 23 | return $this->wrappedConn; 24 | } 25 | 26 | public function __set($name, $value) { 27 | $this->wrappedConn->$name = $value; 28 | } 29 | 30 | public function __get($name) { 31 | return $this->wrappedConn->$name; 32 | } 33 | 34 | public function __isset($name) { 35 | return isset($this->wrappedConn->$name); 36 | } 37 | 38 | public function __unset($name) { 39 | unset($this->wrappedConn->$name); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/ComponentInterface.php: -------------------------------------------------------------------------------- 1 | entityEnclosingRequestClass; 29 | $request = new $c($method, $url, $headers); 30 | $request->setBody(EntityBody::factory($body)); 31 | 32 | return $request; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php: -------------------------------------------------------------------------------- 1 | send($msg); 15 | } 16 | 17 | public function onClose(ConnectionInterface $conn) { 18 | } 19 | 20 | public function onError(ConnectionInterface $conn, \Exception $e) { 21 | $conn->close(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php: -------------------------------------------------------------------------------- 1 | conn = $conn; 21 | } 22 | 23 | /** 24 | * {@inheritdoc} 25 | */ 26 | public function send($data) { 27 | $this->conn->write($data); 28 | 29 | return $this; 30 | } 31 | 32 | /** 33 | * {@inheritdoc} 34 | */ 35 | public function close() { 36 | $this->conn->end(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php: -------------------------------------------------------------------------------- 1 | saveHandlerName = 'user'; 23 | $this->_sessionName = ini_get('session.name'); 24 | } 25 | 26 | /** 27 | * {@inheritdoc} 28 | */ 29 | public function getId() { 30 | return $this->_sessionId; 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | */ 36 | public function setId($id) { 37 | $this->_sessionId = $id; 38 | } 39 | 40 | /** 41 | * {@inheritdoc} 42 | */ 43 | public function getName() { 44 | return $this->_sessionName; 45 | } 46 | 47 | /** 48 | * DO NOT CALL THIS METHOD 49 | * @internal 50 | */ 51 | public function setName($name) { 52 | throw new \RuntimeException("Can not change session name in VirtualProxy"); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php: -------------------------------------------------------------------------------- 1 | validator = new Validator; 18 | $this->on = (boolean)$on; 19 | } 20 | 21 | /** 22 | * {@inheritdoc} 23 | */ 24 | public function checkEncoding($str, $encoding) { 25 | if (!(boolean)$this->on) { 26 | return true; 27 | } 28 | 29 | return $this->validator->checkEncoding($str, $encoding); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/WebSocket/Encoding/ValidatorInterface.php: -------------------------------------------------------------------------------- 1 | WebSocket->closing) { 12 | $this->getConnection()->send(chr(0) . $msg . chr(255)); 13 | } 14 | 15 | return $this; 16 | } 17 | 18 | public function close() { 19 | if (!$this->WebSocket->closing) { 20 | $this->getConnection()->send(chr(255)); 21 | $this->getConnection()->close(); 22 | 23 | $this->WebSocket->closing = true; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/WebSocket/Version/HyBi10.php: -------------------------------------------------------------------------------- 1 | getHeader('Sec-WebSocket-Version'); 8 | 9 | return ($version >= 6 && $version < 13); 10 | } 11 | 12 | public function getVersionNumber() { 13 | return 6; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/WebSocket/Version/MessageInterface.php: -------------------------------------------------------------------------------- 1 | WebSocket->closing) { 16 | if (!($msg instanceof DataInterface)) { 17 | $msg = new Frame($msg); 18 | } 19 | 20 | $this->getConnection()->send($msg->getContents()); 21 | } 22 | 23 | return $this; 24 | } 25 | 26 | /** 27 | * {@inheritdoc} 28 | */ 29 | public function close($code = 1000) { 30 | if ($this->WebSocket->closing) { 31 | return; 32 | } 33 | 34 | if ($code instanceof DataInterface) { 35 | $this->send($code); 36 | } else { 37 | $this->send(new Frame(pack('n', $code), true, Frame::OP_CLOSE)); 38 | } 39 | 40 | $this->getConnection()->close(); 41 | 42 | $this->WebSocket->closing = true; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php: -------------------------------------------------------------------------------- 1 | 1 ? $argv[1] : 8000; 6 | $impl = sprintf('React\EventLoop\%sLoop', $argc > 2 ? $argv[2] : 'StreamSelect'); 7 | 8 | $loop = new $impl; 9 | $sock = new React\Socket\Server($loop); 10 | $web = new Ratchet\WebSocket\WsServer(new Ratchet\Server\EchoServer); 11 | $app = new Ratchet\Http\HttpServer($web); 12 | $web->setEncodingChecks(false); 13 | 14 | $sock->listen($port, '0.0.0.0'); 15 | 16 | $server = new Ratchet\Server\IoServer($app, $sock, $loop); 17 | $server->run(); 18 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/autobahn/bin/fuzzingserver.php: -------------------------------------------------------------------------------- 1 | 1 ? $argv[1] : 8000; 6 | $impl = sprintf('React\EventLoop\%sLoop', $argc > 2 ? $argv[2] : 'StreamSelect'); 7 | 8 | $loop = new $impl; 9 | $sock = new React\Socket\Server($loop); 10 | $app = new Ratchet\Http\HttpServer(new Ratchet\WebSocket\WsServer(new Ratchet\Server\EchoServer)); 11 | 12 | $sock->listen($port, '0.0.0.0'); 13 | 14 | $server = new Ratchet\Server\IoServer($app, $sock, $loop); 15 | $server->run(); 16 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {"failByDrop": false} 3 | , "outdir": "reports/ab" 4 | 5 | , "servers": [ 6 | {"agent": "Ratchet/0.3 libevent", "url": "ws://localhost:8001", "options": {"version": 18}} 7 | , {"agent": "Ratchet/0.3 libev", "url": "ws://localhost:8004", "options": {"version": 18}} 8 | , {"agent": "Ratchet/0.3 streams", "url": "ws://localhost:8002", "options": {"version": 18}} 9 | , {"agent": "Ratchet/0.3 -utf8", "url": "ws://localhost:8003", "options": {"version": 18}} 10 | , {"agent": "AutobahnTestSuite/0.5.9", "url": "ws://localhost:8000", "options": {"version": 18}} 11 | ] 12 | 13 | , "cases": ["*"] 14 | , "exclude-cases": ["1.2.*", "2.3", "2.4", "2.6", "9.2.*", "9.4.*", "9.6.*", "9.8.*"] 15 | , "exclude-agent-cases": {} 16 | } 17 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {"failByDrop": false} 3 | , "outdir": "reports/profile" 4 | 5 | , "servers": [ 6 | {"agent": "Ratchet", "url": "ws://localhost:8000", "options": {"version": 18}} 7 | ] 8 | 9 | , "cases": ["9.7.4"] 10 | , "exclude-cases": ["1.2.*", "2.3", "2.4", "2.6", "9.2.*", "9.4.*", "9.6.*", "9.8.*"] 11 | , "exclude-agent-cases": {} 12 | } 13 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {"failByDrop": false} 3 | , "outdir": "reports/rfc" 4 | 5 | , "servers": [ 6 | {"agent": "Ratchet", "url": "ws://localhost:8000", "options": {"version": 18}} 7 | ] 8 | 9 | , "cases": ["*"] 10 | , "exclude-cases": ["1.2.*", "2.3", "2.4", "2.6", "9.2.*", "9.4.*", "9.6.*", "9.8.*"] 11 | , "exclude-agent-cases": {} 12 | } 13 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | addPsr4('Ratchet\\', __DIR__ . '/helpers/Ratchet'); 5 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php: -------------------------------------------------------------------------------- 1 | last[__FUNCTION__] = func_get_args(); 14 | } 15 | 16 | public function onOpen(ConnectionInterface $conn) { 17 | $this->last[__FUNCTION__] = func_get_args(); 18 | } 19 | 20 | public function onMessage(ConnectionInterface $from, $msg) { 21 | $this->last[__FUNCTION__] = func_get_args(); 22 | } 23 | 24 | public function onClose(ConnectionInterface $conn) { 25 | $this->last[__FUNCTION__] = func_get_args(); 26 | } 27 | 28 | public function onError(ConnectionInterface $conn, \Exception $e) { 29 | $this->last[__FUNCTION__] = func_get_args(); 30 | } 31 | 32 | public function getSubProtocols() { 33 | return $this->protocols; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php: -------------------------------------------------------------------------------- 1 | '' 8 | , 'close' => false 9 | ); 10 | 11 | public $remoteAddress = '127.0.0.1'; 12 | 13 | public function send($data) { 14 | $this->last[__FUNCTION__] = $data; 15 | } 16 | 17 | public function close() { 18 | $this->last[__FUNCTION__] = true; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php: -------------------------------------------------------------------------------- 1 | '' 8 | , 'end' => false 9 | ); 10 | 11 | public function send($data) { 12 | $this->last[__FUNCTION__] = $data; 13 | 14 | $this->getConnection()->send($data); 15 | } 16 | 17 | public function close() { 18 | $this->last[__FUNCTION__] = true; 19 | 20 | $this->getConnection()->close(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php: -------------------------------------------------------------------------------- 1 | protocols; 14 | } 15 | 16 | public function onCall(ConnectionInterface $conn, $id, $procURI, array $params) { 17 | $this->last[__FUNCTION__] = func_get_args(); 18 | } 19 | 20 | public function onSubscribe(ConnectionInterface $conn, $topic) { 21 | $this->last[__FUNCTION__] = func_get_args(); 22 | } 23 | 24 | public function onUnSubscribe(ConnectionInterface $conn, $topic) { 25 | $this->last[__FUNCTION__] = func_get_args(); 26 | } 27 | 28 | public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible) { 29 | $this->last[__FUNCTION__] = func_get_args(); 30 | } 31 | 32 | public function onOpen(ConnectionInterface $conn) { 33 | $this->last[__FUNCTION__] = func_get_args(); 34 | } 35 | 36 | public function onClose(ConnectionInterface $conn) { 37 | $this->last[__FUNCTION__] = func_get_args(); 38 | } 39 | 40 | public function onError(ConnectionInterface $conn, \Exception $e) { 41 | $this->last[__FUNCTION__] = func_get_args(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/helpers/Ratchet/NullComponent.php: -------------------------------------------------------------------------------- 1 | _reqStub = $this->getMock('Guzzle\Http\Message\RequestInterface'); 13 | $this->_reqStub->expects($this->any())->method('getHeader')->will($this->returnValue('localhost')); 14 | 15 | parent::setUp(); 16 | 17 | $this->_serv->allowedOrigins[] = 'localhost'; 18 | } 19 | 20 | protected function doOpen($conn) { 21 | $this->_serv->onOpen($conn, $this->_reqStub); 22 | } 23 | 24 | public function getConnectionClassString() { 25 | return '\Ratchet\ConnectionInterface'; 26 | } 27 | 28 | public function getDecoratorClassString() { 29 | return '\Ratchet\Http\OriginCheck'; 30 | } 31 | 32 | public function getComponentClassString() { 33 | return '\Ratchet\Http\HttpServerInterface'; 34 | } 35 | 36 | public function testCloseOnNonMatchingOrigin() { 37 | $this->_serv->allowedOrigins = array('socketo.me'); 38 | $this->_conn->expects($this->once())->method('close'); 39 | 40 | $this->_serv->onOpen($this->_conn, $this->_reqStub); 41 | } 42 | 43 | public function testOnMessage() { 44 | $this->passthroughMessageTest('Hello World!'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php: -------------------------------------------------------------------------------- 1 | _conn = $this->getMock('\Ratchet\ConnectionInterface'); 11 | $this->_comp = new EchoServer; 12 | } 13 | 14 | public function testMessageEchod() { 15 | $message = 'Tillsonburg, my back still aches when I hear that word.'; 16 | $this->_conn->expects($this->once())->method('send')->with($message); 17 | $this->_comp->onMessage($this->_conn, $message); 18 | } 19 | 20 | public function testErrorClosesConnection() { 21 | ob_start(); 22 | $this->_conn->expects($this->once())->method('close'); 23 | $this->_comp->onError($this->_conn, new \Exception); 24 | ob_end_clean(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/unit/Server/IoConnectionTest.php: -------------------------------------------------------------------------------- 1 | sock = $this->getMock('\\React\\Socket\\ConnectionInterface'); 14 | $this->conn = new IoConnection($this->sock); 15 | } 16 | 17 | public function testCloseBubbles() { 18 | $this->sock->expects($this->once())->method('end'); 19 | $this->conn->close(); 20 | } 21 | 22 | public function testSendBubbles() { 23 | $msg = '6 hour rides are productive'; 24 | 25 | $this->sock->expects($this->once())->method('write')->with($msg); 26 | $this->conn->send($msg); 27 | } 28 | 29 | public function testSendReturnsSelf() { 30 | $this->assertSame($this->conn, $this->conn->send('fluent interface')); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sockets/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php: -------------------------------------------------------------------------------- 1 | _handler = new PhpHandler; 13 | } 14 | 15 | public function serializedProvider() { 16 | return array( 17 | array( 18 | '_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}' 19 | , array( 20 | '_sf2_attributes' => array( 21 | 'hello' => 'world' 22 | , 'last' => 1332872102 23 | ) 24 | , '_sf2_flashes' => array() 25 | ) 26 | ) 27 | ); 28 | } 29 | 30 | /** 31 | * @dataProvider serializedProvider 32 | */ 33 | public function testUnserialize($in, $expected) { 34 | $this->assertEquals($expected, $this->_handler->unserialize($in)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sockets/vendor/composer/autoload_classmap.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/symfony/http-foundation/Resources/stubs/SessionHandlerInterface.php', 10 | ); 11 | -------------------------------------------------------------------------------- /sockets/vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($baseDir . '/src'), 10 | 'Guzzle\\Stream' => array($vendorDir . '/guzzle/stream'), 11 | 'Guzzle\\Parser' => array($vendorDir . '/guzzle/parser'), 12 | 'Guzzle\\Http' => array($vendorDir . '/guzzle/http'), 13 | 'Guzzle\\Common' => array($vendorDir . '/guzzle/common'), 14 | 'Evenement' => array($vendorDir . '/evenement/evenement/src'), 15 | ); 16 | -------------------------------------------------------------------------------- /sockets/vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/symfony/routing'), 10 | 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), 11 | 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), 12 | 'React\\Stream\\' => array($vendorDir . '/react/stream/src'), 13 | 'React\\Socket\\' => array($vendorDir . '/react/socket/src'), 14 | 'React\\EventLoop\\' => array($vendorDir . '/react/event-loop'), 15 | 'Ratchet\\' => array($vendorDir . '/cboden/ratchet/src/Ratchet'), 16 | ); 17 | -------------------------------------------------------------------------------- /sockets/vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | $path) { 28 | $loader->set($namespace, $path); 29 | } 30 | 31 | $map = require __DIR__ . '/autoload_psr4.php'; 32 | foreach ($map as $namespace => $path) { 33 | $loader->setPsr4($namespace, $path); 34 | } 35 | 36 | $classMap = require __DIR__ . '/autoload_classmap.php'; 37 | if ($classMap) { 38 | $loader->addClassMap($classMap); 39 | } 40 | 41 | $loader->register(true); 42 | 43 | return $loader; 44 | } 45 | } 46 | 47 | function composerRequiref1bae5d0275fd9e85e077125df26e481($file) 48 | { 49 | require $file; 50 | } 51 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | vendor 3 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.4 5 | 6 | before_script: 7 | - wget http://getcomposer.org/composer.phar 8 | - php composer.phar install 9 | 10 | script: phpunit --coverage-text 11 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | * 2.0.0 (2012-11-02) 5 | 6 | * Require PHP >=5.4.0 7 | * Added EventEmitterTrait 8 | * Removed EventEmitter2 9 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Igor Wiedler 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "evenement/evenement", 3 | "description": "Événement is a very simple event dispatching library for PHP", 4 | "keywords": ["event-dispatcher", "event-emitter"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Igor Wiedler", 9 | "email": "igor@wiedler.ch" 10 | } 11 | ], 12 | "require": { 13 | "php": ">=5.4.0" 14 | }, 15 | "autoload": { 16 | "psr-0": { 17 | "Evenement": "src" 18 | } 19 | }, 20 | "extra": { 21 | "branch-alias": { 22 | "dev-master": "2.0-dev" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | ./tests/Evenement/ 17 | 18 | 19 | 20 | 21 | 22 | ./src/ 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/src/Evenement/EventEmitter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Evenement; 13 | 14 | class EventEmitter implements EventEmitterInterface 15 | { 16 | use EventEmitterTrait; 17 | } 18 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Evenement; 13 | 14 | interface EventEmitterInterface 15 | { 16 | public function on($event, callable $listener); 17 | public function once($event, callable $listener); 18 | public function removeListener($event, callable $listener); 19 | public function removeAllListeners($event = null); 20 | public function listeners($event); 21 | public function emit($event, array $arguments = []); 22 | } 23 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Evenement\Tests; 13 | 14 | class Listener 15 | { 16 | public function onFoo() 17 | { 18 | } 19 | 20 | public static function onBar() 21 | { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sockets/vendor/evenement/evenement/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | $loader = require __DIR__.'/../vendor/autoload.php'; 13 | $loader->add('Evenement\Tests', __DIR__); 14 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/common/Guzzle/Common/AbstractHasDispatcher.php: -------------------------------------------------------------------------------- 1 | eventDispatcher = $eventDispatcher; 25 | 26 | return $this; 27 | } 28 | 29 | public function getEventDispatcher() 30 | { 31 | if (!$this->eventDispatcher) { 32 | $this->eventDispatcher = new EventDispatcher(); 33 | } 34 | 35 | return $this->eventDispatcher; 36 | } 37 | 38 | public function dispatch($eventName, array $context = array()) 39 | { 40 | return $this->getEventDispatcher()->dispatch($eventName, new Event($context)); 41 | } 42 | 43 | public function addSubscriber(EventSubscriberInterface $subscriber) 44 | { 45 | $this->getEventDispatcher()->addSubscriber($subscriber); 46 | 47 | return $this; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/common/Guzzle/Common/Event.php: -------------------------------------------------------------------------------- 1 | context = $context; 21 | } 22 | 23 | public function getIterator() 24 | { 25 | return new \ArrayIterator($this->context); 26 | } 27 | 28 | public function offsetGet($offset) 29 | { 30 | return isset($this->context[$offset]) ? $this->context[$offset] : null; 31 | } 32 | 33 | public function offsetSet($offset, $value) 34 | { 35 | $this->context[$offset] = $value; 36 | } 37 | 38 | public function offsetExists($offset) 39 | { 40 | return isset($this->context[$offset]); 41 | } 42 | 43 | public function offsetUnset($offset) 44 | { 45 | unset($this->context[$offset]); 46 | } 47 | 48 | public function toArray() 49 | { 50 | return $this->context; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/common/Guzzle/Common/Exception/BadMethodCallException.php: -------------------------------------------------------------------------------- 1 | =5.3.2", 9 | "symfony/event-dispatcher": ">=2.1" 10 | }, 11 | "autoload": { 12 | "psr-0": { "Guzzle\\Common": "" } 13 | }, 14 | "target-dir": "Guzzle/Common", 15 | "extra": { 16 | "branch-alias": { 17 | "dev-master": "3.7-dev" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/http/Guzzle/Http/Exception/ClientErrorResponseException.php: -------------------------------------------------------------------------------- 1 | request = $request; 26 | 27 | return $this; 28 | } 29 | 30 | /** 31 | * Get the request that caused the exception 32 | * 33 | * @return RequestInterface 34 | */ 35 | public function getRequest() 36 | { 37 | return $this->request; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/http/Guzzle/Http/Exception/ServerErrorResponseException.php: -------------------------------------------------------------------------------- 1 | 'Guzzle\Http\Message\Header\CacheControl', 15 | 'link' => 'Guzzle\Http\Message\Header\Link', 16 | ); 17 | 18 | public function createHeader($header, $value = null) 19 | { 20 | $lowercase = strtolower($header); 21 | 22 | return isset($this->mapping[$lowercase]) 23 | ? new $this->mapping[$lowercase]($header, $value) 24 | : new Header($header, $value); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/http/Guzzle/Http/Message/Header/HeaderFactoryInterface.php: -------------------------------------------------------------------------------- 1 | isUrlEncoding()) { 15 | return array($query->encodeValue($key) => implode(',', array_map(array($query, 'encodeValue'), $value))); 16 | } else { 17 | return array($key => implode(',', $value)); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/http/Guzzle/Http/QueryAggregator/DuplicateAggregator.php: -------------------------------------------------------------------------------- 1 | isUrlEncoding()) { 17 | return array($query->encodeValue($key) => array_map(array($query, 'encodeValue'), $value)); 18 | } else { 19 | return array($key => $value); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/http/Guzzle/Http/QueryAggregator/PhpAggregator.php: -------------------------------------------------------------------------------- 1 | $v) { 17 | $k = "{$key}[{$k}]"; 18 | if (is_array($v)) { 19 | $ret = array_merge($ret, self::aggregate($k, $v, $query)); 20 | } else { 21 | $ret[$query->encodeValue($k)] = $query->encodeValue($v); 22 | } 23 | } 24 | 25 | return $ret; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/http/Guzzle/Http/QueryAggregator/QueryAggregatorInterface.php: -------------------------------------------------------------------------------- 1 | =5.3.2", 16 | "guzzle/common": "self.version", 17 | "guzzle/parser": "self.version", 18 | "guzzle/stream": "self.version" 19 | }, 20 | "suggest": { 21 | "ext-curl": "*" 22 | }, 23 | "autoload": { 24 | "psr-0": { "Guzzle\\Http": "" } 25 | }, 26 | "target-dir": "Guzzle/Http", 27 | "extra": { 28 | "branch-alias": { 29 | "dev-master": "3.7-dev" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/parser/Guzzle/Parser/Message/MessageParserInterface.php: -------------------------------------------------------------------------------- 1 | $parts->requestMethod, 20 | 'protocol' => 'HTTP', 21 | 'version' => number_format($parts->httpVersion, 1), 22 | 'headers' => $parts->headers, 23 | 'body' => $parts->body 24 | ); 25 | 26 | $parsed['request_url'] = $this->getUrlPartsFromMessage($parts->requestUrl, $parsed); 27 | 28 | return $parsed; 29 | } 30 | 31 | public function parseResponse($message) 32 | { 33 | if (!$message) { 34 | return false; 35 | } 36 | 37 | $parts = http_parse_message($message); 38 | 39 | return array( 40 | 'protocol' => 'HTTP', 41 | 'version' => number_format($parts->httpVersion, 1), 42 | 'code' => $parts->responseCode, 43 | 'reason_phrase' => $parts->responseStatus, 44 | 'headers' => $parts->headers, 45 | 'body' => $parts->body 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/parser/Guzzle/Parser/UriTemplate/PeclUriTemplate.php: -------------------------------------------------------------------------------- 1 | =5.3.2" 9 | }, 10 | "autoload": { 11 | "psr-0": { "Guzzle\\Parser": "" } 12 | }, 13 | "target-dir": "Guzzle/Parser", 14 | "extra": { 15 | "branch-alias": { 16 | "dev-master": "3.7-dev" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sockets/vendor/guzzle/stream/Guzzle/Stream/StreamRequestFactoryInterface.php: -------------------------------------------------------------------------------- 1 | =5.3.2", 16 | "guzzle/common": "self.version" 17 | }, 18 | "suggest": { 19 | "guzzle/http": "To convert Guzzle request objects to PHP streams" 20 | }, 21 | "autoload": { 22 | "psr-0": { "Guzzle\\Stream": "" } 23 | }, 24 | "target-dir": "Guzzle/Stream", 25 | "extra": { 26 | "branch-alias": { 27 | "dev-master": "3.7-dev" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sockets/vendor/react/event-loop/Factory.php: -------------------------------------------------------------------------------- 1 | eventLoop = $eventLoop; 19 | $this->queue = new SplQueue(); 20 | } 21 | 22 | /** 23 | * Add a callback to be invoked on a future tick of the event loop. 24 | * 25 | * Callbacks are guaranteed to be executed in the order they are enqueued. 26 | * 27 | * @param callable $listener The callback to invoke. 28 | */ 29 | public function add(callable $listener) 30 | { 31 | $this->queue->enqueue($listener); 32 | } 33 | 34 | /** 35 | * Flush the callback queue. 36 | */ 37 | public function tick() 38 | { 39 | // Only invoke as many callbacks as were on the queue when tick() was called. 40 | $count = $this->queue->count(); 41 | 42 | while ($count--) { 43 | call_user_func( 44 | $this->queue->dequeue(), 45 | $this->eventLoop 46 | ); 47 | } 48 | } 49 | 50 | /** 51 | * Check if the next tick queue is empty. 52 | * 53 | * @return boolean 54 | */ 55 | public function isEmpty() 56 | { 57 | return $this->queue->isEmpty(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /sockets/vendor/react/event-loop/Tick/NextTickQueue.php: -------------------------------------------------------------------------------- 1 | eventLoop = $eventLoop; 19 | $this->queue = new SplQueue(); 20 | } 21 | 22 | /** 23 | * Add a callback to be invoked on the next tick of the event loop. 24 | * 25 | * Callbacks are guaranteed to be executed in the order they are enqueued, 26 | * before any timer or stream events. 27 | * 28 | * @param callable $listener The callback to invoke. 29 | */ 30 | public function add(callable $listener) 31 | { 32 | $this->queue->enqueue($listener); 33 | } 34 | 35 | /** 36 | * Flush the callback queue. 37 | */ 38 | public function tick() 39 | { 40 | while (!$this->queue->isEmpty()) { 41 | call_user_func( 42 | $this->queue->dequeue(), 43 | $this->eventLoop 44 | ); 45 | } 46 | } 47 | 48 | /** 49 | * Check if the next tick queue is empty. 50 | * 51 | * @return boolean 52 | */ 53 | public function isEmpty() 54 | { 55 | return $this->queue->isEmpty(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sockets/vendor/react/event-loop/Timer/TimerInterface.php: -------------------------------------------------------------------------------- 1 | =5.4.0" 8 | }, 9 | "suggest": { 10 | "ext-libevent": ">=0.1.0", 11 | "ext-event": "~1.0", 12 | "ext-libev": "*" 13 | }, 14 | "autoload": { 15 | "psr-4": { "React\\EventLoop\\": "" } 16 | }, 17 | "extra": { 18 | "branch-alias": { 19 | "dev-master": "0.4-dev" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sockets/vendor/react/socket/.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | vendor 3 | -------------------------------------------------------------------------------- /sockets/vendor/react/socket/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.4 5 | - 5.5 6 | - 5.6 7 | - hhvm 8 | 9 | matrix: 10 | allow_failures: 11 | - php: hhvm 12 | 13 | before_script: 14 | - composer install --dev --prefer-source 15 | -------------------------------------------------------------------------------- /sockets/vendor/react/socket/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react/socket", 3 | "description": "Library for building an evented socket server.", 4 | "keywords": ["socket"], 5 | "license": "MIT", 6 | "require": { 7 | "php": ">=5.4.0", 8 | "evenement/evenement": "~2.0", 9 | "react/event-loop": "0.4.*", 10 | "react/stream": "0.4.*" 11 | }, 12 | "autoload": { 13 | "psr-4": { 14 | "React\\Socket\\": "src" 15 | } 16 | }, 17 | "extra": { 18 | "branch-alias": { 19 | "dev-master": "0.4-dev" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sockets/vendor/react/socket/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | ./tests/ 17 | 18 | 19 | 20 | 21 | 22 | ./src/ 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sockets/vendor/react/socket/src/Connection.php: -------------------------------------------------------------------------------- 1 | bufferSize); 14 | if ('' !== $data && false !== $data) { 15 | $this->emit('data', array($data, $this)); 16 | } 17 | 18 | if ('' === $data || false === $data || !is_resource($stream) || feof($stream)) { 19 | $this->end(); 20 | } 21 | } 22 | 23 | public function handleClose() 24 | { 25 | if (is_resource($this->stream)) { 26 | // http://chat.stackoverflow.com/transcript/message/7727858#7727858 27 | stream_socket_shutdown($this->stream, STREAM_SHUT_RDWR); 28 | stream_set_blocking($this->stream, false); 29 | fclose($this->stream); 30 | } 31 | } 32 | 33 | public function getRemoteAddress() 34 | { 35 | return $this->parseAddress(stream_socket_get_name($this->stream, true)); 36 | } 37 | 38 | private function parseAddress($address) 39 | { 40 | return trim(substr($address, 0, strrpos($address, ':')), '[]'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sockets/vendor/react/socket/src/ConnectionException.php: -------------------------------------------------------------------------------- 1 | data .= $data; 42 | 43 | return true; 44 | } 45 | 46 | public function end($data = null) 47 | { 48 | } 49 | 50 | public function close() 51 | { 52 | } 53 | 54 | public function getData() 55 | { 56 | return $this->data; 57 | } 58 | 59 | public function getRemoteAddress() 60 | { 61 | return '127.0.0.1'; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sockets/vendor/react/socket/tests/Stub/ServerStub.php: -------------------------------------------------------------------------------- 1 | createCallableMock(); 10 | $mock 11 | ->expects($this->exactly($amount)) 12 | ->method('__invoke'); 13 | 14 | return $mock; 15 | } 16 | 17 | protected function expectCallableOnce() 18 | { 19 | $mock = $this->createCallableMock(); 20 | $mock 21 | ->expects($this->once()) 22 | ->method('__invoke'); 23 | 24 | return $mock; 25 | } 26 | 27 | protected function expectCallableNever() 28 | { 29 | $mock = $this->createCallableMock(); 30 | $mock 31 | ->expects($this->never()) 32 | ->method('__invoke'); 33 | 34 | return $mock; 35 | } 36 | 37 | protected function createCallableMock() 38 | { 39 | return $this->getMock('React\Tests\Socket\Stub\CallableStub'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sockets/vendor/react/socket/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | addPsr4('React\\Tests\\Socket\\', __DIR__); 8 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | vendor 3 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.4 5 | - 5.5 6 | - 5.6 7 | - hhvm 8 | 9 | matrix: 10 | allow_failures: 11 | - php: hhvm 12 | 13 | before_script: 14 | - composer install --dev --prefer-source 15 | 16 | script: 17 | - phpunit --coverage-text 18 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Igor Wiedler, Chris Boden 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react/stream", 3 | "description": "Basic readable and writable stream interfaces that support piping.", 4 | "keywords": ["stream", "pipe"], 5 | "license": "MIT", 6 | "require": { 7 | "php": ">=5.4.0", 8 | "evenement/evenement": "~2.0" 9 | }, 10 | "require-dev": { 11 | "react/event-loop": "0.4.*", 12 | "react/promise": "~2.0" 13 | }, 14 | "suggest": { 15 | "react/event-loop": "0.4.*", 16 | "react/promise": "~2.0" 17 | }, 18 | "autoload": { 19 | "psr-4": { 20 | "React\\Stream\\": "src" 21 | } 22 | }, 23 | "extra": { 24 | "branch-alias": { 25 | "dev-master": "0.5-dev" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | ./tests/ 17 | 18 | 19 | 20 | 21 | 22 | ./src/ 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/src/BufferedSink.php: -------------------------------------------------------------------------------- 1 | deferred = new Deferred(); 16 | 17 | $this->on('pipe', array($this, 'handlePipeEvent')); 18 | $this->on('error', array($this, 'handleErrorEvent')); 19 | } 20 | 21 | public function handlePipeEvent($source) 22 | { 23 | Util::forwardEvents($source, $this, array('error')); 24 | } 25 | 26 | public function handleErrorEvent($e) 27 | { 28 | $this->deferred->reject($e); 29 | } 30 | 31 | public function write($data) 32 | { 33 | $this->buffer .= $data; 34 | $this->deferred->progress($data); 35 | } 36 | 37 | public function close() 38 | { 39 | if ($this->closed) { 40 | return; 41 | } 42 | 43 | parent::close(); 44 | $this->deferred->resolve($this->buffer); 45 | } 46 | 47 | public function promise() 48 | { 49 | return $this->deferred->promise(); 50 | } 51 | 52 | public static function createPromise(ReadableStreamInterface $stream) 53 | { 54 | $sink = new static(); 55 | $stream->pipe($sink); 56 | 57 | return $sink->promise(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/src/DuplexStreamInterface.php: -------------------------------------------------------------------------------- 1 | closed; 14 | } 15 | 16 | public function pause() 17 | { 18 | } 19 | 20 | public function resume() 21 | { 22 | } 23 | 24 | public function pipe(WritableStreamInterface $dest, array $options = array()) 25 | { 26 | Util::pipe($this, $dest, $options); 27 | 28 | return $dest; 29 | } 30 | 31 | public function close() 32 | { 33 | if ($this->closed) { 34 | return; 35 | } 36 | 37 | $this->closed = true; 38 | $this->emit('end', array($this)); 39 | $this->emit('close', array($this)); 40 | $this->removeAllListeners(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/src/ReadableStreamInterface.php: -------------------------------------------------------------------------------- 1 | readable->emit('data', array($this->filter($data), $this)); 23 | } 24 | 25 | public function end($data = null) 26 | { 27 | if (null !== $data) { 28 | $this->readable->emit('data', array($this->filter($data), $this)); 29 | } 30 | 31 | $this->writable->end($data); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/src/Util.php: -------------------------------------------------------------------------------- 1 | emit('pipe', array($source)); 16 | 17 | $source->on('data', function ($data) use ($source, $dest) { 18 | $feedMore = $dest->write($data); 19 | 20 | if (false === $feedMore) { 21 | $source->pause(); 22 | } 23 | }); 24 | 25 | $dest->on('drain', function () use ($source) { 26 | $source->resume(); 27 | }); 28 | 29 | $end = isset($options['end']) ? $options['end'] : true; 30 | if ($end && $source !== $dest) { 31 | $source->on('end', function () use ($dest) { 32 | $dest->end(); 33 | }); 34 | } 35 | } 36 | 37 | public static function forwardEvents($source, $target, array $events) 38 | { 39 | foreach ($events as $event) { 40 | $source->on($event, function () use ($event, $target) { 41 | $target->emit($event, func_get_args()); 42 | }); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/src/WritableStream.php: -------------------------------------------------------------------------------- 1 | write($data); 19 | } 20 | 21 | $this->close(); 22 | } 23 | 24 | public function isWritable() 25 | { 26 | return !$this->closed; 27 | } 28 | 29 | public function close() 30 | { 31 | if ($this->closed) { 32 | return; 33 | } 34 | 35 | $this->closed = true; 36 | $this->emit('end', array($this)); 37 | $this->emit('close', array($this)); 38 | $this->removeAllListeners(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/src/WritableStreamInterface.php: -------------------------------------------------------------------------------- 1 | assertTrue($readable->isReadable()); 14 | } 15 | 16 | /** @test */ 17 | public function pauseShouldDoNothing() 18 | { 19 | $readable = new ReadableStream(); 20 | $readable->pause(); 21 | } 22 | 23 | /** @test */ 24 | public function resumeShouldDoNothing() 25 | { 26 | $readable = new ReadableStream(); 27 | $readable->resume(); 28 | } 29 | 30 | /** @test */ 31 | public function closeShouldClose() 32 | { 33 | $readable = new ReadableStream(); 34 | $readable->close(); 35 | 36 | $this->assertFalse($readable->isReadable()); 37 | } 38 | 39 | /** @test */ 40 | public function doubleCloseShouldWork() 41 | { 42 | $readable = new ReadableStream(); 43 | $readable->close(); 44 | $readable->close(); 45 | 46 | $this->assertFalse($readable->isReadable()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/tests/Stub/ReadableStreamStub.php: -------------------------------------------------------------------------------- 1 | emit('data', array($data)); 24 | } 25 | 26 | // trigger error event 27 | public function error($error) 28 | { 29 | $this->emit('error', array($error)); 30 | } 31 | 32 | // trigger end event 33 | public function end() 34 | { 35 | $this->emit('end', array()); 36 | } 37 | 38 | public function pause() 39 | { 40 | $this->paused = true; 41 | } 42 | 43 | public function resume() 44 | { 45 | $this->paused = false; 46 | } 47 | 48 | public function close() 49 | { 50 | $this->readable = false; 51 | 52 | $this->emit('close'); 53 | } 54 | 55 | public function pipe(WritableStreamInterface $dest, array $options = array()) 56 | { 57 | Util::pipe($this, $dest, $options); 58 | 59 | return $dest; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | createCallableMock(); 10 | $mock 11 | ->expects($this->exactly($amount)) 12 | ->method('__invoke'); 13 | 14 | return $mock; 15 | } 16 | 17 | protected function expectCallableOnce() 18 | { 19 | $mock = $this->createCallableMock(); 20 | $mock 21 | ->expects($this->once()) 22 | ->method('__invoke'); 23 | 24 | return $mock; 25 | } 26 | 27 | protected function expectCallableNever() 28 | { 29 | $mock = $this->createCallableMock(); 30 | $mock 31 | ->expects($this->never()) 32 | ->method('__invoke'); 33 | 34 | return $mock; 35 | } 36 | 37 | protected function createCallableMock() 38 | { 39 | return $this->getMock('React\Tests\Stream\CallableStub'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sockets/vendor/react/stream/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | addPsr4('React\\Tests\\Stream\\', __DIR__); 8 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/event-dispatcher/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | composer.lock 3 | phpunit.xml 4 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/event-dispatcher/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | 2.5.0 5 | ----- 6 | 7 | * added Debug\TraceableEventDispatcher (originally in HttpKernel) 8 | * changed Debug\TraceableEventDispatcherInterface to extend EventDispatcherInterface 9 | * added RegisterListenersPass (originally in HttpKernel) 10 | 11 | 2.1.0 12 | ----- 13 | 14 | * added TraceableEventDispatcherInterface 15 | * added ContainerAwareEventDispatcher 16 | * added a reference to the EventDispatcher on the Event 17 | * added a reference to the Event name on the event 18 | * added fluid interface to the dispatch() method which now returns the Event 19 | object 20 | * added GenericEvent event class 21 | * added the possibility for subscribers to subscribe several times for the 22 | same event 23 | * added ImmutableEventDispatcher 24 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\EventDispatcher\Debug; 13 | 14 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; 15 | 16 | /** 17 | * @author Fabien Potencier 18 | */ 19 | interface TraceableEventDispatcherInterface extends EventDispatcherInterface 20 | { 21 | /** 22 | * Gets the called listeners. 23 | * 24 | * @return array An array of called listeners 25 | */ 26 | public function getCalledListeners(); 27 | 28 | /** 29 | * Gets the not called listeners. 30 | * 31 | * @return array An array of not called listeners 32 | */ 33 | public function getNotCalledListeners(); 34 | } 35 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/event-dispatcher/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2015 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/event-dispatcher/README.md: -------------------------------------------------------------------------------- 1 | EventDispatcher Component 2 | ========================= 3 | 4 | The Symfony EventDispatcher component implements the Mediator pattern in a 5 | simple and effective way to make your projects truly extensible. 6 | 7 | ```php 8 | use Symfony\Component\EventDispatcher\EventDispatcher; 9 | use Symfony\Component\EventDispatcher\Event; 10 | 11 | $dispatcher = new EventDispatcher(); 12 | 13 | $dispatcher->addListener('event_name', function (Event $event) { 14 | // ... 15 | }); 16 | 17 | $dispatcher->dispatch('event_name'); 18 | ``` 19 | 20 | Resources 21 | --------- 22 | 23 | You can run the unit tests with the following command: 24 | 25 | $ cd path/to/Symfony/Component/EventDispatcher/ 26 | $ composer install 27 | $ phpunit 28 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\EventDispatcher\Tests; 13 | 14 | use Symfony\Component\EventDispatcher\EventDispatcher; 15 | 16 | class EventDispatcherTest extends AbstractEventDispatcherTest 17 | { 18 | protected function createEventDispatcher() 19 | { 20 | return new EventDispatcher(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/event-dispatcher/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/event-dispatcher", 3 | "type": "library", 4 | "description": "Symfony EventDispatcher Component", 5 | "keywords": [], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Fabien Potencier", 11 | "email": "fabien@symfony.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.3.9" 20 | }, 21 | "require-dev": { 22 | "symfony/phpunit-bridge": "~2.7", 23 | "symfony/dependency-injection": "~2.6", 24 | "symfony/expression-language": "~2.6", 25 | "symfony/config": "~2.0,>=2.0.5", 26 | "symfony/stopwatch": "~2.3", 27 | "psr/log": "~1.0" 28 | }, 29 | "suggest": { 30 | "symfony/dependency-injection": "", 31 | "symfony/http-kernel": "" 32 | }, 33 | "autoload": { 34 | "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" } 35 | }, 36 | "minimum-stability": "dev", 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "2.7-dev" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/event-dispatcher/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ./Tests/ 16 | 17 | 18 | 19 | 20 | 21 | ./ 22 | 23 | ./Resources 24 | ./Tests 25 | ./vendor 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | composer.lock 3 | phpunit.xml 4 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/ApacheRequest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation; 13 | 14 | /** 15 | * Request represents an HTTP request from an Apache server. 16 | * 17 | * @author Fabien Potencier 18 | */ 19 | class ApacheRequest extends Request 20 | { 21 | /** 22 | * {@inheritdoc} 23 | */ 24 | protected function prepareRequestUri() 25 | { 26 | return $this->server->get('REQUEST_URI'); 27 | } 28 | 29 | /** 30 | * {@inheritdoc} 31 | */ 32 | protected function prepareBaseUrl() 33 | { 34 | $baseUrl = $this->server->get('SCRIPT_NAME'); 35 | 36 | if (false === strpos($this->server->get('REQUEST_URI'), $baseUrl)) { 37 | // assume mod_rewrite 38 | return rtrim(dirname($baseUrl), '/\\'); 39 | } 40 | 41 | return $baseUrl; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/ExpressionRequestMatcher.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation; 13 | 14 | use Symfony\Component\ExpressionLanguage\ExpressionLanguage; 15 | 16 | /** 17 | * ExpressionRequestMatcher uses an expression to match a Request. 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | class ExpressionRequestMatcher extends RequestMatcher 22 | { 23 | private $language; 24 | private $expression; 25 | 26 | public function setExpression(ExpressionLanguage $language, $expression) 27 | { 28 | $this->language = $language; 29 | $this->expression = $expression; 30 | } 31 | 32 | public function matches(Request $request) 33 | { 34 | if (!$this->language) { 35 | throw new \LogicException('Unable to match the request as the expression language is not available.'); 36 | } 37 | 38 | return $this->language->evaluate($this->expression, array( 39 | 'request' => $request, 40 | 'method' => $request->getMethod(), 41 | 'path' => rawurldecode($request->getPathInfo()), 42 | 'host' => $request->getHost(), 43 | 'ip' => $request->getClientIp(), 44 | 'attributes' => $request->attributes->all(), 45 | )) && parent::matches($request); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | /** 15 | * Thrown when the access on a file was denied. 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | class AccessDeniedException extends FileException 20 | { 21 | /** 22 | * Constructor. 23 | * 24 | * @param string $path The path to the accessed file 25 | */ 26 | public function __construct($path) 27 | { 28 | parent::__construct(sprintf('The file %s could not be accessed', $path)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/File/Exception/FileException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | /** 15 | * Thrown when an error occurred in the component File. 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | class FileException extends \RuntimeException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | /** 15 | * Thrown when a file was not found. 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | class FileNotFoundException extends FileException 20 | { 21 | /** 22 | * Constructor. 23 | * 24 | * @param string $path The path to the file that was not found 25 | */ 26 | public function __construct($path) 27 | { 28 | parent::__construct(sprintf('The file "%s" does not exist', $path)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | class UnexpectedTypeException extends FileException 15 | { 16 | public function __construct($value, $expectedType) 17 | { 18 | parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, is_object($value) ? get_class($value) : gettype($value))); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/File/Exception/UploadException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | /** 15 | * Thrown when an error occurred during file upload. 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | class UploadException extends FileException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesserInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\MimeType; 13 | 14 | /** 15 | * Guesses the file extension corresponding to a given mime type. 16 | */ 17 | interface ExtensionGuesserInterface 18 | { 19 | /** 20 | * Makes a best guess for a file extension, given a mime type. 21 | * 22 | * @param string $mimeType The mime type 23 | * 24 | * @return string The guessed extension or NULL, if none could be guessed 25 | */ 26 | public function guess($mimeType); 27 | } 28 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesserInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\MimeType; 13 | 14 | use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; 15 | use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException; 16 | 17 | /** 18 | * Guesses the mime type of a file. 19 | * 20 | * @author Bernhard Schussek 21 | */ 22 | interface MimeTypeGuesserInterface 23 | { 24 | /** 25 | * Guesses the mime type of the file with the given path. 26 | * 27 | * @param string $path The path to the file 28 | * 29 | * @return string The mime type or NULL, if none could be guessed 30 | * 31 | * @throws FileNotFoundException If the file does not exist 32 | * @throws AccessDeniedException If the file could not be read 33 | */ 34 | public function guess($path); 35 | } 36 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2015 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/RequestMatcherInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation; 13 | 14 | /** 15 | * RequestMatcherInterface is an interface for strategies to match a Request. 16 | * 17 | * @author Fabien Potencier 18 | * 19 | * @api 20 | */ 21 | interface RequestMatcherInterface 22 | { 23 | /** 24 | * Decides whether the rule(s) implemented by the strategy matches the supplied request. 25 | * 26 | * @param Request $request The request to check for a match 27 | * 28 | * @return bool true if the request matches, false otherwise 29 | * 30 | * @api 31 | */ 32 | public function matches(Request $request); 33 | } 34 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Session/SessionBagInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session; 13 | 14 | /** 15 | * Session Bag store. 16 | * 17 | * @author Drak 18 | */ 19 | interface SessionBagInterface 20 | { 21 | /** 22 | * Gets this bag's name. 23 | * 24 | * @return string 25 | */ 26 | public function getName(); 27 | 28 | /** 29 | * Initializes the Bag. 30 | * 31 | * @param array $array 32 | */ 33 | public function initialize(array &$array); 34 | 35 | /** 36 | * Gets the storage key for this bag. 37 | * 38 | * @return string 39 | */ 40 | public function getStorageKey(); 41 | 42 | /** 43 | * Clears out data from bag. 44 | * 45 | * @return mixed Whatever data was contained. 46 | */ 47 | public function clear(); 48 | } 49 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Session/Storage/Handler/NativeSessionHandler.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; 13 | 14 | // Adds SessionHandler functionality if available. 15 | // @see http://php.net/sessionhandler 16 | if (PHP_VERSION_ID >= 50400) { 17 | class NativeSessionHandler extends \SessionHandler 18 | { 19 | } 20 | } else { 21 | class NativeSessionHandler 22 | { 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; 13 | 14 | /** 15 | * NullSessionHandler. 16 | * 17 | * Can be used in unit testing or in a situations where persisted sessions are not desired. 18 | * 19 | * @author Drak 20 | * 21 | * @api 22 | */ 23 | class NullSessionHandler implements \SessionHandlerInterface 24 | { 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function open($savePath, $sessionName) 29 | { 30 | return true; 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | */ 36 | public function close() 37 | { 38 | return true; 39 | } 40 | 41 | /** 42 | * {@inheritdoc} 43 | */ 44 | public function read($sessionId) 45 | { 46 | return ''; 47 | } 48 | 49 | /** 50 | * {@inheritdoc} 51 | */ 52 | public function write($sessionId, $data) 53 | { 54 | return true; 55 | } 56 | 57 | /** 58 | * {@inheritdoc} 59 | */ 60 | public function destroy($sessionId) 61 | { 62 | return true; 63 | } 64 | 65 | /** 66 | * {@inheritdoc} 67 | */ 68 | public function gc($maxlifetime) 69 | { 70 | return true; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; 13 | 14 | /** 15 | * NativeProxy. 16 | * 17 | * This proxy is built-in session handlers in PHP 5.3.x 18 | * 19 | * @author Drak 20 | */ 21 | class NativeProxy extends AbstractProxy 22 | { 23 | /** 24 | * Constructor. 25 | */ 26 | public function __construct() 27 | { 28 | // this makes an educated guess as to what the handler is since it should already be set. 29 | $this->saveHandlerName = ini_get('session.save_handler'); 30 | } 31 | 32 | /** 33 | * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. 34 | * 35 | * @return bool False. 36 | */ 37 | public function isWrapper() 38 | { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Tests/File/FakeFile.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Tests\File; 13 | 14 | use Symfony\Component\HttpFoundation\File\File as OrigFile; 15 | 16 | class FakeFile extends OrigFile 17 | { 18 | private $realpath; 19 | 20 | public function __construct($realpath, $path) 21 | { 22 | $this->realpath = $realpath; 23 | parent::__construct($path, false); 24 | } 25 | 26 | public function isReadable() 27 | { 28 | return true; 29 | } 30 | 31 | public function getRealpath() 32 | { 33 | return $this->realpath; 34 | } 35 | 36 | public function getSize() 37 | { 38 | return 42; 39 | } 40 | 41 | public function getMTime() 42 | { 43 | return time(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Tests/File/Fixtures/.unknownextension: -------------------------------------------------------------------------------- 1 | f -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Tests/File/Fixtures/directory/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/sockets/vendor/symfony/http-foundation/Tests/File/Fixtures/directory/.empty -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Tests/File/Fixtures/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/sockets/vendor/symfony/http-foundation/Tests/File/Fixtures/test -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Tests/File/Fixtures/test.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/sockets/vendor/symfony/http-foundation/Tests/File/Fixtures/test.gif -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; 13 | 14 | use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler; 15 | 16 | /** 17 | * Test class for NativeSessionHandler. 18 | * 19 | * @author Drak 20 | * 21 | * @runTestsInSeparateProcesses 22 | * @preserveGlobalState disabled 23 | */ 24 | class NativeSessionHandlerTest extends \PHPUnit_Framework_TestCase 25 | { 26 | public function testConstruct() 27 | { 28 | $handler = new NativeSessionHandler(); 29 | 30 | // note for PHPUnit optimisers - the use of assertTrue/False 31 | // here is deliberate since the tests do not require the classes to exist - drak 32 | if (PHP_VERSION_ID < 50400) { 33 | $this->assertFalse($handler instanceof \SessionHandler); 34 | $this->assertTrue($handler instanceof NativeSessionHandler); 35 | } else { 36 | $this->assertTrue($handler instanceof \SessionHandler); 37 | $this->assertTrue($handler instanceof NativeSessionHandler); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/NativeProxyTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Proxy; 13 | 14 | use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy; 15 | 16 | /** 17 | * Test class for NativeProxy. 18 | * 19 | * @author Drak 20 | */ 21 | class NativeProxyTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function testIsWrapper() 24 | { 25 | $proxy = new NativeProxy(); 26 | $this->assertFalse($proxy->isWrapper()); 27 | } 28 | 29 | public function testGetSaveHandlerName() 30 | { 31 | $name = ini_get('session.save_handler'); 32 | $proxy = new NativeProxy(); 33 | $this->assertEquals($name, $proxy->getSaveHandlerName()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/http-foundation", 3 | "type": "library", 4 | "description": "Symfony HttpFoundation Component", 5 | "keywords": [], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Fabien Potencier", 11 | "email": "fabien@symfony.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.3.9" 20 | }, 21 | "require-dev": { 22 | "symfony/phpunit-bridge": "~2.7", 23 | "symfony/expression-language": "~2.4" 24 | }, 25 | "autoload": { 26 | "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" }, 27 | "classmap": [ "Resources/stubs" ] 28 | }, 29 | "minimum-stability": "dev", 30 | "extra": { 31 | "branch-alias": { 32 | "dev-master": "2.7-dev" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/http-foundation/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ./Tests/ 16 | 17 | 18 | 19 | 20 | 21 | ./ 22 | 23 | ./Resources 24 | ./Tests 25 | ./vendor 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | composer.lock 3 | phpunit.xml 4 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Exception; 13 | 14 | /** 15 | * ExceptionInterface. 16 | * 17 | * @author Alexandre Salomé 18 | * 19 | * @api 20 | */ 21 | interface ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Exception/InvalidParameterException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Exception; 13 | 14 | /** 15 | * Exception thrown when a parameter is not valid. 16 | * 17 | * @author Alexandre Salomé 18 | * 19 | * @api 20 | */ 21 | class InvalidParameterException extends \InvalidArgumentException implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Exception/MethodNotAllowedException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Exception; 13 | 14 | /** 15 | * The resource was found but the request method is not allowed. 16 | * 17 | * This exception should trigger an HTTP 405 response in your application code. 18 | * 19 | * @author Kris Wallsmith 20 | * 21 | * @api 22 | */ 23 | class MethodNotAllowedException extends \RuntimeException implements ExceptionInterface 24 | { 25 | /** 26 | * @var array 27 | */ 28 | protected $allowedMethods = array(); 29 | 30 | public function __construct(array $allowedMethods, $message = null, $code = 0, \Exception $previous = null) 31 | { 32 | $this->allowedMethods = array_map('strtoupper', $allowedMethods); 33 | 34 | parent::__construct($message, $code, $previous); 35 | } 36 | 37 | /** 38 | * Gets the allowed HTTP methods. 39 | * 40 | * @return array 41 | */ 42 | public function getAllowedMethods() 43 | { 44 | return $this->allowedMethods; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Exception/MissingMandatoryParametersException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Exception; 13 | 14 | /** 15 | * Exception thrown when a route cannot be generated because of missing 16 | * mandatory parameters. 17 | * 18 | * @author Alexandre Salomé 19 | * 20 | * @api 21 | */ 22 | class MissingMandatoryParametersException extends \InvalidArgumentException implements ExceptionInterface 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Exception/ResourceNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Exception; 13 | 14 | /** 15 | * The resource was not found. 16 | * 17 | * This exception should trigger an HTTP 404 response in your application code. 18 | * 19 | * @author Kris Wallsmith 20 | * 21 | * @api 22 | */ 23 | class ResourceNotFoundException extends \RuntimeException implements ExceptionInterface 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Exception/RouteNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Exception; 13 | 14 | /** 15 | * Exception thrown when a route does not exist. 16 | * 17 | * @author Alexandre Salomé 18 | * 19 | * @api 20 | */ 21 | class RouteNotFoundException extends \InvalidArgumentException implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Generator\Dumper; 13 | 14 | use Symfony\Component\Routing\RouteCollection; 15 | 16 | /** 17 | * GeneratorDumper is the base class for all built-in generator dumpers. 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | abstract class GeneratorDumper implements GeneratorDumperInterface 22 | { 23 | /** 24 | * @var RouteCollection 25 | */ 26 | private $routes; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param RouteCollection $routes The RouteCollection to dump 32 | */ 33 | public function __construct(RouteCollection $routes) 34 | { 35 | $this->routes = $routes; 36 | } 37 | 38 | /** 39 | * {@inheritdoc} 40 | */ 41 | public function getRoutes() 42 | { 43 | return $this->routes; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Generator\Dumper; 13 | 14 | use Symfony\Component\Routing\RouteCollection; 15 | 16 | /** 17 | * GeneratorDumperInterface is the interface that all generator dumper classes must implement. 18 | * 19 | * @author Fabien Potencier 20 | * 21 | * @api 22 | */ 23 | interface GeneratorDumperInterface 24 | { 25 | /** 26 | * Dumps a set of routes to a string representation of executable code 27 | * that can then be used to generate a URL of such a route. 28 | * 29 | * @param array $options An array of options 30 | * 31 | * @return string Executable code 32 | */ 33 | public function dump(array $options = array()); 34 | 35 | /** 36 | * Gets the routes to dump. 37 | * 38 | * @return RouteCollection A RouteCollection instance 39 | */ 40 | public function getRoutes(); 41 | } 42 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2015 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Loader/ClosureLoader.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Loader; 13 | 14 | use Symfony\Component\Config\Loader\Loader; 15 | use Symfony\Component\Routing\RouteCollection; 16 | 17 | /** 18 | * ClosureLoader loads routes from a PHP closure. 19 | * 20 | * The Closure must return a RouteCollection instance. 21 | * 22 | * @author Fabien Potencier 23 | * 24 | * @api 25 | */ 26 | class ClosureLoader extends Loader 27 | { 28 | /** 29 | * Loads a Closure. 30 | * 31 | * @param \Closure $closure A Closure 32 | * @param string|null $type The resource type 33 | * 34 | * @return RouteCollection A RouteCollection instance 35 | * 36 | * @api 37 | */ 38 | public function load($closure, $type = null) 39 | { 40 | return $closure(); 41 | } 42 | 43 | /** 44 | * {@inheritdoc} 45 | * 46 | * @api 47 | */ 48 | public function supports($resource, $type = null) 49 | { 50 | return $resource instanceof \Closure && (!$type || 'closure' === $type); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Matcher/Dumper/DumperRoute.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Matcher\Dumper; 13 | 14 | use Symfony\Component\Routing\Route; 15 | 16 | /** 17 | * Container for a Route. 18 | * 19 | * @author Arnaud Le Blanc 20 | */ 21 | class DumperRoute 22 | { 23 | /** 24 | * @var string 25 | */ 26 | private $name; 27 | 28 | /** 29 | * @var Route 30 | */ 31 | private $route; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param string $name The route name 37 | * @param Route $route The route 38 | */ 39 | public function __construct($name, Route $route) 40 | { 41 | $this->name = $name; 42 | $this->route = $route; 43 | } 44 | 45 | /** 46 | * Returns the route name. 47 | * 48 | * @return string The route name 49 | */ 50 | public function getName() 51 | { 52 | return $this->name; 53 | } 54 | 55 | /** 56 | * Returns the route. 57 | * 58 | * @return Route The route 59 | */ 60 | public function getRoute() 61 | { 62 | return $this->route; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Matcher\Dumper; 13 | 14 | use Symfony\Component\Routing\RouteCollection; 15 | 16 | /** 17 | * MatcherDumper is the abstract class for all built-in matcher dumpers. 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | abstract class MatcherDumper implements MatcherDumperInterface 22 | { 23 | /** 24 | * @var RouteCollection 25 | */ 26 | private $routes; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param RouteCollection $routes The RouteCollection to dump 32 | */ 33 | public function __construct(RouteCollection $routes) 34 | { 35 | $this->routes = $routes; 36 | } 37 | 38 | /** 39 | * {@inheritdoc} 40 | */ 41 | public function getRoutes() 42 | { 43 | return $this->routes; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Matcher\Dumper; 13 | 14 | use Symfony\Component\Routing\RouteCollection; 15 | 16 | /** 17 | * MatcherDumperInterface is the interface that all matcher dumper classes must implement. 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | interface MatcherDumperInterface 22 | { 23 | /** 24 | * Dumps a set of routes to a string representation of executable code 25 | * that can then be used to match a request against these routes. 26 | * 27 | * @param array $options An array of options 28 | * 29 | * @return string Executable code 30 | */ 31 | public function dump(array $options = array()); 32 | 33 | /** 34 | * Gets the routes to dump. 35 | * 36 | * @return RouteCollection A RouteCollection instance 37 | */ 38 | public function getRoutes(); 39 | } 40 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Matcher; 13 | 14 | /** 15 | * RedirectableUrlMatcherInterface knows how to redirect the user. 16 | * 17 | * @author Fabien Potencier 18 | * 19 | * @api 20 | */ 21 | interface RedirectableUrlMatcherInterface 22 | { 23 | /** 24 | * Redirects the user to another URL. 25 | * 26 | * @param string $path The path info to redirect to. 27 | * @param string $route The route name that matched 28 | * @param string|null $scheme The URL scheme (null to keep the current one) 29 | * 30 | * @return array An array of parameters 31 | * 32 | * @api 33 | */ 34 | public function redirect($path, $route, $scheme = null); 35 | } 36 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Matcher/RequestMatcherInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Matcher; 13 | 14 | use Symfony\Component\HttpFoundation\Request; 15 | use Symfony\Component\Routing\Exception\ResourceNotFoundException; 16 | use Symfony\Component\Routing\Exception\MethodNotAllowedException; 17 | 18 | /** 19 | * RequestMatcherInterface is the interface that all request matcher classes must implement. 20 | * 21 | * @author Fabien Potencier 22 | */ 23 | interface RequestMatcherInterface 24 | { 25 | /** 26 | * Tries to match a request with a set of routes. 27 | * 28 | * If the matcher can not find information, it must throw one of the exceptions documented 29 | * below. 30 | * 31 | * @param Request $request The request to match 32 | * 33 | * @return array An array of parameters 34 | * 35 | * @throws ResourceNotFoundException If no matching resource could be found 36 | * @throws MethodNotAllowedException If a matching resource was found but the request method is not allowed 37 | */ 38 | public function matchRequest(Request $request); 39 | } 40 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Matcher/UrlMatcherInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Matcher; 13 | 14 | use Symfony\Component\Routing\RequestContextAwareInterface; 15 | use Symfony\Component\Routing\Exception\ResourceNotFoundException; 16 | use Symfony\Component\Routing\Exception\MethodNotAllowedException; 17 | 18 | /** 19 | * UrlMatcherInterface is the interface that all URL matcher classes must implement. 20 | * 21 | * @author Fabien Potencier 22 | * 23 | * @api 24 | */ 25 | interface UrlMatcherInterface extends RequestContextAwareInterface 26 | { 27 | /** 28 | * Tries to match a URL path with a set of routes. 29 | * 30 | * If the matcher can not find information, it must throw one of the exceptions documented 31 | * below. 32 | * 33 | * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded) 34 | * 35 | * @return array An array of parameters 36 | * 37 | * @throws ResourceNotFoundException If the resource could not be found 38 | * @throws MethodNotAllowedException If the resource was found but the request method is not allowed 39 | * 40 | * @api 41 | */ 42 | public function match($pathinfo); 43 | } 44 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/README.md: -------------------------------------------------------------------------------- 1 | Routing Component 2 | ================= 3 | 4 | Routing associates a request with the code that will convert it to a response. 5 | 6 | The example below demonstrates how you can set up a fully working routing 7 | system: 8 | 9 | ```php 10 | use Symfony\Component\HttpFoundation\Request; 11 | use Symfony\Component\Routing\Matcher\UrlMatcher; 12 | use Symfony\Component\Routing\RequestContext; 13 | use Symfony\Component\Routing\RouteCollection; 14 | use Symfony\Component\Routing\Route; 15 | 16 | $routes = new RouteCollection(); 17 | $routes->add('hello', new Route('/hello', array('controller' => 'foo'))); 18 | 19 | $context = new RequestContext(); 20 | 21 | // this is optional and can be done without a Request instance 22 | $context->fromRequest(Request::createFromGlobals()); 23 | 24 | $matcher = new UrlMatcher($routes, $context); 25 | 26 | $parameters = $matcher->match('/hello'); 27 | ``` 28 | 29 | Resources 30 | --------- 31 | 32 | You can run the unit tests with the following command: 33 | 34 | $ cd path/to/Symfony/Component/Routing/ 35 | $ composer install 36 | $ phpunit 37 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/RequestContextAwareInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing; 13 | 14 | /** 15 | * @api 16 | */ 17 | interface RequestContextAwareInterface 18 | { 19 | /** 20 | * Sets the request context. 21 | * 22 | * @param RequestContext $context The context 23 | * 24 | * @api 25 | */ 26 | public function setContext(RequestContext $context); 27 | 28 | /** 29 | * Gets the request context. 30 | * 31 | * @return RequestContext The context 32 | * 33 | * @api 34 | */ 35 | public function getContext(); 36 | } 37 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/RouteCompilerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing; 13 | 14 | /** 15 | * RouteCompilerInterface is the interface that all RouteCompiler classes must implement. 16 | * 17 | * @author Fabien Potencier 18 | */ 19 | interface RouteCompilerInterface 20 | { 21 | /** 22 | * Compiles the current route instance. 23 | * 24 | * @param Route $route A Route instance 25 | * 26 | * @return CompiledRoute A CompiledRoute instance 27 | * 28 | * @throws \LogicException If the Route cannot be compiled because the 29 | * path or host pattern is invalid 30 | */ 31 | public static function compile(Route $route); 32 | } 33 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/RouterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing; 13 | 14 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 15 | use Symfony\Component\Routing\Matcher\UrlMatcherInterface; 16 | 17 | /** 18 | * RouterInterface is the interface that all Router classes must implement. 19 | * 20 | * This interface is the concatenation of UrlMatcherInterface and UrlGeneratorInterface. 21 | * 22 | * @author Fabien Potencier 23 | */ 24 | interface RouterInterface extends UrlMatcherInterface, UrlGeneratorInterface 25 | { 26 | /** 27 | * Gets the RouteCollection instance associated with this Router. 28 | * 29 | * @return RouteCollection A RouteCollection instance 30 | */ 31 | public function getRouteCollection(); 32 | } 33 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/CompiledRouteTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Tests; 13 | 14 | use Symfony\Component\Routing\CompiledRoute; 15 | 16 | class CompiledRouteTest extends \PHPUnit_Framework_TestCase 17 | { 18 | public function testAccessors() 19 | { 20 | $compiled = new CompiledRoute('prefix', 'regex', array('tokens'), array(), array(), array(), array(), array('variables')); 21 | $this->assertEquals('prefix', $compiled->getStaticPrefix(), '__construct() takes a static prefix as its second argument'); 22 | $this->assertEquals('regex', $compiled->getRegex(), '__construct() takes a regexp as its third argument'); 23 | $this->assertEquals(array('tokens'), $compiled->getTokens(), '__construct() takes an array of tokens as its fourth argument'); 24 | $this->assertEquals(array('variables'), $compiled->getVariables(), '__construct() takes an array of variables as its ninth argument'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses; 13 | 14 | abstract class AbstractClass 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BarClass.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses; 13 | 14 | class BarClass 15 | { 16 | public function routeAction($arg1, $arg2 = 'defaultValue2', $arg3 = 'defaultValue3') 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooClass.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses; 13 | 14 | class FooClass 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/CustomXmlFileLoader.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Tests\Fixtures; 13 | 14 | use Symfony\Component\Routing\Loader\XmlFileLoader; 15 | use Symfony\Component\Config\Util\XmlUtils; 16 | 17 | /** 18 | * XmlFileLoader with schema validation turned off. 19 | */ 20 | class CustomXmlFileLoader extends XmlFileLoader 21 | { 22 | protected function loadFile($file) 23 | { 24 | return XmlUtils::loadFile($file, function () { return true; }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Tests\Fixtures; 13 | 14 | use Symfony\Component\Routing\Matcher\UrlMatcher; 15 | use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface; 16 | 17 | /** 18 | * @author Fabien Potencier 19 | */ 20 | class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface 21 | { 22 | public function redirect($path, $route, $scheme = null) 23 | { 24 | return array( 25 | '_controller' => 'Some controller reference...', 26 | 'path' => $path, 27 | 'scheme' => $scheme, 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/annotated.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/sockets/vendor/symfony/routing/Tests/Fixtures/annotated.php -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.apache: -------------------------------------------------------------------------------- 1 | # skip "real" requests 2 | RewriteCond %{REQUEST_FILENAME} -f 3 | RewriteRule .* - [QSA,L] 4 | 5 | # foo 6 | RewriteCond %{REQUEST_URI} ^/foo$ 7 | RewriteRule .* ap\ p_d\ ev.php [QSA,L,E=_ROUTING_route:foo] 8 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/empty.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/sockets/vendor/symfony/routing/Tests/Fixtures/empty.yml -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/foo.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/sockets/vendor/symfony/routing/Tests/Fixtures/foo.xml -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/foo1.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackPackerDz/Android-Chat-PHP-Ratchet-sockets/e92ef23a4d35e40551c750cde657a6caad1b2d27/sockets/vendor/symfony/routing/Tests/Fixtures/foo1.xml -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/incomplete.yml: -------------------------------------------------------------------------------- 1 | blog_show: 2 | defaults: { _controller: MyBlogBundle:Blog:show } 3 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/legacy_validpattern.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | MyBundle:Blog:show 9 | 10 | GET|POST|put|OpTiOnS 11 | hTTps 12 | \w+ 13 | 14 | context.getMethod() == "GET" 15 | 16 | 17 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/legacy_validpattern.yml: -------------------------------------------------------------------------------- 1 | blog_show_legacy: 2 | pattern: /blog/{slug} 3 | defaults: { _controller: "MyBundle:Blog:show" } 4 | host: "{locale}.example.com" 5 | requirements: { '_method': 'GET|POST|put|OpTiOnS', _scheme: https, 'locale': '\w+' } 6 | condition: 'context.getMethod() == "GET"' 7 | options: 8 | compiler_class: RouteCompiler 9 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/missing_id.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/missing_path.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/namespaceprefix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | MyBundle:Blog:show 9 | \w+ 10 | en|fr|de 11 | RouteCompiler 12 | 13 | 14 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/nonesense_resource_plus_path.yml: -------------------------------------------------------------------------------- 1 | blog_show: 2 | resource: validpattern.yml 3 | path: /test 4 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/nonesense_type_without_resource.yml: -------------------------------------------------------------------------------- 1 | blog_show: 2 | path: /blog/{slug} 3 | type: custom 4 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/nonvalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | MyBundle:Blog:show 9 | 10 | 11 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/nonvalid.yml: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/nonvalid2.yml: -------------------------------------------------------------------------------- 1 | route: string 2 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/nonvalidkeys.yml: -------------------------------------------------------------------------------- 1 | someroute: 2 | resource: path/to/some.yml 3 | name_prefix: test_ 4 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/nonvalidnode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | bar 8 | 9 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/nonvalidroute.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | MyBundle:Blog:show 9 | 10 | baz 11 | 12 | 13 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/null_values.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | foo 10 | bar 11 | 12 | 13 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/special_route_name.yml: -------------------------------------------------------------------------------- 1 | "#$péß^a|": 2 | path: "true" 3 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/validpattern.php: -------------------------------------------------------------------------------- 1 | add('blog_show', new Route( 8 | '/blog/{slug}', 9 | array('_controller' => 'MyBlogBundle:Blog:show'), 10 | array('locale' => '\w+'), 11 | array('compiler_class' => 'RouteCompiler'), 12 | '{locale}.example.com', 13 | array('https'), 14 | array('GET', 'POST', 'put', 'OpTiOnS'), 15 | 'context.getMethod() == "GET"' 16 | )); 17 | 18 | return $collection; 19 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/validpattern.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | MyBundle:Blog:show 9 | \w+ 10 | 11 | context.getMethod() == "GET" 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/validpattern.yml: -------------------------------------------------------------------------------- 1 | blog_show: 2 | path: /blog/{slug} 3 | defaults: { _controller: "MyBundle:Blog:show" } 4 | host: "{locale}.example.com" 5 | requirements: { 'locale': '\w+' } 6 | methods: ['GET','POST','put','OpTiOnS'] 7 | schemes: ['https'] 8 | condition: 'context.getMethod() == "GET"' 9 | options: 10 | compiler_class: RouteCompiler 11 | 12 | blog_show_inherited: 13 | path: /blog/{slug} 14 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/validresource.php: -------------------------------------------------------------------------------- 1 | import('validpattern.php'); 6 | $collection->addDefaults(array( 7 | 'foo' => 123, 8 | )); 9 | $collection->addRequirements(array( 10 | 'foo' => '\d+', 11 | )); 12 | $collection->addOptions(array( 13 | 'foo' => 'bar', 14 | )); 15 | $collection->setCondition('context.getMethod() == "POST"'); 16 | $collection->addPrefix('/prefix'); 17 | 18 | return $collection; 19 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/validresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 123 9 | \d+ 10 | 11 | context.getMethod() == "POST" 12 | 13 | 14 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/validresource.yml: -------------------------------------------------------------------------------- 1 | _blog: 2 | resource: validpattern.yml 3 | prefix: /{foo} 4 | defaults: { 'foo': '123' } 5 | requirements: { 'foo': '\d+' } 6 | options: { 'foo': 'bar' } 7 | host: "" 8 | condition: 'context.getMethod() == "POST"' 9 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Fixtures/with_define_path_variable.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Loader/AbstractAnnotationLoaderTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Tests\Loader; 13 | 14 | abstract class AbstractAnnotationLoaderTest extends \PHPUnit_Framework_TestCase 15 | { 16 | public function getReader() 17 | { 18 | return $this->getMockBuilder('Doctrine\Common\Annotations\Reader') 19 | ->disableOriginalConstructor() 20 | ->getMock() 21 | ; 22 | } 23 | 24 | public function getClassLoader($reader) 25 | { 26 | return $this->getMockBuilder('Symfony\Component\Routing\Loader\AnnotationClassLoader') 27 | ->setConstructorArgs(array($reader)) 28 | ->getMockForAbstractClass() 29 | ; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/Tests/Matcher/Dumper/DumperCollectionTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Routing\Tests\Matcher\Dumper; 13 | 14 | use Symfony\Component\Routing\Matcher\Dumper\DumperCollection; 15 | 16 | class DumperCollectionTest extends \PHPUnit_Framework_TestCase 17 | { 18 | public function testGetRoot() 19 | { 20 | $a = new DumperCollection(); 21 | 22 | $b = new DumperCollection(); 23 | $a->add($b); 24 | 25 | $c = new DumperCollection(); 26 | $b->add($c); 27 | 28 | $d = new DumperCollection(); 29 | $c->add($d); 30 | 31 | $this->assertSame($a, $c->getRoot()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/routing", 3 | "type": "library", 4 | "description": "Symfony Routing Component", 5 | "keywords": ["routing", "router", "URL", "URI"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Fabien Potencier", 11 | "email": "fabien@symfony.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.3.9" 20 | }, 21 | "require-dev": { 22 | "symfony/phpunit-bridge": "~2.7", 23 | "symfony/config": "~2.7", 24 | "symfony/http-foundation": "~2.3", 25 | "symfony/yaml": "~2.0,>=2.0.5", 26 | "symfony/expression-language": "~2.4", 27 | "doctrine/annotations": "~1.0", 28 | "doctrine/common": "~2.2", 29 | "psr/log": "~1.0" 30 | }, 31 | "conflict": { 32 | "symfony/config": "<2.7" 33 | }, 34 | "suggest": { 35 | "symfony/config": "For using the all-in-one router or any loader", 36 | "symfony/yaml": "For using the YAML loader", 37 | "symfony/expression-language": "For using expression matching", 38 | "doctrine/annotations": "For using the annotation loader" 39 | }, 40 | "autoload": { 41 | "psr-4": { "Symfony\\Component\\Routing\\": "" } 42 | }, 43 | "minimum-stability": "dev", 44 | "extra": { 45 | "branch-alias": { 46 | "dev-master": "2.7-dev" 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sockets/vendor/symfony/routing/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ./Tests/ 16 | 17 | 18 | 19 | 20 | 21 | ./ 22 | 23 | ./vendor 24 | ./Tests 25 | 26 | 27 | 28 | 29 | --------------------------------------------------------------------------------