MediaWiki
REL1_19
|
Abstraction for resource loader modules which pull from wiki pages. More...
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() |
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.
ResourceLoaderWikiModule::getContent | ( | $ | title | ) | [protected] |
$title | Title |
Definition at line 71 of file ResourceLoaderWikiModule.php.
References $title, Revision\newFromTitle(), and wfMessage().
Referenced by getScript(), and getStyles().
ResourceLoaderWikiModule::getDB | ( | ) | [protected] |
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.
Definition at line 63 of file ResourceLoaderWikiModule.php.
References wfGetDB().
Referenced by getTitleMtimes().
$context | ResourceLoaderContext |
Reimplemented from ResourceLoaderModule.
Definition at line 154 of file ResourceLoaderWikiModule.php.
References ResourceLoaderContext\getLanguage(), ResourceLoaderModule\getMsgBlobMtime(), and getTitleMtimes().
ResourceLoaderWikiModule::getPages | ( | ResourceLoaderContext $ | context | ) | [abstract, protected] |
$context | ResourceLoaderContext |
Reimplemented in ResourceLoaderNoscriptModule, ResourceLoaderSiteModule, ResourceLoaderUserModule, ResourceLoaderUserGroupsModule, and ResourceLoaderFilePageModule.
Referenced by getScript(), getStyles(), and getTitleMtimes().
ResourceLoaderWikiModule::getScript | ( | ResourceLoaderContext $ | context | ) |
$context | ResourceLoaderContext |
Reimplemented from ResourceLoaderModule.
Definition at line 92 of file ResourceLoaderWikiModule.php.
References $options, $title, getContent(), getPages(), Title\newFromText(), and ResourceLoaderModule\validateScriptFile().
ResourceLoaderWikiModule::getStyles | ( | ResourceLoaderContext $ | context | ) |
$context | ResourceLoaderContext |
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().
ResourceLoaderWikiModule::getTitleMtimes | ( | ResourceLoaderContext $ | context | ) | [protected] |
Get the modification times of all titles that would be loaded for a given context.
$context | ResourceLoaderContext: Context object |
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().
$context | ResourceLoaderContext |
Reimplemented from ResourceLoaderModule.
Definition at line 168 of file ResourceLoaderWikiModule.php.
References getTitleMtimes().
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.