PHP Interface ManaPHP\Http\Session\AdapterInterface

Afficher le fichier Open project: manaphp/manaphp Interface Usage Examples

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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

clean() public méthode

public clean ( ) : void
Résultat void

close() public méthode

It is also invoked when session_write_close() is called. Return value should be TRUE for success, FALSE for failure.
public close ( ) : boolean
Résultat boolean

destroy() public méthode

Return value should be TRUE for success, FALSE for failure.
public destroy ( string $sessionId ) : boolean
$sessionId string
Résultat boolean

gc() public méthode

Return value should be TRUE for success, FALSE for failure.
public gc ( integer $ttl ) : boolean
$ttl integer
Résultat boolean

open() public méthode

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
Résultat boolean

read() public méthode

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
Résultat string

write() public méthode

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
Résultat void