|
MediaWiki REL1_35
|
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. | |
Protected Member Functions | |
| __construct () | |
| baseCacheDirectory () | |
| Get the base file cache directory. | |
| cacheDirectory () | |
| Get the base cache directory (not specific to this file) | |
| cacheMissKey (BagOStuff $cache) | |
| 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 | |
Private Attributes | |
| const | MISS_FACTOR = 15 |
| const | MISS_TTL_SEC = 3600 |
Base class for data storage in the file system.
Definition at line 31 of file FileCacheBase.php.
|
protected |
Definition at line 44 of file FileCacheBase.php.
References $wgUseGzip.
|
finalprotected |
Get the base file cache directory.
Definition at line 54 of file FileCacheBase.php.
References $wgFileCacheDirectory.
Referenced by HTMLFileCache\cacheDirectory(), and ResourceFileCache\cacheDirectory().
|
abstractprotected |
Get the base cache directory (not specific to this file)
Reimplemented in HTMLFileCache, and ResourceFileCache.
Referenced by cachePath().
|
protected |
| BagOStuff | $cache | Instance that the key will be used with |
Definition at line 272 of file FileCacheBase.php.
References $cache.
Referenced by getMissesRecent(), and incrMissesRecent().
|
protected |
Get the path to the cache file.
Definition at line 70 of file FileCacheBase.php.
References $mFilePath, cacheDirectory(), hashSubdirectory(), typeSubdirectory(), and useGzip().
Referenced by cacheTimestamp(), checkCacheDirs(), clearCache(), fetchText(), isCached(), HTMLFileCache\loadFromFileCache(), and saveText().
| FileCacheBase::cacheTimestamp | ( | ) |
Get the last-modified timestamp of the cache file.
Definition at line 105 of file FileCacheBase.php.
References cachePath(), and wfTimestamp().
Referenced by isCacheGood(), and ResourceLoader\tryRespondFromFileCache().
|
protected |
Create parent directors of $this->cachePath()
Definition at line 194 of file FileCacheBase.php.
References cachePath(), and wfMkdirParents().
Referenced by saveText().
| FileCacheBase::clearCache | ( | ) |
Clear the cache for this page.
Definition at line 183 of file FileCacheBase.php.
References cachePath().
| FileCacheBase::fetchText | ( | ) |
Get the uncompressed text from the cache.
Definition at line 146 of file FileCacheBase.php.
References cachePath(), and useGzip().
Referenced by ResourceLoader\tryRespondFromFileCache().
| FileCacheBase::getMissesRecent | ( | ) |
Roughly gets the cache misses in the last hour by unique visitors.
Definition at line 262 of file FileCacheBase.php.
References $cache, and cacheMissKey().
Referenced by ResourceFileCache\isCacheWorthy().
|
protected |
Return relative multi-level hash subdirectory (with trailing slash) or the empty string if not $wgFileCacheDepth.
Definition at line 214 of file FileCacheBase.php.
References $wgFileCacheDepth.
Referenced by cachePath().
| FileCacheBase::incrMissesRecent | ( | WebRequest | $request | ) |
Roughly increments the cache misses in the last hour by unique visitors.
| WebRequest | $request |
Definition at line 233 of file FileCacheBase.php.
References $cache, cacheMissKey(), and WebRequest\getIP().
| FileCacheBase::isCached | ( | ) |
Check if the cache file exists.
Definition at line 93 of file FileCacheBase.php.
References $mCached, and 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 119 of file FileCacheBase.php.
References $wgCacheEpoch, cacheTimestamp(), isCached(), and wfDebug().
Referenced by ResourceLoader\tryRespondFromFileCache().
| FileCacheBase::saveText | ( | $text | ) |
Save and compress text to the cache.
| string | $text |
Definition at line 161 of file FileCacheBase.php.
References cachePath(), checkCacheDirs(), useGzip(), and wfDebug().
Referenced by HTMLFileCache\saveToFileCache().
|
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 205 of file FileCacheBase.php.
Referenced by cachePath().
|
protected |
Check if the cache is gzipped.
Definition at line 138 of file FileCacheBase.php.
References $mUseGzip.
Referenced by cachePath(), fetchText(), HTMLFileCache\loadFromFileCache(), saveText(), and HTMLFileCache\saveToFileCache().
|
protected |
Definition at line 38 of file FileCacheBase.php.
Referenced by isCached().
|
protected |
Definition at line 34 of file FileCacheBase.php.
|
protected |
Definition at line 35 of file FileCacheBase.php.
Referenced by cachePath().
|
protected |
Definition at line 32 of file FileCacheBase.php.
|
protected |
Definition at line 33 of file FileCacheBase.php.
|
protected |
Definition at line 36 of file FileCacheBase.php.
Referenced by useGzip().
|
private |
Definition at line 41 of file FileCacheBase.php.
|
private |
Definition at line 42 of file FileCacheBase.php.