MediaWiki  1.23.2
ResourceLoaderLanguageDataModule Class Reference

ResourceLoader module for populating language specific data. More...

Inheritance diagram for ResourceLoaderLanguageDataModule:
Collaboration diagram for ResourceLoaderLanguageDataModule:

Public Member Functions

 getDependencies ()
 
 getModifiedHash (ResourceLoaderContext $context)
 
 getModifiedTime (ResourceLoaderContext $context)
 
 getScript (ResourceLoaderContext $context)
 
- Public Member Functions inherited from ResourceLoaderModule
 getDefinitionMtime (ResourceLoaderContext $context)
 Helper method for calculating when this module's definition summary was last changed. More...
 
 getDefinitionSummary (ResourceLoaderContext $context)
 Get the definition summary for this module. More...
 
 getFileDependencies ( $skin)
 Get the files this module depends on indirectly for a given skin. More...
 
 getFlip ( $context)
 
 getGroup ()
 Get the group this module is in. More...
 
 getHashMtime (ResourceLoaderContext $context)
 Helper method for calculating when the module's hash (if it has one) changed. More...
 
 getLoaderScript ()
 Get the loader JS for this module, if set. More...
 
 getMessages ()
 Get the messages needed for this module. More...
 
 getMsgBlobMtime ( $lang)
 Get the last modification timestamp of the message blob for this module in a given language. More...
 
 getName ()
 Get this module's name. More...
 
 getOrigin ()
 Get this module's origin. More...
 
 getPosition ()
 Where on the HTML page should this module's JS be loaded? More...
 
 getScriptURLsForDebug (ResourceLoaderContext $context)
 Get the URL or URLs to load for this module's JS in debug mode. More...
 
 getSource ()
 Get the origin of this module. More...
 
 getStyles (ResourceLoaderContext $context)
 Get all CSS for this module for a given skin. More...
 
 getStyleURLsForDebug (ResourceLoaderContext $context)
 Get the URL or URLs to load for this module's CSS in debug mode. More...
 
 getTargets ()
 Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']. More...
 
 isKnownEmpty (ResourceLoaderContext $context)
 Check whether this module is known to be empty. More...
 
 isRaw ()
 Whether this module's JS expects to work without the client-side ResourceLoader module. More...
 
 setFileDependencies ( $skin, $deps)
 Set preloaded file dependency information. More...
 
 setMsgBlobMtime ( $lang, $mtime)
 Set a preloaded message blob last modification timestamp. More...
 
 setName ( $name)
 Set this module's name. More...
 
 setOrigin ( $origin)
 Set this module's origin. More...
 
 supportsURLLoading ()
 Whether this module supports URL loading. More...
 

Protected Member Functions

 getData ()
 Get all the dynamic data for the content language to an array. More...
 
 getDigitGroupingPattern ()
 Get the digit groupin Pattern for the site content language. More...
 
 getDigitTransformTable ()
 Get the digit transform table for the content language. More...
 
 getPluralRules ()
 Get the plural forms for the site content language. More...
 
 getSeparatorTransformTable ()
 Get seperator transform table required for converting the . More...
 
 getSiteLangGrammarForms ()
 Get the grammar forms for the site content language. More...
 
- Protected Member Functions inherited from ResourceLoaderModule
 validateScriptFile ( $fileName, $contents)
 Validate a given script file; if valid returns the original source. More...
 

Protected Attributes

 $language
 
 $targets = array( 'desktop', 'mobile' )
 
- Protected Attributes inherited from ResourceLoaderModule
 $fileDeps = array()
 
 $msgBlobMtime = array()
 
 $name = null
 
 $origin = self::ORIGIN_CORE_SITEWIDE
 
 $targets = array( 'desktop' )
 

Additional Inherited Members

- Public Attributes inherited from ResourceLoaderModule
const ORIGIN_ALL = 10
 
const ORIGIN_CORE_INDIVIDUAL = 2
 
const ORIGIN_CORE_SITEWIDE = 1
 
const ORIGIN_USER_INDIVIDUAL = 4
 
const ORIGIN_USER_SITEWIDE = 3
 
const TYPE_COMBINED = 'combined'
 
const TYPE_MESSAGES = 'messages'
 
