PHP 클래스 Flintstone\Flintstone

파일 보기 프로젝트 열기: fire015/flintstone 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$config Config Config class.
$database Database Database class.

공개 메소드들

메소드 설명
__construct ( Database | string $database, Config | array $config ) Constructor.
delete ( string $key ) Delete a key from the database.
flush ( ) Flush the database.
get ( string $key ) : mixed Get a key from the database.
getAll ( ) : array Get all data from the database.
getConfig ( ) : Config Get the config.
getDatabase ( ) : Database Get the database.
getKeys ( ) : array Get all keys from the database.
set ( string $key, mixed $data ) Set a key in the database.
setConfig ( Config $config ) Set the config.
setDatabase ( Database $database ) Set the database.

보호된 메소드들

메소드 설명
decodeData ( string $data ) : mixed Decode a string into data.
encodeData ( mixed $data ) : string Encode data into a string.
getDataFromLine ( string $line, string $key ) : string | boolean Retrieve data from a given line for a specific key.
getKeyFromLine ( string $line ) : string Retrieve key from a given line.
getLinePieces ( string $line ) : array Retrieve the pieces from a given line.
getLineString ( string $key, mixed $data ) : string Get the line string to write.
replace ( string $key, mixed $data ) Replace a key in the database.
validateData ( mixed $data ) Check the data type is valid.
validateKey ( string $key ) Validate the key.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Database | string $database, Config | array $config )
$database Database | string
$config Config | array

decodeData() 보호된 메소드

Decode a string into data.
protected decodeData ( string $data ) : mixed
$data string
리턴 mixed

delete() 공개 메소드

Delete a key from the database.
public delete ( string $key )
$key string

encodeData() 보호된 메소드

Encode data into a string.
protected encodeData ( mixed $data ) : string
$data mixed
리턴 string

flush() 공개 메소드

Flush the database.
public flush ( )

get() 공개 메소드

Get a key from the database.
public get ( string $key ) : mixed
$key string
리턴 mixed

getAll() 공개 메소드

Get all data from the database.
public getAll ( ) : array
리턴 array

getConfig() 공개 메소드

Get the config.
public getConfig ( ) : Config
리턴 Config

getDataFromLine() 보호된 메소드

Retrieve data from a given line for a specific key.
protected getDataFromLine ( string $line, string $key ) : string | boolean
$line string
$key string
리턴 string | boolean

getDatabase() 공개 메소드

Get the database.
public getDatabase ( ) : Database
리턴 Database

getKeyFromLine() 보호된 메소드

Retrieve key from a given line.
protected getKeyFromLine ( string $line ) : string
$line string
리턴 string

getKeys() 공개 메소드

Get all keys from the database.
public getKeys ( ) : array
리턴 array

getLinePieces() 보호된 메소드

Retrieve the pieces from a given line.
protected getLinePieces ( string $line ) : array
$line string
리턴 array

getLineString() 보호된 메소드

Get the line string to write.
protected getLineString ( string $key, mixed $data ) : string
$key string
$data mixed
리턴 string

replace() 보호된 메소드

Replace a key in the database.
protected replace ( string $key, mixed $data )
$key string
$data mixed

set() 공개 메소드

Set a key in the database.
public set ( string $key, mixed $data )
$key string
$data mixed

setConfig() 공개 메소드

Set the config.
public setConfig ( Config $config )
$config Config

setDatabase() 공개 메소드

Set the database.
public setDatabase ( Database $database )
$database Database

validateData() 보호된 메소드

Check the data type is valid.
protected validateData ( mixed $data )
$data mixed the data

validateKey() 보호된 메소드

Validate the key.
protected validateKey ( string $key )
$key string

프로퍼티 상세

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

Config class.
protected Config,flintstone $config
리턴 Config

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

Database class.
protected Database,flintstone $database
리턴 Database