Documentation

MemcachedSessionHandler extends AbstractSessionHandler
in package

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

Tags
see
https://php.net/memcached
author

Drak drak@zikula.org

Table of Contents

Properties

$igbinaryEmptyData  : string
$memcached  : mixed
$newSessionId  : string|null
$prefetchData  : string
$prefetchId  : string
$prefix  : string
Key prefix for shared environments.
$sessionName  : string
$ttl  : int|null
Time to live in seconds.

Methods

__construct()  : mixed
Constructor.
close()  : bool
destroy()  : bool
gc()  : int|false
open()  : bool
read()  : string
updateTimestamp()  : bool
validateId()  : bool
write()  : bool
doDestroy()  : bool
doRead()  : string
doWrite()  : bool
getMemcached()  : Memcached
Return a Memcached instance.
getCompatibleTtl()  : int

Properties

Methods

__construct()

Constructor.

public __construct(Memcached $memcached[, array<string|int, mixed> $options = [] ]) : mixed

List of available options:

  • prefix: The prefix to use for the memcached keys in order to avoid collision
  • ttl: The time to live in seconds.
Parameters
$memcached : Memcached
$options : array<string|int, mixed> = []
Tags
throws
InvalidArgumentException

When unsupported options are passed

destroy()

public destroy(string $sessionId) : bool
Parameters
$sessionId : string
Return values
bool

gc()

public gc(int $maxlifetime) : int|false
Parameters
$maxlifetime : int
Return values
int|false

open()

public open(string $savePath, string $sessionName) : bool
Parameters
$savePath : string
$sessionName : string
Return values
bool

read()

public read(string $sessionId) : string
Parameters
$sessionId : string
Return values
string

updateTimestamp()

public updateTimestamp(string $sessionId, string $data) : bool
Parameters
$sessionId : string
$data : string
Return values
bool

validateId()

public validateId(string $sessionId) : bool
Parameters
$sessionId : string
Return values
bool

write()

public write(string $sessionId, string $data) : bool
Parameters
$sessionId : string
$data : string
Return values
bool

doDestroy()

protected doDestroy(string $sessionId) : bool
Parameters
$sessionId : string
Return values
bool

doRead()

protected doRead(string $sessionId) : string
Parameters
$sessionId : string
Return values
string

doWrite()

protected doWrite(string $sessionId, string $data) : bool
Parameters
$sessionId : string
$data : string
Return values
bool

getMemcached()

Return a Memcached instance.

protected getMemcached() : Memcached
Return values
Memcached

        
On this page

Search results