Documentation

SessionCache extends AbstractCache
in package

Cache class for PSR-16 compatible "Simple Cache" implementation using session backend.

Table of Contents

Constants

LIFETIME  = 1
VALUE  = 0

Properties

$defaultLifetime  : int|null
$miss  : stdClass
$namespace  : string
$validation  : bool

Methods

__construct()  : mixed
clear()  : bool
delete()  : bool
deleteMultiple()  : bool
doClear()  : bool
doDelete()  : bool
doDeleteMultiple()  : bool
doGet()  : mixed
doGetMultiple()  : array<string|int, mixed>
doHas()  : bool
doSet()  : bool
doSetMultiple()  : bool
get()  : mixed|null
getMultiple()  : iterable<string|int, mixed>
getNamespace()  : string
has()  : bool
set()  : bool
setMultiple()  : bool
setValidation()  : void
convertTtl()  : int|null
doGetStored()  : mixed|null
getDefaultLifetime()  : int|null
init()  : void
Always call from constructor.
validateKey()  : void
validateKeys()  : void

Constants

Properties

$defaultLifetime

private int|null $defaultLifetime = null

Methods

__construct()

public __construct([string $namespace = '' ][, null|int|DateInterval $defaultLifetime = null ]) : mixed
Parameters
$namespace : string = ''
$defaultLifetime : null|int|DateInterval = null
Tags
throws
InvalidArgumentException

clear()

public clear() : bool
Return values
bool

deleteMultiple()

public deleteMultiple(iterable<string|int, mixed> $keys) : bool
Parameters
$keys : iterable<string|int, mixed>
Tags
throws
InvalidArgumentException
Return values
bool

doDelete()

public doDelete(string $key) : bool
Parameters
$key : string
Return values
bool

doDeleteMultiple()

public doDeleteMultiple(array<string|int, mixed> $keys) : bool
Parameters
$keys : array<string|int, mixed>
Return values
bool

doGet()

public doGet(string $key, mixed $miss) : mixed
Parameters
$key : string
$miss : mixed

doGetMultiple()

public doGetMultiple(array<string|int, mixed> $keys, mixed $miss) : array<string|int, mixed>
Parameters
$keys : array<string|int, mixed>
$miss : mixed
Return values
array<string|int, mixed>

doHas()

public doHas(string $key) : bool
Parameters
$key : string
Return values
bool

doSet()

public doSet(string $key, mixed $value, int $ttl) : bool
Parameters
$key : string
$value : mixed
$ttl : int
Return values
bool

doSetMultiple()

public doSetMultiple(array<string|int, mixed> $values, int|null $ttl) : bool
Parameters
$values : array<string|int, mixed>
$ttl : int|null
Return values
bool

get()

public get(string $key[, mixed|null $default = null ]) : mixed|null
Parameters
$key : string
$default : mixed|null = null
Tags
throws
InvalidArgumentException
Return values
mixed|null

getMultiple()

public getMultiple(iterable<string|int, mixed> $keys[, mixed|null $default = null ]) : iterable<string|int, mixed>
Parameters
$keys : iterable<string|int, mixed>
$default : mixed|null = null
Tags
throws
InvalidArgumentException
Return values
iterable<string|int, mixed>

getNamespace()

public getNamespace() : string
Return values
string

set()

public set(string $key, mixed $value[, null|int|DateInterval $ttl = null ]) : bool
Parameters
$key : string
$value : mixed
$ttl : null|int|DateInterval = null
Tags
throws
InvalidArgumentException
Return values
bool

setMultiple()

public setMultiple(iterable<string|int, mixed> $values[, null|int|DateInterval $ttl = null ]) : bool
Parameters
$values : iterable<string|int, mixed>
$ttl : null|int|DateInterval = null
Tags
throws
InvalidArgumentException
Return values
bool

setValidation()

public setValidation(bool $validation) : void
Parameters
$validation : bool

convertTtl()

protected convertTtl(null|int|DateInterval $ttl) : int|null
Parameters
$ttl : null|int|DateInterval
Tags
throws
InvalidArgumentException
Return values
int|null

doGetStored()

protected doGetStored(string $key) : mixed|null
Parameters
$key : string
Return values
mixed|null

getDefaultLifetime()

protected getDefaultLifetime() : int|null
Return values
int|null

init()

Always call from constructor.

protected init([string $namespace = '' ][, null|int|DateInterval $defaultLifetime = null ]) : void
Parameters
$namespace : string = ''
$defaultLifetime : null|int|DateInterval = null
Tags
throws
InvalidArgumentException

        
On this page

Search results