const TYPE_SCRIPTS = 'scripts'
 
const TYPE_STYLES = 'styles'
 
- Static Protected Member Functions inherited from ResourceLoaderModule
static javaScriptParser ()
 
static safeFilemtime ( $filename)
 Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist but returns 1 instead. More...
 

Detailed Description

ResourceLoader module for populating language specific data.

Definition at line 28 of file ResourceLoaderLanguageDataModule.php.

Member Function Documentation

◆ getData()

ResourceLoaderLanguageDataModule::getData ( )
protected

Get all the dynamic data for the content language to an array.

NOTE: Before calling this you HAVE to make sure $this->language is set.

Returns
array

Definition at line 85 of file ResourceLoaderLanguageDataModule.php.

References array(), getDigitGroupingPattern(), getDigitTransformTable(), getPluralRules(), getSeparatorTransformTable(), and getSiteLangGrammarForms().

Referenced by getModifiedHash(), and getScript().

◆ getDependencies()

ResourceLoaderLanguageDataModule::getDependencies ( )
Returns
array

Reimplemented from ResourceLoaderModule.

Definition at line 128 of file ResourceLoaderLanguageDataModule.php.

References array().

◆ getDigitGroupingPattern()

ResourceLoaderLanguageDataModule::getDigitGroupingPattern ( )
protected

Get the digit groupin Pattern for the site content language.

Returns
array

Definition at line 55 of file ResourceLoaderLanguageDataModule.php.

Referenced by getData().

◆ getDigitTransformTable()

ResourceLoaderLanguageDataModule::getDigitTransformTable ( )
protected

Get the digit transform table for the content language.

Returns
array

Definition at line 64 of file ResourceLoaderLanguageDataModule.php.

Referenced by getData().

◆ getModifiedHash()

ResourceLoaderLanguageDataModule::getModifiedHash ( ResourceLoaderContext  $context)
Parameters
$contextResourceLoaderContext
Returns
string: Hash

Reimplemented from ResourceLoaderModule.

Definition at line 119 of file ResourceLoaderLanguageDataModule.php.

References Language\factory(), getData(), and ResourceLoaderContext\getLanguage().

◆ getModifiedTime()

ResourceLoaderLanguageDataModule::getModifiedTime ( ResourceLoaderContext  $context)
Parameters
$contextResourceLoaderContext
Returns
int: UNIX timestamp

Reimplemented from ResourceLoaderModule.

Definition at line 111 of file ResourceLoaderLanguageDataModule.php.

References ResourceLoaderModule\getHashMtime().

◆ getPluralRules()

ResourceLoaderLanguageDataModule::getPluralRules ( )
protected

Get the plural forms for the site content language.

Returns
array

Definition at line 46 of file ResourceLoaderLanguageDataModule.php.

Referenced by getData().

◆ getScript()

ResourceLoaderLanguageDataModule::getScript ( ResourceLoaderContext  $context)
Parameters
$contextResourceLoaderContext
Returns
string: JavaScript code

Reimplemented from ResourceLoaderModule.

Definition at line 99 of file ResourceLoaderLanguageDataModule.php.

References array(), Xml\encodeJsCall(), Language\factory(), getData(), and ResourceLoaderContext\getLanguage().

◆ getSeparatorTransformTable()

ResourceLoaderLanguageDataModule::getSeparatorTransformTable ( )
protected

Get seperator transform table required for converting the .

and , sign to appropriate forms in site content language.

Returns
array

Definition at line 74 of file ResourceLoaderLanguageDataModule.php.

Referenced by getData().

◆ getSiteLangGrammarForms()

ResourceLoaderLanguageDataModule::getSiteLangGrammarForms ( )
protected

Get the grammar forms for the site content language.

Returns
array

Definition at line 37 of file ResourceLoaderLanguageDataModule.php.

Referenced by getData().

Member Data Documentation

◆ $language

ResourceLoaderLanguageDataModule::$language
protected

Definition at line 30 of file ResourceLoaderLanguageDataModule.php.

◆ $targets

ResourceLoaderLanguageDataModule::$targets = array( 'desktop', 'mobile' )
protected

Definition at line 31 of file ResourceLoaderLanguageDataModule.php.


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