MediaWiki
REL1_22
|
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) | |
Subclasses should return an associative array of resources in the module. | |
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 83 of file ResourceLoaderWikiModule.php.
References $title, Revision\newFromTitle(), Revision\RAW, IDBAccessObject\READ_NORMAL, and wfDebugLog().
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 75 of file ResourceLoaderWikiModule.php.
References wfGetDB().
Referenced by getTitleMtimes().
$context | ResourceLoaderContext |
Reimplemented from ResourceLoaderModule.
Definition at line 177 of file ResourceLoaderWikiModule.php.
References ResourceLoaderContext\getLanguage(), ResourceLoaderModule\getMsgBlobMtime(), and getTitleMtimes().
ResourceLoaderWikiModule::getPages | ( | ResourceLoaderContext $ | context | ) | [abstract, protected] |
Subclasses should return an associative array of resources in the module.
Keys should be the title of a page in the MediaWiki or User namespace.
Values should be a nested array of options. The supported keys are 'type' and (CSS only) 'media'.
For scripts, 'type' should be 'script'.
For stylesheets, 'type' should be 'style'. There is an optional media key, the value of which can be the medium ('screen', 'print', etc.) of the stylesheet.
$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 115 of file ResourceLoaderWikiModule.php.
References $options, $title, as, getContent(), getPages(), Title\newFromText(), and ResourceLoaderModule\validateScriptFile().
ResourceLoaderWikiModule::getStyles | ( | ResourceLoaderContext $ | context | ) |
$context | ResourceLoaderContext |
Reimplemented from ResourceLoaderModule.
Definition at line 141 of file ResourceLoaderWikiModule.php.
References $options, $title, array(), as, getContent(), ResourceLoaderModule\getFlip(), getPages(), global, 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 201 of file ResourceLoaderWikiModule.php.
References $batch, $dbr, $hash, $options, $res, $title, array(), as, getDB(), ResourceLoaderContext\getHash(), getPages(), Title\makeTitle(), Title\newFromText(), and wfTimestamp().
Referenced by getModifiedTime(), and isKnownEmpty().
$context | ResourceLoaderContext |
Reimplemented from ResourceLoaderModule.
Definition at line 191 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.