MediaWiki
REL1_22
|
Base class for data storage in the file system. More...
Public Member Functions | |
cacheTimestamp () | |
Get the last-modified timestamp of the cache file. | |
clearCache () | |
Clear the cache for this page. | |
fetchText () | |
Get the uncompressed text from the cache. | |
getMissesRecent () | |
Roughly gets the cache misses in the last hour by unique visitors. | |
incrMissesRecent (WebRequest $request) | |
Roughly increments the cache misses in the last hour by unique visitors. | |
isCached () | |
Check if the cache file exists. | |
isCacheGood ($timestamp= '') | |
Check if up to date cache file exists. | |
saveText ($text) | |
Save and compress text to the cache. | |
Public Attributes | |
const | MISS_FACTOR = 15 |
const | MISS_TTL_SEC = 3600 |
Protected Member Functions | |
__construct () | |
baseCacheDirectory () | |
Get the base file cache directory. | |
cacheDirectory () | |
Get the base cache directory (not specific to this file) | |
cacheMissKey () | |
cachePath () | |
Get the path to the cache file. | |
checkCacheDirs () | |
Create parent directors of $this->cachePath() | |
hashSubdirectory () | |
Return relative multi-level hash subdirectory (with trailing slash) or the empty string if not $wgFileCacheDepth. | |
typeSubdirectory () | |
Get the cache type subdirectory (with trailing slash) An extending class could use that method to alter the type -> directory mapping. | |
useGzip () | |
Check if the cache is gzipped. | |
Protected Attributes | |
$mCached | |
$mExt = 'cache' | |
$mFilePath | |
$mKey | |
$mType = 'object' | |
$mUseGzip |
Base class for data storage in the file system.
Definition at line 29 of file FileCacheBase.php.
FileCacheBase::__construct | ( | ) | [protected] |
Definition at line 42 of file FileCacheBase.php.
References global.
FileCacheBase::baseCacheDirectory | ( | ) | [final, protected] |
Get the base file cache directory.
Definition at line 52 of file FileCacheBase.php.
References global.
Referenced by ObjectFileCache\cacheDirectory(), HTMLFileCache\cacheDirectory(), and ResourceFileCache\cacheDirectory().
FileCacheBase::cacheDirectory | ( | ) | [abstract, protected] |
Get the base cache directory (not specific to this file)
Reimplemented in ResourceFileCache, HTMLFileCache, and ObjectFileCache.
Referenced by cachePath().
FileCacheBase::cacheMissKey | ( | ) | [protected] |
Definition at line 271 of file FileCacheBase.php.
References wfMemcKey().
Referenced by getMissesRecent(), and incrMissesRecent().
FileCacheBase::cachePath | ( | ) | [protected] |
Get the path to the cache file.
Definition at line 67 of file FileCacheBase.php.
References $dir, $key, cacheDirectory(), hashSubdirectory(), typeSubdirectory(), and useGzip().
Referenced by cacheTimestamp(), checkCacheDirs(), clearCache(), fetchText(), isCached(), HTMLFileCache\loadFromFileCache(), and saveText().
Get the last-modified timestamp of the cache file.
Definition at line 101 of file FileCacheBase.php.
References $timestamp, cachePath(), and wfTimestamp().
Referenced by isCacheGood().
FileCacheBase::checkCacheDirs | ( | ) | [protected] |
Create parent directors of $this->cachePath()
Definition at line 190 of file FileCacheBase.php.
References cachePath(), and wfMkdirParents().
Referenced by saveText().
Clear the cache for this page.
Definition at line 179 of file FileCacheBase.php.
References cachePath(), wfRestoreWarnings(), and wfSuppressWarnings().
Get the uncompressed text from the cache.
Definition at line 140 of file FileCacheBase.php.
References cachePath(), and useGzip().
Roughly gets the cache misses in the last hour by unique visitors.
Definition at line 263 of file FileCacheBase.php.
References $wgMemc, cacheMissKey(), and global.
Referenced by ResourceFileCache\isCacheWorthy().
FileCacheBase::hashSubdirectory | ( | ) | [protected] |
Return relative multi-level hash subdirectory (with trailing slash) or the empty string if not $wgFileCacheDepth.
Definition at line 210 of file FileCacheBase.php.
Referenced by cachePath().
FileCacheBase::incrMissesRecent | ( | WebRequest $ | request | ) |
Roughly increments the cache misses in the last hour by unique visitors.
$request | WebRequest |
Definition at line 229 of file FileCacheBase.php.
References $key, $wgMemc, cacheMissKey(), false, global, IP\isIPv6(), IP\isValid(), IP\sanitizeRange(), and wfMemcKey().
Check if the cache file exists.
Definition at line 90 of file FileCacheBase.php.
References cachePath().
Referenced by isCacheGood(), and ResourceFileCache\isCacheWorthy().
FileCacheBase::isCacheGood | ( | $ | timestamp = '' | ) |
Check if up to date cache file exists.
string | $timestamp | MW_TS timestamp |
Definition at line 114 of file FileCacheBase.php.
References $timestamp, cacheTimestamp(), global, isCached(), and wfDebug().
FileCacheBase::saveText | ( | $ | text | ) |
Save and compress text to the cache.
Definition at line 153 of file FileCacheBase.php.
References cachePath(), checkCacheDirs(), global, useGzip(), and wfDebug().
Referenced by HTMLFileCache\saveToFileCache().
FileCacheBase::typeSubdirectory | ( | ) | [protected] |
Get the cache type subdirectory (with trailing slash) An extending class could use that method to alter the type -> directory mapping.
Reimplemented in HTMLFileCache.
Definition at line 201 of file FileCacheBase.php.
Referenced by cachePath().
FileCacheBase::useGzip | ( | ) | [protected] |
Check if the cache is gzipped.
Definition at line 132 of file FileCacheBase.php.
Referenced by cachePath(), fetchText(), HTMLFileCache\loadFromFileCache(), saveText(), and HTMLFileCache\saveToFileCache().
FileCacheBase::$mCached [protected] |
Definition at line 36 of file FileCacheBase.php.
FileCacheBase::$mExt = 'cache' [protected] |
Definition at line 32 of file FileCacheBase.php.
FileCacheBase::$mFilePath [protected] |
Definition at line 33 of file FileCacheBase.php.
FileCacheBase::$mKey [protected] |
Definition at line 30 of file FileCacheBase.php.
FileCacheBase::$mType = 'object' [protected] |
Definition at line 31 of file FileCacheBase.php.
FileCacheBase::$mUseGzip [protected] |
Definition at line 34 of file FileCacheBase.php.
const FileCacheBase::MISS_FACTOR = 15 |
Definition at line 39 of file FileCacheBase.php.
const FileCacheBase::MISS_TTL_SEC = 3600 |
Definition at line 40 of file FileCacheBase.php.