PHP Интерфейс ManaPHP\Http\Session\AdapterInterface

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
__construct ( array $options ) AdapterInterface constructor.
clean ( ) : void
close ( ) : boolean The close callback works like a destructor in classes and is executed after the session write callback has been called.
destroy ( string $sessionId ) : boolean This callback is executed when a session is destroyed with session_destroy() or with session_regenerate_id() with the destroy parameter set to TRUE.
gc ( integer $ttl ) : boolean The value of lifetime which is passed to this callback can be set in session.gc_maxlifetime.
open ( string $savePath, string $sessionName ) : boolean The open callback works like a constructor in classes and is executed when the session is being opened.
read ( $sessionId ) : string The read callback must always return a session encoded (serialized) string, or an empty string if there is no data to read.
write ( string $sessionId, string $data ) : void The write callback is called when the session needs to be saved and closed.

Описание методов

__construct() публичный Метод

AdapterInterface constructor.
public __construct ( array $options )
$options array

clean() публичный Метод

public clean ( ) : void
Результат void

close() публичный Метод

It is also invoked when session_write_close() is called. Return value should be TRUE for success, FALSE for failure.
public close ( ) : boolean
Результат boolean

destroy() публичный Метод

Return value should be TRUE for success, FALSE for failure.
public destroy ( string $sessionId ) : boolean
$sessionId string
Результат boolean

gc() публичный Метод

Return value should be TRUE for success, FALSE for failure.
public gc ( integer $ttl ) : boolean
$ttl integer
Результат boolean

open() публичный Метод

It is the first callback function executed when the session is started automatically or manually with session_start(). Return value is TRUE for success, FALSE for failure.
public open ( string $savePath, string $sessionName ) : boolean
$savePath string
$sessionName string
Результат boolean

read() публичный Метод

The read callback must always return a session encoded (serialized) string, or an empty string if there is no data to read.
public read ( $sessionId ) : string
$sessionId
Результат string

write() публичный Метод

The serialized session data passed to this callback should be stored against the passed session ID. When retrieving this data, the read callback must return the exact value that was originally passed to the write callback.
public write ( string $sessionId, string $data ) : void
$sessionId string
$data string
Результат void