Public Member Functions | |
getInstance ($url) | |
__construct ($url) | |
isSupport () | |
getKey ($key) | |
put ($key, $buff, $valid_time=0) | |
isValid ($key, $modified_time=0) | |
get ($key, $modified_time=0) | |
delete ($key) | |
_delete ($_key) | |
truncate () | |
Public Member Functions inherited from CacheBase | |
get ($key, $modified_time=0) | |
put ($key, $obj, $valid_time=0) | |
isValid ($key, $modified_time=0) | |
isSupport () | |
truncate () | |
Public Attributes | |
$Memcache | |
$SelectedExtension | |
Public Attributes inherited from CacheBase | |
$valid_time = 36000 | |
Cache class for memcache
Definition at line 9 of file CacheMemcache.class.php.
CacheMemcache::__construct | ( | $url | ) |
Construct
Do not use this directly. You can use getInstance() instead.
string | $url | url of memcache |
Definition at line 40 of file CacheMemcache.class.php.
CacheMemcache::_delete | ( | $_key | ) |
Delete item from the server(private)
string | $_key | The key associated with the item to delete. |
Definition at line 214 of file CacheMemcache.class.php.
CacheMemcache::delete | ( | $key | ) |
Delete item from the server
CacheMemcache::delete() deletes an item with tey $key.
string | $key | The key associated with the item to delete. |
Definition at line 201 of file CacheMemcache.class.php.
CacheMemcache::get | ( | $key, | |
$modified_time = 0 |
|||
) |
Retrieve item from the server
CacheMemcache::get() returns previously stored data if an item with such $key exists on the server at this moment.
string | $key | The key to fetch |
int | $modified_time | Unix time of data modified. If stored time is older then modified time, return false. |
Definition at line 173 of file CacheMemcache.class.php.
CacheMemcache::getInstance | ( | $url | ) |
Get instance of CacheMemcache
string | $url | url of memcache |
Definition at line 24 of file CacheMemcache.class.php.
CacheMemcache::getKey | ( | $key | ) |
Get unique key of given key by path of XE
string | $key | Cache key |
Definition at line 97 of file CacheMemcache.class.php.
CacheMemcache::isSupport | ( | ) |
Return whether support or not support cache
Definition at line 71 of file CacheMemcache.class.php.
CacheMemcache::isValid | ( | $key, | |
$modified_time = 0 |
|||
) |
Return whether cache is valid or invalid
string | $key | Cache key |
int | $modified_time | Unix time of data modified. If stored time is older then modified time, the data is invalid. |
Definition at line 143 of file CacheMemcache.class.php.
CacheMemcache::put | ( | $key, | |
$buff, | |||
$valid_time = 0 |
|||
) |
Store data at the server
CacheMemcache::put() stores an item $buff with $key on the memcached server. Parameter $valid_time is expiration time in seconds. If it's 0, the item never expires (but memcached server doesn't guarantee this item to be stored all the time, it could be delete from the cache to make place for other items).
Remember that resource variables (i.e. file and connection descriptors) cannot be stored in the cache, because they can not be adequately represented in serialized state.
string | $key | The key that will be associated with the item. |
mixed | $buff | The variable to store. Strings and integers are stored as is, other types are stored serialized. |
int | $valid_time | Expiration time of the item. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days). If it's equal to zero, use the default valid time CacheMemcache::valid_time. |
Definition at line 119 of file CacheMemcache.class.php.
CacheMemcache::truncate | ( | ) |
Flush all existing items at the server
CacheMemcache::truncate() immediately invalidates all existing items. CacheMemcache::truncate() doesn't actually free any resources, it only marks all the items as expired, so occupied memory will be overwitten by new items.
Definition at line 228 of file CacheMemcache.class.php.
CacheMemcache::$Memcache |
Definition at line 15 of file CacheMemcache.class.php.
CacheMemcache::$SelectedExtension |
Definition at line 16 of file CacheMemcache.class.php.