Documentation

StandardSessionConnection
in package
implements SessionConnectionInterface Uses SessionConnectionConfigTrait

The standard connection performs the read and write operations to DynamoDB.

Interfaces, Classes and Traits

SessionConnectionInterface
The session connection provides the underlying logic for interacting with Amazon DynamoDB and performs all of the reading and writing operations.

Table of Contents

$batchConfig  : string
$client  : DynamoDbClient
$consistentRead  : string
$dataAttribute  : string
$dataAttributeType  : string
$hashKey  : string
$locking  : bool
$maxLockRetryMicrotime  : int
$maxLockWaitTime  : int
$minLockRetryMicrotime  : int
$sessionLifetime  : int
$sessionLifetimeAttribute  : string
$tableName  : string
__construct()  : mixed
delete()  : bool
Deletes session record from DynamoDB
deleteExpired()  : bool
Performs garbage collection on the sessions stored in the DynamoDB
getBatchConfig()  : mixed
getDataAttribute()  : string
getDataAttributeType()  : string
getHashKey()  : string
getMaxLockRetryMicrotime()  : number
getMaxLockWaitTime()  : number
getMinLockRetryMicrotime()  : number
getSessionLifetime()  : number
getSessionLifetimeAttribute()  : string
getTableName()  : string
initConfig()  : mixed
It initialize the Config class and it sets values in case of valid configurations.
isConsistentRead()  : bool
isLocking()  : bool
read()  : array<string|int, mixed>
Reads session data from DynamoDB
setBatchConfig()  : mixed
setConsistentRead()  : mixed
setDataAttribute()  : mixed
setDataAttributeType()  : mixed
setHashKey()  : mixed
setLocking()  : mixed
setMaxLockRetryMicrotime()  : mixed
setMaxLockWaitTime()  : mixed
setMinLockRetryMicrotime()  : mixed
setSessionLifetime()  : mixed
setSessionLifetimeAttribute()  : mixed
setTableName()  : mixed
write()  : bool
Writes session data to DynamoDB
formatKey()  : array<string|int, mixed>
triggerError()  : bool

Properties

$dataAttributeType

protected string $dataAttributeType = 'string'

Type of the data attribute in table. Default: "string"

$sessionLifetimeAttribute

protected string $sessionLifetimeAttribute = 'expires'

Name of the session life time attribute in table. Default: "expires"

Methods

delete()

Deletes session record from DynamoDB

public delete(mixed $id) : bool
Parameters
$id : mixed

Session ID

Return values
bool

deleteExpired()

Performs garbage collection on the sessions stored in the DynamoDB

public deleteExpired() : bool
Return values
bool

initConfig()

It initialize the Config class and it sets values in case of valid configurations.

public initConfig([array<string|int, mixed> $config = [] ]) : mixed

It transforms parameters underscore separated in camelcase "this_is_a_test" => ThisIsATest and it uses it in order to set the values.

Parameters
$config : array<string|int, mixed> = []
Return values
mixed

read()

Reads session data from DynamoDB

public read(mixed $id) : array<string|int, mixed>
Parameters
$id : mixed

Session ID

Return values
array<string|int, mixed>

setBatchConfig()

public setBatchConfig(mixed $batchConfig) : mixed
Parameters
$batchConfig : mixed
Return values
mixed

setConsistentRead()

public setConsistentRead(bool $consistentRead) : mixed
Parameters
$consistentRead : bool
Return values
mixed

setDataAttribute()

public setDataAttribute(string $dataAttribute) : mixed
Parameters
$dataAttribute : string
Return values
mixed

setDataAttributeType()

public setDataAttributeType(string $dataAttributeType) : mixed
Parameters
$dataAttributeType : string
Return values
mixed

setMaxLockRetryMicrotime()

public setMaxLockRetryMicrotime(number $maxLockRetryMicrotime) : mixed
Parameters
$maxLockRetryMicrotime : number
Return values
mixed

setMaxLockWaitTime()

public setMaxLockWaitTime(number $maxLockWaitTime) : mixed
Parameters
$maxLockWaitTime : number
Return values
mixed

setMinLockRetryMicrotime()

public setMinLockRetryMicrotime(number $minLockRetryMicrotime) : mixed
Parameters
$minLockRetryMicrotime : number
Return values
mixed

setSessionLifetime()

public setSessionLifetime(number $sessionLifetime) : mixed
Parameters
$sessionLifetime : number
Return values
mixed

setSessionLifetimeAttribute()

public setSessionLifetimeAttribute(string $sessionLifetimeAttribute) : mixed
Parameters
$sessionLifetimeAttribute : string
Return values
mixed

write()

Writes session data to DynamoDB

public write(mixed $id, mixed $data, mixed $isChanged) : bool
Parameters
$id : mixed

Session ID

$data : mixed

Serialized session data

$isChanged : mixed

Whether or not the data has changed

Return values
bool

formatKey()

protected formatKey(string $key) : array<string|int, mixed>
Parameters
$key : string
Return values
array<string|int, mixed>

triggerError()

protected triggerError(string $error) : bool
Parameters
$error : string
Return values
bool

Search results