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

This adapter provides basic support for write, read and delete cookie 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 settings for this session adapter.

공개 메소드들

메소드 설명
__construct ( array $config = [] ) : void Constructor.
check ( string $key ) : Closure Checks if a value has been set in the cookie.
clear ( array $options = [] ) : boolean Clears all cookies.
delete ( string $key, array $options = [] ) : Closure Delete a value from the cookie store.
isEnabled ( ) : boolean Determines if cookies are enabled.
isStarted ( ) : boolean Obtain the status of the cookie storage.
key ( ) : string Obtain the top-level cookie key.
keyFormat ( string $name, array $config ) : string Formats the given $name argument for use in the cookie adapter.
read ( null | string $key = null, array $options = [] ) : Closure Read a value from the cookie.
write ( string $key, mixed $value = null, array $options = [] ) : Closure Write a value to the cookie store.

메소드 상세

__construct() 공개 메소드

Takes care of setting appropriate configurations for this object.
public __construct ( array $config = [] ) : void
$config array Optional configuration parameters.
리턴 void

check() 공개 메소드

Checks if a value has been set in the cookie.
public check ( string $key ) : Closure
$key string Key of the entry to be checked.
리턴 Closure Function returning boolean `true` if the key exists, `false` otherwise.

clear() 공개 메소드

Clears all cookies.
public clear ( array $options = [] ) : boolean
$options array Options array. Not used fro this adapter method.
리턴 boolean True on successful clear, false otherwise.

delete() 공개 메소드

Delete a value from the cookie store.
public delete ( string $key, array $options = [] ) : Closure
$key string The key to be deleted from the cookie store.
$options array Options array.
리턴 Closure Function returning boolean `true` on successful delete, `false` otherwise.

isEnabled() 공개 메소드

Determines if cookies are enabled.
public isEnabled ( ) : boolean
리턴 boolean True

isStarted() 공개 메소드

Obtain the status of the cookie storage.
public isStarted ( ) : boolean
리턴 boolean True if $_COOKIE has been initialized, false otherwise.

key() 공개 메소드

Obtain the top-level cookie key.
public key ( ) : string
리턴 string The configured cookie 'name' parameter

keyFormat() 공개 정적인 메소드

Formats the given $name argument for use in the cookie adapter.
public static keyFormat ( string $name, array $config ) : string
$name string The key to be formatted, e.g. `foo.bar.baz`.
$config array
리턴 string The formatted key.

read() 공개 메소드

Read a value from the cookie.
public read ( null | string $key = null, array $options = [] ) : Closure
$key null | string Key of the entry to be read. If $key is null, returns all cookie key/value pairs that have been set.
$options array Options array. Not used in this adapter.
리턴 Closure Function returning data in the session if successful, `null` otherwise.

write() 공개 메소드

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

프로퍼티 상세

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

Default settings for this session adapter.
protected $_defaults