\BEAR_Cache_Adapter_Lite

PEAR::Cache_Liteアダプター

キャッシュ抽象クラスです。BEAR/Cache/Adapter/の各クラスで実装します。

Summary

Methods
Properties
Constants
onInject()
set()
get()
delete()
deleteAll()
__construct()
setConfig()
getConfig()
setService()
setLife()
No public properties found
No constants found
_exception()
$_life
$_adapter
$_log
$_config
N/A
No private methods found
No private properties found
N/A

Properties

$_life

$_life : integer

キャッシュ時間

Type

integer

$_config

$_config : array

Class config

Type

array

Methods

onInject()

onInject() : void

Inject

設定にしたがってサービスをインジェクトします。

set()

set(string  $key, mixed  $values) : boolean

キャッシュを保存

キャッシュにデータを保存します。(なければ新規作成、あれば更新)

Parameters

string $key

キー

mixed $values

Returns

boolean

get()

get(string  $key, mixed  $options = array('default' => null)) : mixed

キャッシュを取得

キーを基にキャッシュデータを取得します

Parameters

string $key

キー

mixed $options

オプション

Returns

mixed

delete()

delete(string  $key) : boolean

キャッシュの削除

Parameters

string $key

キー

Returns

boolean

deleteAll()

deleteAll() : boolean

キャッシュの全削除

Returns

boolean

__construct()

__construct(array  $config) 

Constructor取得

Parameters

array $config

setConfig()

setConfig(mixed  $config, mixed  $values = null) : self

Set config

Parameters

mixed $config

(string) 設定キー | (array) 設定配列

mixed $values

(string) $configの時の設定値

Returns

self

getConfig()

getConfig(string  $key = null) : mixed

Get config

Parameters

string $key

設定キー、指定なければ全ての設定を取得

Returns

mixed

setService()

setService(string  $name, mixed  $service) : void

Set service

Parameters

string $name

サービスキー

mixed $service

サービス

setLife()

setLife(mixed  $life = null) : \BEAR_Cache_Adapter_Lite

キャッシュ生存時間を決める

Parameters

mixed $life

秒 nullで無期限

Returns

\BEAR_Cache_Adapter_Lite

_exception()

_exception(string  $msg, array  $config = array()) : \BEAR_Exception

例外の作成

Parameters

string $msg

例外メッセージ

array $config

例外config

Returns

\BEAR_Exception