2011-09-29 08:18:20 +00:00
|
|
|
<?php
|
2011-09-29 21:17:43 +00:00
|
|
|
/**
|
|
|
|
|
* Contain the ObjectFileCache class
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup Cache
|
|
|
|
|
*/
|
2011-10-02 17:53:33 +00:00
|
|
|
abstract class ObjectFileCache extends FileCacheBase {
|
2011-09-29 21:17:43 +00:00
|
|
|
/**
|
|
|
|
|
* Construct an ObjectFileCache from a key and a type
|
|
|
|
|
* @param $key string
|
|
|
|
|
* @param $type string
|
|
|
|
|
* @return ObjectFileCache
|
|
|
|
|
*/
|
2011-09-29 08:18:20 +00:00
|
|
|
public static function newFromKey( $key, $type ) {
|
|
|
|
|
$cache = new self();
|
|
|
|
|
|
|
|
|
|
$cache->mKey = (string)$key;
|
|
|
|
|
$cache->mType = (string)$type;
|
2011-10-02 17:53:33 +00:00
|
|
|
$cache->mExt = 'cache';
|
2011-09-29 08:18:20 +00:00
|
|
|
|
|
|
|
|
return $cache;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the base file cache directory
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
protected function cacheDirectory() {
|
2011-10-02 17:53:33 +00:00
|
|
|
return $this->baseCacheDirectory() . '/object';
|
2011-09-29 08:18:20 +00:00
|
|
|
}
|
|
|
|
|
}
|