PHP 클래스 lithium\storage\session\adapter\Php

This adapter provides basic support for write, read and delete session handling, as well as allowing these three methods to be filtered as per the Lithium filtering system.
상속: extends lithium\core\Object
파일 보기 프로젝트 열기: unionofrad/lithium 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_defaults Default ini settings for this session adapter. Will disabl cookie lifetime, set cookies to HTTP only and the cache_limiter to 'nocache'.

공개 메소드들

메소드 설명
__construct ( array $config = [] ) : void Constructor. Takes care of setting appropriate configurations for this object. Also sets session ini settings.
check ( string $key, array $options = [] ) : Closure Checks if a value has been set in the session.
clear ( array $options = [] ) : Closure Clears all keys from the session.
delete ( string $key, array $options = [] ) : Closure Delete value from the session
enabled ( ) : boolean Determines if PHP sessions are enabled.
isStarted ( ) : boolean Obtain the status of the session.
key ( string $key = null ) : mixed Sets or obtains the session ID.
overwrite ( array &$old, array $new ) : boolean Overwrites session keys and values.
read ( null | string $key = null, array $options = [] ) : Closure Read a value from the session.
write ( string $key, mixed $value, array $options = [] ) : Closure Write a value to the session.

보호된 메소드들

메소드 설명
_init ( ) Initialization of the session.
_start ( ) : boolean Starts the session.

메소드 상세

__construct() 공개 메소드

Constructor. Takes care of setting appropriate configurations for this object. Also sets session ini settings.
또한 보기: lithium\storage\session\adapter\Php::$_defaults
public __construct ( array $config = [] ) : void
$config array Configuration options matching the pattern `'session.*'` are interpreted as session ini settings. Please consult the PHP documentation for further information. A few ini settings are set by default here and will overwrite those from your php.ini. To disable sending a cache limiter set `'session.cache_limiter'` to `false`.
리턴 void

_init() 보호된 메소드

Initialization of the session.
protected _init ( )

_start() 보호된 메소드

Starts the session.
protected _start ( ) : boolean
리턴 boolean `true` if session successfully started (or has already been started), `false` otherwise.

check() 공개 메소드

Checks if a value has been set in the session.
public check ( string $key, array $options = [] ) : Closure
$key string Key of the entry to be checked.
$options array Options array. Not used for this adapter method.
리턴 Closure Function returning boolean `true` if the key exists, `false` otherwise.

clear() 공개 메소드

Clears all keys from the session.
public clear ( array $options = [] ) : Closure
$options array Options array. Not used for this adapter method.
리턴 Closure Function returning boolean `true` on successful clear, `false` otherwise.

delete() 공개 메소드

Delete value from the session
public delete ( string $key, array $options = [] ) : Closure
$key string The key to be deleted.
$options array Options array. Not used for this adapter method.
리턴 Closure Function returning boolean `true` if the key no longer exists in the session, `false` otherwise

enabled() 공개 정적인 메소드

Determines if PHP sessions are enabled.
public static enabled ( ) : boolean
리턴 boolean Returns `true` if enabled (PHP session functionality can be disabled completely), `false` otherwise.

isStarted() 공개 메소드

Obtain the status of the session.
public isStarted ( ) : boolean
리턴 boolean True if a session is currently started, False otherwise. If PHP 5.4 then we know, if PHP 5.3 then we cannot tell for sure if a session has been closed.

key() 공개 메소드

Sets or obtains the session ID.
public key ( string $key = null ) : mixed
$key string Optional. If specified, sets the session ID to the value of `$key`.
리턴 mixed Session ID, or `null` if the session has not been started.

overwrite() 공개 메소드

Overwrites session keys and values.
public overwrite ( array &$old, array $new ) : boolean
$old array Reference to the array that needs to be overwritten. Will usually be `$_SESSION`.
$new array The data that should overwrite the keys/values in `$old`.
리턴 boolean Always `true`.

read() 공개 메소드

Read a value from the session.
public read ( null | string $key = null, array $options = [] ) : Closure
$key null | string Key of the entry to be read. If no key is passed, all current session data is returned.
$options array Options array. Not used for this adapter method.
리턴 Closure Function returning data in the session if successful, `false` otherwise.

write() 공개 메소드

Write a value to the session.
public write ( string $key, mixed $value, array $options = [] ) : Closure
$key string Key of the item to be stored.
$value mixed The value to be stored.
$options array Options array. Not used for this adapter method.
리턴 Closure Function returning boolean `true` on successful write, `false` otherwise.

프로퍼티 상세

$_defaults 보호되어 있는 프로퍼티

Default ini settings for this session adapter. Will disabl cookie lifetime, set cookies to HTTP only and the cache_limiter to 'nocache'.
protected $_defaults