/**
* @see wcf\system\cache\source\CacheSource::get()
*/
- public function get($cacheResource) {
+ public function get(array $cacheResource) {
if (($data = apc_fetch($cacheResource['file'])) === false) {
return null;
}
/**
* @see wcf\system\cache\source\CacheSource::set()
*/
- public function set($cacheResource, $value) {
+ public function set(array $cacheResource, $value) {
apc_store($cacheResource['file'], $value, $cacheResource['maxLifetime']);
}
/**
* @see wcf\system\cache\source\CacheSource::delete()
*/
- public function delete($cacheResource, $ignoreLifetime = false) {
+ public function delete(array $cacheResource, $ignoreLifetime = false) {
if ($ignoreLifetime || ($cacheResource['minLifetime'] == 0 || $this->checkMinLifetime($cacheResource))) {
apc_delete($cacheResource['file']);
}
* @param array $cacheResource
* @return mixed
*/
- public function get($cacheResource);
+ public function get(array $cacheResource);
/**
* Stores a variable in the cache.
* @param array $cacheResource
* @param mixed $value
*/
- public function set($cacheResource, $value);
+ public function set(array $cacheResource, $value);
/**
* Deletes a variable in the cache.
* @param array $cacheResource
* @param boolean $ignoreLifetime
*/
- public function delete($cacheResource, $ignoreLifetime = false);
+ public function delete(array $cacheResource, $ignoreLifetime = false);
/**
* Marks cached files as obsolete.
protected $loaded = array();
/**
- * @see CacheSource::get()
+ * @see wcf\system\cache\source\CacheSource::get()
*/
- public function get($cacheResource) {
+ public function get(array $cacheResource) {
if (!isset($this->cache[$cacheResource['cache']])) {
// check for rebuilt
if ($this->needRebuild($cacheResource)) {
}
/**
- * @see CacheSource::set()
+ * @see wcf\system\cache\source\CacheSource::set()
*/
- public function set($cacheResource, $value) {
+ public function set(array $cacheResource, $value) {
// write cache
$targetFile = new File($cacheResource['file']);
$targetFile->write("<?php exit; /* cache: ".$cacheResource['cache']." (generated at ".gmdate('r').") DO NOT EDIT THIS FILE */ ?>\n");
}
/**
- * @see CacheSource::delete()
+ * @see wcf\system\cache\source\CacheSource::delete()
*/
- public function delete($cacheResource, $ignoreLifetime = false) {
+ public function delete(array$cacheResource, $ignoreLifetime = false) {
if (file_exists($cacheResource['file'])) {
if ($ignoreLifetime || ($cacheResource['minLifetime'] == 0 || (TIME_NOW - filemtime($cacheResource['file'])) >= $cacheResource['minLifetime'])) {
// delete cache file
* @param array $cacheResource
* @return boolean $needRebuilt
*/
- protected function needRebuild($cacheResource) {
+ protected function needRebuild(array $cacheResource) {
// cache does not exist
if (!file_exists($cacheResource['file'])) {
return true;
*
* @param array $cacheResource
*/
- public function load($cacheResource) {
+ public function load(array $cacheResource) {
if (!isset($this->loaded[$cacheResource['file']])) {
try {
// load cache file
*
* @param array $cacheResource
*/
- protected function loadCacheFile($cacheResource) {
+ protected function loadCacheFile(array $cacheResource) {
// get file contents
$contents = file_get_contents($cacheResource['file']);
// CacheSource implementations
/**
- * @see CacheSource::get()
+ * @see wcf\system\cache\source\CacheSource::get()
*/
- public function get($cacheResource) {
+ public function get(array $cacheResource) {
$value = $this->getAdapter()->getMemcache()->get($cacheResource['file']);
if ($value === false) return null;
return $value;
}
/**
- * @see CacheSource::set()
+ * @see wcf\system\cache\source\CacheSource::set()
*/
- public function set($cacheResource, $value) {
+ public function set(array $cacheResource, $value) {
$this->getAdapter()->getMemcache()->set($cacheResource['file'], $value, MEMCACHE_COMPRESSED, $cacheResource['maxLifetime']);
$this->addToLog($cacheResource['file']);
}
/**
- * @see CacheSource::delete()
+ * @see wcf\system\cache\source\CacheSource::delete()
*/
- public function delete($cacheResource, $ignoreLifetime = false) {
+ public function delete(arra $cacheResource, $ignoreLifetime = false) {
$this->getAdapter()->getMemcache()->delete($cacheResource['file']);
$this->removeFromLog($cacheResource['file']);
}