VuFind API Documentation

File extends AbstractBase
in package

File-based session handler

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$dbServiceManager  : PluginManager
Database service plugin manager
$lifetime  : int
Session lifetime in seconds
$path  : string
Path to session file
$tableManager  : PluginManager
Database table plugin manager
$writesDisabled  : bool
Whether writes are disabled, i.e. any changes to the session are not written to the storage
__construct()  : mixed
Constructor
close()  : bool
Close function, this works like a destructor in classes and is executed when the session operation is done.
destroy()  : bool
The destroy handler, this is executed when a session is destroyed with session_destroy() and takes the session id as its only parameter.
disableWrites()  : void
Disable session writing, i.e. make it read-only
enableWrites()  : void
Enable session writing (default)
gc()  : bool
The garbage collector, this is executed when the session garbage collector is executed and takes the max session lifetime as its only parameter.
getDbService()  : T
Get a database service object.
getDbServiceManager()  : PluginManager
Get the service plugin manager. Throw an exception if it is missing.
getDbTable()  : Gateway
Get a database table object.
getDbTableManager()  : PluginManager
Get the table plugin manager. Throw an exception if it is missing.
open()  : bool
Open function, this works like a constructor in classes and is executed when the session is being opened.
read()  : string
Read function must return string value always to make save handler work as expected. Return empty string if there is no data to read.
setDbServiceManager()  : void
Set the service plugin manager.
setDbTableManager()  : void
Set the table plugin manager.
write()  : bool
Write function that is called when session data is to be saved.
saveSession()  : bool
A function that is called internally when session data is to be saved.

Properties

$lifetime

Session lifetime in seconds

protected int $lifetime = 3600

$path

Path to session file

protected string $path

$writesDisabled

Whether writes are disabled, i.e. any changes to the session are not written to the storage

protected bool $writesDisabled = false

Methods

__construct()

Constructor

public __construct([Config $config = null ]) : mixed
Parameters
$config : Config = null

Session configuration ([Session] section of config.ini)

Return values
mixed

close()

Close function, this works like a destructor in classes and is executed when the session operation is done.

public close() : bool
Return values
bool

destroy()

The destroy handler, this is executed when a session is destroyed with session_destroy() and takes the session id as its only parameter.

public destroy(string $sessId) : bool
Parameters
$sessId : string

The session ID to destroy

Return values
bool

disableWrites()

Disable session writing, i.e. make it read-only

public disableWrites() : void
Return values
void

enableWrites()

Enable session writing (default)

public enableWrites() : void
Return values
void

gc()

The garbage collector, this is executed when the session garbage collector is executed and takes the max session lifetime as its only parameter.

public gc(int $maxlifetime) : bool
Parameters
$maxlifetime : int

Maximum session lifetime.

Return values
bool

getDbService()

Get a database service object.

public getDbService(class-string<\VuFind\Db\Service\T> $name) : T
Parameters
$name : class-string<\VuFind\Db\Service\T>

Name of service to retrieve

Tags
template

T

Return values
T

getDbTable()

Get a database table object.

public getDbTable(string $table) : Gateway
Parameters
$table : string

Table to load.

Return values
Gateway

open()

Open function, this works like a constructor in classes and is executed when the session is being opened.

public open(string $sess_path, string $sess_name) : bool
Parameters
$sess_path : string

Session save path

$sess_name : string

Session name

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
bool

read()

Read function must return string value always to make save handler work as expected. Return empty string if there is no data to read.

public read(string $sessId) : string
Parameters
$sessId : string

The session ID to read

Return values
string

write()

Write function that is called when session data is to be saved.

public write(string $sessId, string $data) : bool
Parameters
$sessId : string

The current session ID

$data : string

The session data to write

Return values
bool

saveSession()

A function that is called internally when session data is to be saved.

protected saveSession(string $sessId, string $data) : bool
Parameters
$sessId : string

The current session ID

$data : string

The session data to write

Return values
bool

Search results