PHP 클래스 Pantheon\Terminus\DataStore\FileStore

상속: implements Pantheon\Terminus\DataStore\DataStoreInterface
파일 보기 프로젝트 열기: pantheon-systems/terminus

보호된 프로퍼티들

프로퍼티 타입 설명
$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