MediaWiki  REL1_24
HTMLFileCache Class Reference

Page view caching in the file system. More...

Inheritance diagram for HTMLFileCache:
Collaboration diagram for HTMLFileCache:

List of all members.

Public Member Functions

 __construct ($title, $action)
 loadFromFileCache (IContextSource $context)
 Read from cache to context output.
 saveToFileCache ($text)
 Save this cache object with the given text.

Static Public Member Functions

static clearFileCache (Title $title)
 Clear the file caches for a page for all actions.
static newFromTitle ($title, $action)
 Construct an ObjectFileCache from a Title and an action.
static useFileCache (IContextSource $context)
 Check if pages can be cached for this request/user.

Protected Member Functions

 cacheDirectory ()
 Get the base file cache directory.
 typeSubdirectory ()
 Get the cache type subdirectory (with the trailing slash) or the empty string Alter the type -> directory mapping to put action=view cache at the root.

Static Protected Member Functions

static cacheablePageActions ()
 Cacheable actions.

Detailed Description

Page view caching in the file system.

The only cacheable actions are "view" and "history". Also special pages will not be cached.

Definition at line 31 of file HTMLFileCache.php.


Constructor & Destructor Documentation

HTMLFileCache::__construct ( title,
action 
)
Parameters:
Title | string$titleTitle object or prefixed DB key string
string$action
Exceptions:
MWException

Definition at line 50 of file HTMLFileCache.php.

References $title, and cacheablePageActions().


Member Function Documentation

static HTMLFileCache::cacheablePageActions ( ) [static, protected]

Cacheable actions.

Returns:
array

Definition at line 66 of file HTMLFileCache.php.

References array().

Referenced by __construct().

Get the base file cache directory.

Returns:
string

Reimplemented from FileCacheBase.

Definition at line 74 of file HTMLFileCache.php.

References FileCacheBase\baseCacheDirectory().

static HTMLFileCache::clearFileCache ( Title title) [static]

Clear the file caches for a page for all actions.

Parameters:
Title$title
Returns:
bool Whether $wgUseFileCache is enabled

Definition at line 217 of file HTMLFileCache.php.

References $title, $type, as, and global.

Referenced by HTMLCacheUpdateJob\invalidateTitles().

Read from cache to context output.

Parameters:
IContextSource$context
Returns:
void

Definition at line 142 of file HTMLFileCache.php.

References FileCacheBase\cachePath(), IContextSource\getOutput(), global, FileCacheBase\useGzip(), wfClientAcceptsGzip(), and wfDebug().

static HTMLFileCache::newFromTitle ( title,
action 
) [static]

Construct an ObjectFileCache from a Title and an action.

Parameters:
Title | string$titleTitle object or prefixed DB key string
string$action
Exceptions:
MWException
Returns:
HTMLFileCache
Deprecated:
Since 1.24, instantiate this class directly

Definition at line 41 of file HTMLFileCache.php.

References $title.

Referenced by RebuildFileCache\execute().

Save this cache object with the given text.

Use this as an ob_start() handler.

Parameters:
string$text
Returns:
bool Whether $wgUseFileCache is enabled

Definition at line 172 of file HTMLFileCache.php.

References global, FileCacheBase\saveText(), FileCacheBase\useGzip(), wfClientAcceptsGzip(), wfDebug(), and wfTimestampNow().

Get the cache type subdirectory (with the trailing slash) or the empty string Alter the type -> directory mapping to put action=view cache at the root.

Returns:
string

Reimplemented from FileCacheBase.

Definition at line 84 of file HTMLFileCache.php.

static HTMLFileCache::useFileCache ( IContextSource context) [static]

Check if pages can be cached for this request/user.

Parameters:
IContextSource$context
Returns:
bool

Definition at line 97 of file HTMLFileCache.php.

References $query, $user, $wgContLang, array(), as, IContextSource\getLanguage(), IContextSource\getRequest(), IContextSource\getUser(), global, wfDebug(), and wfRunHooks().


The documentation for this class was generated from the following file: