Overview

Namespaces

  • Evenement
  • None
  • PHP
  • Psr
    • Http
      • Message
  • Ratchet
    • Http
    • RFC6455
      • Handshake
      • Messaging
    • Server
    • Session
      • Serialize
      • Storage
        • Proxy
    • Wamp
    • WebSocket
  • React
    • EventLoop
      • Tick
      • Timer
    • Socket
    • Stream
  • Symfony
    • Component
      • HttpFoundation
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
      • Routing
        • Annotation
        • Exception
        • Generator
          • Dumper
        • Loader
          • DependencyInjection
        • Matcher
          • Dumper
        • Tests
          • Annotation
          • Fixtures
            • AnnotatedClasses
            • OtherAnnotatedClasses
          • Generator
            • Dumper
          • Loader
          • Matcher
            • Dumper

Classes

  • SessionProvider
  • Overview
  • Namespace
  • Class
  • Tree

Class SessionProvider

This component will allow access to session data from your website for each user connected Symfony HttpFoundation is required for this component to work Your website must also use Symfony HttpFoundation Sessions to read your sites session data If your are not using at least PHP 5.4 you must include a SessionHandlerInterface stub (is included in Symfony HttpFoundation, loaded w/ composer)

Ratchet\Session\SessionProvider implements Ratchet\Http\HttpServerInterface
Namespace: Ratchet\Session
Located at Ratchet/Session/SessionProvider.php
Methods summary
public
# __construct( Ratchet\Http\HttpServerInterface $app, SessionHandlerInterface $handler, array $options = array(), Ratchet\Session\Serialize\HandlerInterface $serializer = null )

Parameters

$app
Ratchet\Http\HttpServerInterface
$app
$handler
SessionHandlerInterface
$handler
$options
array
$options
$serializer
Ratchet\Session\Serialize\HandlerInterface
$serializer

Throws

RuntimeException
public
# onOpen( Ratchet\ConnectionInterface $conn, Psr\Http\Message\RequestInterface $request = null )

Parameters

$conn
Ratchet\ConnectionInterface
$conn
$request
Psr\Http\Message\RequestInterface
$request null is default because PHP won't let me overload; don't pass null!!!

Throws

UnexpectedValueException
if a RequestInterface is not passed

Implementation of

Ratchet\Http\HttpServerInterface::onOpen()
public
# onMessage( Ratchet\ConnectionInterface $from, string $msg )

Triggered when a client sends data through the socket

Triggered when a client sends data through the socket

Parameters

$from
Ratchet\ConnectionInterface
$from The socket/connection that sent the message to your application
$msg
string
$msg The message received

Throws

Exception

Implementation of

Ratchet\MessageInterface::onMessage()
public
# onClose( Ratchet\ConnectionInterface $conn )

This is called before or after a socket is closed (depends on how it's closed). SendMessage to $conn will not result in an error if it has already been closed.

This is called before or after a socket is closed (depends on how it's closed). SendMessage to $conn will not result in an error if it has already been closed.

Parameters

$conn
Ratchet\ConnectionInterface
$conn The socket/connection that is closing/closed

Throws

Exception

Implementation of

Ratchet\ComponentInterface::onClose()
public
# onError( Ratchet\ConnectionInterface $conn, Exception $e )

If there is an error with one of the sockets, or somewhere in the application where an Exception is thrown, the Exception is sent back down the stack, handled by the Server and bubbled back up the application through this method

If there is an error with one of the sockets, or somewhere in the application where an Exception is thrown, the Exception is sent back down the stack, handled by the Server and bubbled back up the application through this method

Parameters

$conn
Ratchet\ConnectionInterface
$conn
$e
Exception
$e

Throws

Exception

Implementation of

Ratchet\ComponentInterface::onError()
protected array
# setOptions( array $options )

Set all the php session. ini options © Symfony

Set all the php session. ini options © Symfony

Parameters

$options
array
$options

Returns

array
protected string
# toClassCase( string $langDef )

Parameters

$langDef
string
$langDef Input to convert

Returns

string
Properties summary
protected Ratchet\MessageComponentInterface $_app
#
protected SessionHandlerInterface $_handler
#

Selected handler storage assigned by the developer

Selected handler storage assigned by the developer

protected SessionHandlerInterface $_null
#

Null storage handler if no previous session was found

Null storage handler if no previous session was found

protected Ratchet\Session\Serialize\HandlerInterface $_serializer
#
Ratchet API documentation generated by ApiGen 2.8.0