SymfonyComponentHttpFoundationSessionStorageHandlerMemcachedSessionHandler

MemcachedSessionHandler.

Memcached based session storage handler based on the Memcached class provided by the PHP memcached extension.

Summary

No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
N/A
File
vendorSymfonyComponentHttpFoundationSessionStorageHandlerMemcachedSessionHandler.php
Package
Default
Class hierarchy
SymfonyComponentHttpFoundationSessionStorageHandlerMemcachedSessionHandler
Implements
SessionHandlerInterface
See also

Tags

author

Drak drak@zikula.org

Properties

$memcached

$memcached : \Memcached

Type

Memcached — Memcached driver.

Tags

None found

$ttl

$ttl : integer

Type

integer — Time to live in seconds

Tags

None found

$prefix

$prefix : string

Type

string — Key prefix for shared environments.

Tags

None found

Methods

__construct()

__construct(\Memcached  $memcached, array  $options = array()) 

Constructor.

List of available options:

  • prefix: The prefix to use for the memcached keys in order to avoid collision
  • expiretime: The time to live in seconds

Parameters

Memcached $memcached

A Memcached instance

array $options

An associative array of Memcached options

Throws

InvalidArgumentException

When unsupported options are passed

Tags

None found

open()

open(string  $savePath, string  $sessionName) : boolean

Open session.

Parameters

string $savePath

Save path.

string $sessionName

Session Name.

Returns

boolean

Tags

None found

close()

close() : boolean

Close session.

Returns

boolean

Tags

None found

read()

read(string  $sessionId) : string

Read session.

Parameters

string $sessionId

Returns

string —

String as stored in persistent storage or empty string in all other cases.

Tags

None found

write()

write(string  $sessionId, string  $data) : boolean

Commit session to storage.

Parameters

string $sessionId

Session ID.

string $data

Session serialized data to save.

Returns

boolean

Tags

None found

destroy()

destroy(string  $sessionId) : boolean

Destroys this session.

Parameters

string $sessionId

Session ID.

Returns

boolean

Tags

None found

gc()

gc(integer  $lifetime) : boolean

Garbage collection for storage.

Parameters

integer $lifetime

Max lifetime in seconds to keep sessions stored.

Returns

boolean

Tags

None found