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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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