\PhalApi_Cache_Memcached

PhalApi_Cache_Memcached MC缓存

  • 使用序列化对需要存储的值进行转换,以提高速度

Summary

Methods
Properties
Constants
__construct()
set()
get()
delete()
No public properties found
No constants found
createMemcache()
formatKey()
$memcache
$prefix
N/A
No private methods found
No private properties found
N/A

Properties

$memcache

$memcache : 

Type

$prefix

$prefix : 

Type

Methods

__construct()

__construct(  $config) 

Parameters

$config

set()

set(string  $key, mixed  $value, integer  $expire = 600) 

注意参数的微妙区别

Parameters

string $key

cache key

mixed $value

cache content data

integer $expire

cache expire time, unit: seconds, not timestamp

get()

get(string  $key) : mixed

Get cache

Parameters

string $key

cache key

Returns

mixed —

return null when fail

delete()

delete(string  $key) 

Delete cache

Parameters

string $key

createMemcache()

createMemcache() : \Memcached

返回更高版本的MC实例

Returns

\Memcached

formatKey()

formatKey(  $key) 

Parameters

$key