PHP Class Cml\Cache\File

Inheritance: extends Base
Afficher le fichier Open project: linhecheng/cmlphp

Méthodes publiques

Méthode Description
__construct ( $conf = false ) 使用的缓存配置 默认为使用default_cache配置的参数
__construct ( bool|array $conf = false ) 使用的缓存配置 默认为使用default_cache配置的参数
cleanDir ( string $dir ) : boolean 清空文件夹
decrement ( string $key, integer $val = 1 ) : boolean 自减
delete ( string $key ) : boolean 删除缓存
get ( string $key ) : mixed 获取缓存
getInstance ( string $key = '' ) : void 返回实例便于操作未封装的方法
increment ( string $key, integer $val = 1 ) : boolean 自增
set ( string $key, mixed $value, integer $expire ) : boolean 写入缓存
truncate ( ) : boolean 清空缓存
update ( string $key, mixed $value, integer $expire ) : boolean 更新缓存 可以直接用set但是为了一致性操作所以做此兼容

Private Methods

Méthode Description
getFileName ( string $key ) : string 获取缓存文件名

Method Details

__construct() public méthode

使用的缓存配置 默认为使用default_cache配置的参数
public __construct ( $conf = false )

__construct() public méthode

使用的缓存配置 默认为使用default_cache配置的参数
public __construct ( bool|array $conf = false )
$conf bool|array

cleanDir() public méthode

清空文件夹
public cleanDir ( string $dir ) : boolean
$dir string
Résultat boolean

decrement() public méthode

自减
public decrement ( string $key, integer $val = 1 ) : boolean
$key string 要自减的缓存的数据的key
$val integer 自减的进步值,默认为1
Résultat boolean

delete() public méthode

删除缓存
public delete ( string $key ) : boolean
$key string 要删除的数据的key
Résultat boolean

get() public méthode

获取缓存
public get ( string $key ) : mixed
$key string 要获取的缓存key
Résultat mixed

getInstance() public méthode

返回实例便于操作未封装的方法
public getInstance ( string $key = '' ) : void
$key string
Résultat void

increment() public méthode

自增
public increment ( string $key, integer $val = 1 ) : boolean
$key string 要自增的缓存的数据的key
$val integer 自增的进步值,默认为1
Résultat boolean

set() public méthode

写入缓存
public set ( string $key, mixed $value, integer $expire ) : boolean
$key string key 要缓存的数据的key
$value mixed 要缓存的数据 要缓存的值,除resource类型外的数据类型
$expire integer 缓存的有效时间 0为不过期
Résultat boolean

truncate() public méthode

清空缓存
public truncate ( ) : boolean
Résultat boolean

update() public méthode

更新缓存 可以直接用set但是为了一致性操作所以做此兼容
public update ( string $key, mixed $value, integer $expire ) : boolean
$key string 要更新的数据的key
$value mixed 要更新缓存的值,除resource类型外的数据类型
$expire integer 缓存的有效时间 0为不过期
Résultat boolean