MediaWiki  REL1_19
ResourceLoaderWikiModule Class Reference

Abstraction for resource loader modules which pull from wiki pages. More...

Inheritance diagram for ResourceLoaderWikiModule:
Collaboration diagram for ResourceLoaderWikiModule:

List of all members.

Public Member Functions

 getModifiedTime (ResourceLoaderContext $context)
 getScript (ResourceLoaderContext $context)
 getStyles (ResourceLoaderContext $context)
 isKnownEmpty (ResourceLoaderContext $context)

Protected Member Functions

 getContent ($title)
 getDB ()
 Get the Database object used in getTitleMTimes().
 getPages (ResourceLoaderContext $context)
 
 getTitleMtimes (ResourceLoaderContext $context)
 Get the modification times of all titles that would be loaded for a given context.

Protected Attributes

 $origin = self::ORIGIN_USER_SITEWIDE
 $titleMtimes = array()

Detailed Description

Abstraction for resource loader modules which pull from wiki pages.

This can only be used for wiki pages in the MediaWiki and User namespaces, because of its dependence on the functionality of Title::isCssJsSubpage.

Definition at line 32 of file ResourceLoaderWikiModule.php.


Member Function Documentation

ResourceLoaderWikiModule::getContent ( title) [protected]
Parameters:
$titleTitle
Returns:
null|string

Definition at line 71 of file ResourceLoaderWikiModule.php.

References $title, Revision\newFromTitle(), and wfMessage().

Referenced by getScript(), and getStyles().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the Database object used in getTitleMTimes().

Defaults to the local slave DB but subclasses may want to override this to return a remote DB object, or to return null if getTitleMTimes() shouldn't access the DB at all.

NOTE: This ONLY works for getTitleMTimes() and getModifiedTime(), NOT FOR ANYTHING ELSE. In particular, it doesn't work for getting the content of JS and CSS pages. That functionality will use the local DB irrespective of the return value of this method.

Returns:
DatabaseBase|null

Definition at line 63 of file ResourceLoaderWikiModule.php.

References wfGetDB().

Referenced by getTitleMtimes().

Here is the call graph for this function:

Here is the caller graph for this function:

Parameters:
$contextResourceLoaderContext
Returns:
int|mixed

Reimplemented from ResourceLoaderModule.

Definition at line 154 of file ResourceLoaderWikiModule.php.

References ResourceLoaderContext\getLanguage(), ResourceLoaderModule\getMsgBlobMtime(), and getTitleMtimes().

Here is the call graph for this function:

Parameters:
$contextResourceLoaderContext
Returns:
string

Reimplemented from ResourceLoaderModule.

Definition at line 92 of file ResourceLoaderWikiModule.php.

References $options, $title, getContent(), getPages(), Title\newFromText(), and ResourceLoaderModule\validateScriptFile().

Here is the call graph for this function:

Parameters:
$contextResourceLoaderContext
Returns:
array

Reimplemented from ResourceLoaderModule.

Definition at line 118 of file ResourceLoaderWikiModule.php.

References $options, $title, $wgScriptPath, getContent(), ResourceLoaderModule\getFlip(), getPages(), Title\newFromText(), CSSMin\remap(), and CSSJanus\transform().

Here is the call graph for this function:

Get the modification times of all titles that would be loaded for a given context.

Parameters:
$contextResourceLoaderContext: Context object
Returns:
array( prefixed DB key => UNIX timestamp ), nonexistent titles are dropped

Definition at line 178 of file ResourceLoaderWikiModule.php.

References $dbr, $options, $res, $title, LinkBatch\addObj(), getDB(), ResourceLoaderContext\getHash(), getPages(), Title\makeTitle(), Title\newFromText(), and wfTimestamp().

Referenced by getModifiedTime(), and isKnownEmpty().

Here is the call graph for this function:

Here is the caller graph for this function:

Parameters:
$contextResourceLoaderContext
Returns:
bool

Reimplemented from ResourceLoaderModule.

Definition at line 168 of file ResourceLoaderWikiModule.php.

References getTitleMtimes().

Here is the call graph for this function:


Member Data Documentation

ResourceLoaderWikiModule::$origin = self::ORIGIN_USER_SITEWIDE [protected]

Reimplemented from ResourceLoaderModule.

Reimplemented in ResourceLoaderUserModule, and ResourceLoaderUserGroupsModule.

Definition at line 37 of file ResourceLoaderWikiModule.php.

ResourceLoaderWikiModule::$titleMtimes = array() [protected]

Definition at line 40 of file ResourceLoaderWikiModule.php.


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