FileCache:
[lhc/web/wiklou.git] / includes / cache / ObjectFileCache.php
1 <?php
2 /**
3 * Contain the ObjectFileCache class
4 * @file
5 * @ingroup Cache
6 */
7 abstract class ObjectFileCache extends FileCacheBase {
8 /**
9 * Construct an ObjectFileCache from a key and a type
10 * @param $key string
11 * @param $type string
12 * @return ObjectFileCache
13 */
14 public static function newFromKey( $key, $type ) {
15 $cache = new self();
16
17 $cache->mKey = (string)$key;
18 $cache->mType = (string)$type;
19 $cache->mExt = 'cache';
20
21 return $cache;
22 }
23
24 /**
25 * Get the base file cache directory
26 * @return string
27 */
28 protected function cacheDirectory() {
29 return $this->baseCacheDirectory() . '/object';
30 }
31 }