wiki.techinc.nl/includes/cache/ObjectFileCache.php
Aaron Schulz 93d358cd0c FileCache:
* Added FileCacheBase::*MissesRecent() functions for counting cache misses from different visitors.
* Made ObjectFileCache more generic.
* Cleaned up FileCacheBase::checkCacheDirs().
* Added FileCacheBase::typeSubdirectory() function and overwrote in HTMLFileCache. Fixes r98405 invalidating all existing cache due to directory change.
* Simplified FileCacheBase::checkCacheDirs() a bit

ResourceLoader:
* Use ResourceFileCache to handle load() requests, if $wgUseFileCache. Only caches requests for default language and skins. Single modules requests are always cached, whereas others require a certain threshold of traffic.
* Added ResourceFileCache class (functionality was initially to be in ObjectFileCache).
2011-10-02 17:53:33 +00:00

31 lines
622 B
PHP

<?php
/**
* Contain the ObjectFileCache class
* @file
* @ingroup Cache
*/
abstract class ObjectFileCache extends FileCacheBase {
/**
* Construct an ObjectFileCache from a key and a type
* @param $key string
* @param $type string
* @return ObjectFileCache
*/
public static function newFromKey( $key, $type ) {
$cache = new self();
$cache->mKey = (string)$key;
$cache->mType = (string)$type;
$cache->mExt = 'cache';
return $cache;
}
/**
* Get the base file cache directory
* @return string
*/
protected function cacheDirectory() {
return $this->baseCacheDirectory() . '/object';
}
}