MediaWiki master
|
Base class for data storage in the file system. More...
Inherited by HTMLFileCache.
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 | |
bool null | $mCached |
lazy loaded | |
string | $mExt = 'cache' |
string null | $mFilePath |
string | $mKey |
string | $mType = 'object' |
bool | $mUseGzip |
ServiceOptions | $options |
Base class for data storage in the file system.
Definition at line 39 of file FileCacheBase.php.
|
protected |
Definition at line 68 of file FileCacheBase.php.
References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\UseGzip.
|
finalprotected |
Get the base file cache directory.
Definition at line 80 of file FileCacheBase.php.
References MediaWiki\MainConfigNames\FileCacheDirectory.
Referenced by HTMLFileCache\cacheDirectory().
|
abstractprotected |
Get the base cache directory (not specific to this file)
Reimplemented in HTMLFileCache.
Referenced by MediaWiki\Cache\FileCacheBase\cachePath().
|
protected |
BagOStuff | $cache | Instance that the key will be used with |
Definition at line 296 of file FileCacheBase.php.
References Wikimedia\ObjectCache\BagOStuff\makeKey().
Referenced by MediaWiki\Cache\FileCacheBase\getMissesRecent(), and MediaWiki\Cache\FileCacheBase\incrMissesRecent().
|
protected |
Get the path to the cache file.
Definition at line 94 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\$mFilePath, MediaWiki\Cache\FileCacheBase\cacheDirectory(), MediaWiki\Cache\FileCacheBase\hashSubdirectory(), MediaWiki\Cache\FileCacheBase\typeSubdirectory(), and MediaWiki\Cache\FileCacheBase\useGzip().
Referenced by MediaWiki\Cache\FileCacheBase\cacheTimestamp(), MediaWiki\Cache\FileCacheBase\checkCacheDirs(), MediaWiki\Cache\FileCacheBase\clearCache(), MediaWiki\Cache\FileCacheBase\fetchText(), MediaWiki\Cache\FileCacheBase\isCached(), HTMLFileCache\loadFromFileCache(), and MediaWiki\Cache\FileCacheBase\saveText().
MediaWiki\Cache\FileCacheBase::cacheTimestamp | ( | ) |
Get the last-modified timestamp of the cache file.
Definition at line 127 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\cachePath(), and wfTimestamp().
Referenced by MediaWiki\Cache\FileCacheBase\isCacheGood().
|
protected |
Create parent directors of $this->cachePath()
Definition at line 216 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\cachePath(), and wfMkdirParents().
Referenced by MediaWiki\Cache\FileCacheBase\saveText().
MediaWiki\Cache\FileCacheBase::clearCache | ( | ) |
Clear the cache for this page.
Definition at line 205 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\cachePath().
MediaWiki\Cache\FileCacheBase::fetchText | ( | ) |
Get the uncompressed text from the cache.
Definition at line 168 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\cachePath(), and MediaWiki\Cache\FileCacheBase\useGzip().
MediaWiki\Cache\FileCacheBase::getMissesRecent | ( | ) |
Roughly gets the cache misses in the last hour by unique visitors.
Definition at line 285 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\cacheMissKey(), and MediaWiki\MediaWikiServices\getInstance().
|
protected |
Return relative multi-level hash subdirectory (with trailing slash) or the empty string if not $wgFileCacheDepth.
Definition at line 236 of file FileCacheBase.php.
References MediaWiki\MainConfigNames\FileCacheDepth.
Referenced by MediaWiki\Cache\FileCacheBase\cachePath().
MediaWiki\Cache\FileCacheBase::incrMissesRecent | ( | WebRequest | $request | ) |
Roughly increments the cache misses in the last hour by unique visitors.
WebRequest | $request |
Definition at line 255 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\cacheMissKey(), MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Request\WebRequest\getIP().
MediaWiki\Cache\FileCacheBase::isCached | ( | ) |
Check if the cache file exists.
Definition at line 117 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\$mCached, and MediaWiki\Cache\FileCacheBase\cachePath().
Referenced by MediaWiki\Cache\FileCacheBase\isCacheGood().
MediaWiki\Cache\FileCacheBase::isCacheGood | ( | $timestamp = '' | ) |
Check if up to date cache file exists.
string | $timestamp | MW_TS timestamp |
Definition at line 141 of file FileCacheBase.php.
References MediaWiki\MainConfigNames\CacheEpoch, MediaWiki\Cache\FileCacheBase\cacheTimestamp(), MediaWiki\Cache\FileCacheBase\isCached(), wfBoolToStr(), and wfDebug().
MediaWiki\Cache\FileCacheBase::saveText | ( | $text | ) |
Save and compress text to the cache.
string | $text |
Definition at line 183 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\cachePath(), MediaWiki\Cache\FileCacheBase\checkCacheDirs(), MediaWiki\Cache\FileCacheBase\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 227 of file FileCacheBase.php.
Referenced by MediaWiki\Cache\FileCacheBase\cachePath().
|
protected |
Check if the cache is gzipped.
Definition at line 160 of file FileCacheBase.php.
References MediaWiki\Cache\FileCacheBase\$mUseGzip.
Referenced by MediaWiki\Cache\FileCacheBase\cachePath(), MediaWiki\Cache\FileCacheBase\fetchText(), HTMLFileCache\loadFromFileCache(), MediaWiki\Cache\FileCacheBase\saveText(), and HTMLFileCache\saveToFileCache().
|
protected |
lazy loaded
Definition at line 60 of file FileCacheBase.php.
Referenced by MediaWiki\Cache\FileCacheBase\isCached().
|
protected |
Definition at line 54 of file FileCacheBase.php.
|
protected |
Definition at line 56 of file FileCacheBase.php.
Referenced by MediaWiki\Cache\FileCacheBase\cachePath().
|
protected |
Definition at line 50 of file FileCacheBase.php.
|
protected |
Definition at line 52 of file FileCacheBase.php.
|
protected |
Definition at line 58 of file FileCacheBase.php.
Referenced by MediaWiki\Cache\FileCacheBase\useGzip().
|
protected |
Definition at line 62 of file FileCacheBase.php.