\think\facadeCache

Facade管理类

Summary

Methods
Properties
Constants
instance()
make()
__callStatic()
getDefaultDriver()
getConfig()
getStoreConfig()
store()
clear()
get()
set()
delete()
getMultiple()
setMultiple()
deleteMultiple()
has()
tag()
No public properties found
No constants found
createFacade()
getFacadeClass()
$alwaysNewInstance
N/A
No private methods found
No private properties found
N/A

Properties

$alwaysNewInstance

$alwaysNewInstance : boolean

始终创建新的对象实例

Type

boolean

Methods

instance()

instance(  $args) : object

带参数实例化当前Facade类

Parameters

$args

Returns

object

make()

make(string  $class, array|true  $args = array(), boolean  $newInstance = false) : object

调用类的实例

Parameters

string $class

类名或者标识

array|true $args

变量

boolean $newInstance

是否每次创建新的实例

Returns

object

__callStatic()

__callStatic(  $method,   $params) 

Parameters

$method
$params

getDefaultDriver()

getDefaultDriver() : string|null

默认驱动

Returns

string|null

getConfig()

getConfig(null|string  $name = null, mixed  $default = null) : mixed

获取缓存配置

Parameters

null|string $name
mixed $default

Returns

mixed

getStoreConfig()

getStoreConfig(string  $store, string  $name = null, null  $default = null) : array

获取驱动配置

Parameters

string $store
string $name
null $default

Returns

array

store()

store(string  $name = null) : \think\cache\Driver

连接或者切换缓存

Parameters

string $name

Returns

\think\cache\Driver

clear()

clear() : boolean

清空缓冲池

Returns

boolean

get()

get(string  $key, mixed  $default = null) : mixed

读取缓存

Parameters

string $key
mixed $default

Returns

mixed

set()

set(string  $key, mixed  $value, integer|\DateTime  $ttl = null) : boolean

写入缓存

Parameters

string $key
mixed $value
integer|\DateTime $ttl

Returns

boolean

delete()

delete(string  $key) : boolean

删除缓存

Parameters

string $key

Returns

boolean

getMultiple()

getMultiple(\iterable  $keys, mixed  $default = null) : \think\facade\iterable

读取缓存

Parameters

\iterable $keys
mixed $default

Returns

\think\facade\iterable

setMultiple()

setMultiple(\iterable  $values, null|integer|\DateInterval  $ttl = null) : boolean

写入缓存

Parameters

\iterable $values
null|integer|\DateInterval $ttl

Returns

boolean

deleteMultiple()

deleteMultiple(\iterable  $keys) : boolean

删除缓存

Parameters

\iterable $keys

Returns

boolean

has()

has(string  $key) : boolean

判断缓存是否存在

Parameters

string $key

Returns

boolean

tag()

tag(string|array  $name) : \think\cache\TagSet

缓存标签

Parameters

string|array $name

Returns

\think\cache\TagSet

createFacade()

createFacade(string  $class = '', array  $args = array(), boolean  $newInstance = false) : object

创建Facade实例

Parameters

string $class

类名或标识

array $args

变量

boolean $newInstance

是否每次创建新的实例

Returns

object

getFacadeClass()

getFacadeClass() : string

获取当前Facade对应类名(或者已经绑定的容器对象标识)

Returns

string