|
MediaWiki
master
|
Base class for data storage in the file system. More...

Public Member Functions | |
| cacheTimestamp () | |
| Get the last-modified timestamp of the cache file. More... | |
| clearCache () | |
| Clear the cache for this page. More... | |
| fetchText () | |
| Get the uncompressed text from the cache. More... | |
| getMissesRecent () | |
| Roughly gets the cache misses in the last hour by unique visitors. More... | |
| incrMissesRecent (WebRequest $request) | |
| Roughly increments the cache misses in the last hour by unique visitors. More... | |
| isCached () | |
| Check if the cache file exists. More... | |
| isCacheGood ($timestamp= '') | |
| Check if up to date cache file exists. More... | |
| saveText ($text) | |
| Save and compress text to the cache. More... | |
Public Attributes | |
| const | MISS_FACTOR = 15 |
| const | MISS_TTL_SEC = 3600 |
Protected Member Functions | |
| __construct () | |
| baseCacheDirectory () | |
| Get the base file cache directory. More... | |
| cacheDirectory () | |
| Get the base cache directory (not specific to this file) More... | |
| cacheMissKey () | |
| cachePath () | |
| Get the path to the cache file. More... | |
| checkCacheDirs () | |
| Create parent directors of $this->cachePath() More... | |
| hashSubdirectory () | |
| Return relative multi-level hash subdirectory (with trailing slash) or the empty string if not $wgFileCacheDepth. More... | |
| typeSubdirectory () | |
| Get the cache type subdirectory (with trailing slash) An extending class could use that method to alter the type -> directory mapping. More... | |
| useGzip () | |
| Check if the cache is gzipped. More... | |
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.
|
protected |
Definition at line 42 of file FileCacheBase.php.
References $wgUseGzip, and global.
|
finalprotected |
Get the base file cache directory.
Definition at line 52 of file FileCacheBase.php.
References $wgFileCacheDirectory, and global.
Referenced by ObjectFileCache\cacheDirectory(), HTMLFileCache\cacheDirectory(), and ResourceFileCache\cacheDirectory().
|
abstractprotected |
|
protected |
Definition at line 280 of file FileCacheBase.php.
References wfMemcKey().
Referenced by getMissesRecent(), and incrMissesRecent().
|
protected |
Get the path to the cache file.
Definition at line 68 of file FileCacheBase.php.
References $dir, $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 103 of file FileCacheBase.php.
References $timestamp, cachePath(), TS_MW, and wfTimestamp().
Referenced by isCacheGood(), and ResourceLoader\tryRespondFromFileCache().
|
protected |
Create parent directors of $this->cachePath()
Definition at line 198 of file FileCacheBase.php.
References cachePath(), and wfMkdirParents().
Referenced by saveText().
| FileCacheBase::clearCache | ( | ) |
Clear the cache for this page.
Definition at line 187 of file FileCacheBase.php.
References cachePath().
| FileCacheBase::fetchText | ( | ) |
Get the uncompressed text from the cache.
Definition at line 144 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 271 of file FileCacheBase.php.
References $cache, cacheMissKey(), and ObjectCache\getLocalClusterInstance().
Referenced by ResourceFileCache\isCacheWorthy().
|
protected |
Return relative multi-level hash subdirectory (with trailing slash) or the empty string if not $wgFileCacheDepth.
Definition at line 218 of file FileCacheBase.php.
References $wgFileCacheDepth, and global.
Referenced by cachePath().
| FileCacheBase::incrMissesRecent | ( | WebRequest | $request | ) |
Roughly increments the cache misses in the last hour by unique visitors.
| WebRequest | $request |
Definition at line 237 of file FileCacheBase.php.
References $cache, cacheMissKey(), false, WebRequest\getIP(), ObjectCache\getLocalClusterInstance(), IP\isIPv6(), IP\isValid(), IP\sanitizeRange(), and wfMemcKey().
| FileCacheBase::isCached | ( | ) |
Check if the cache file exists.
Definition at line 91 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 117 of file FileCacheBase.php.
References $timestamp, $wgCacheEpoch, cacheTimestamp(), global, isCached(), and wfDebug().
Referenced by ResourceLoader\tryRespondFromFileCache().
| FileCacheBase::saveText | ( | $text | ) |
Save and compress text to the cache.
| string | $text |
Definition at line 159 of file FileCacheBase.php.
References $wgUseFileCache, cachePath(), checkCacheDirs(), global, 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.
Definition at line 209 of file FileCacheBase.php.
Referenced by cachePath().
|
protected |
Check if the cache is gzipped.
Definition at line 136 of file FileCacheBase.php.
References $mUseGzip.
Referenced by cachePath(), fetchText(), HTMLFileCache\loadFromFileCache(), saveText(), and HTMLFileCache\saveToFileCache().
|
protected |
Definition at line 36 of file FileCacheBase.php.
Referenced by isCached().
|
protected |
Definition at line 32 of file FileCacheBase.php.
|
protected |
Definition at line 33 of file FileCacheBase.php.
Referenced by cachePath().
|
protected |
Definition at line 30 of file FileCacheBase.php.
|
protected |
Definition at line 31 of file FileCacheBase.php.
|
protected |
Definition at line 34 of file FileCacheBase.php.
Referenced by useGzip().
| 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.