PHP Класс Pantheon\Terminus\DataStore\FileStore

Наследование: implements Pantheon\Terminus\DataStore\DataStoreInterface
Показать файл Открыть проект

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

Свойство Тип Описание
$directory The directory to store the data files in.

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

Метод Описание
__construct ( $directory )
get ( string $key ) : mixed Reads retrieves data from the store
has ( string $key ) : boolean Checks if a key is in the store
keys ( ) : array Return a list of all keys in the store.
remove ( string $key ) Remove value from the store
set ( string $key, mixed $data ) Saves a value with the given key

Защищенные методы

Метод Описание
cleanKey ( $key ) : mixed Make the file path safe by whitelisting characters.
getFileName ( string $key ) : string Get a valid file name for the given key.

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

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

public __construct ( $directory )

cleanKey() защищенный Метод

This is a very naive approach to hashing but in practice this doesn't matter since this is only used for a few already safe keys.
protected cleanKey ( $key ) : mixed
$key
Результат mixed

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

Reads retrieves data from the store
public get ( string $key ) : mixed
$key string A key
Результат mixed The value fpr the given key or null.

getFileName() защищенный Метод

Get a valid file name for the given key.
protected getFileName ( string $key ) : string
$key string The data key to be written or read
Результат string A file path

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

Checks if a key is in the store
public has ( string $key ) : boolean
$key string A key
Результат boolean Whether a value exists with the given key

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

Return a list of all keys in the store.
public keys ( ) : array
Результат array A list of keys

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

Remove value from the store
public remove ( string $key )
$key string A key

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

Saves a value with the given key
public set ( string $key, mixed $data )
$key string A key
$data mixed Data to save to the store

Описание свойств

$directory защищенное свойство

The directory to store the data files in.
protected $directory