Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Modules\SitesModule Class Reference
+ Inheritance diagram for Wikibase\Lib\Modules\SitesModule:
+ Collaboration diagram for Wikibase\Lib\Modules\SitesModule:

Public Member Functions

 __construct (?SettingsArray $clientSettings, ?SettingsArray $repoSettings, SiteLookup $siteLookup, BagOStuff $cache)
 
 getScript (RL\Context $context)
 Used to propagate information about sites to JavaScript. More...
 
 enableModuleContentVersion ()
 

Private Member Functions

 getSetting (string $settingName)
 Get a setting from the repo or client settings, with repo overriding client. More...
 
 computeSiteDetails (MediaWikiSite $site, array $specialGroups, MessageLocalizer $localizer)
 
 getSpecialSiteLanguageName (Site $site, MessageLocalizer $localizer)
 
 shouldSiteBeIncluded (Site $site, array $groups)
 Whether it's needed to add a Site to the JS variable. More...
 

Private Attributes

const SITE_DETAILS_TTL = 3600
 How many seconds the result of getSiteDetails() is cached. More...
 
 $clientSettings
 
 $repoSettings
 
 $siteLookup
 
 $cache
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Modules\SitesModule::__construct ( ?SettingsArray  $clientSettings,
?SettingsArray  $repoSettings,
SiteLookup  $siteLookup,
BagOStuff  $cache 
)
Parameters
SettingsArray | null$clientSettingsThe Client settings, if Client is enabled, else null.
SettingsArray | null$repoSettingsThe Repo settings, if Repo is enabled, else null.
SiteLookup$siteLookup
BagOStuff$cache

Member Function Documentation

◆ computeSiteDetails()

Wikibase\Lib\Modules\SitesModule::computeSiteDetails ( MediaWikiSite  $site,
array  $specialGroups,
MessageLocalizer  $localizer 
)
private
Parameters
MediaWikiSite$site
string[]$specialGroups
MessageLocalizer$localizer
Returns
string[]

◆ enableModuleContentVersion()

Wikibase\Lib\Modules\SitesModule::enableModuleContentVersion ( )

◆ getScript()

Wikibase\Lib\Modules\SitesModule::getScript ( RL\Context  $context)

Used to propagate information about sites to JavaScript.

Sites infos will be available in 'wbSiteDetails' config var.

See also
RL\Module::getScript
Parameters
RL\Context$context
Returns
string JavaScript Code

◆ getSetting()

Wikibase\Lib\Modules\SitesModule::getSetting ( string  $settingName)
private

Get a setting from the repo or client settings, with repo overriding client.

◆ getSpecialSiteLanguageName()

Wikibase\Lib\Modules\SitesModule::getSpecialSiteLanguageName ( Site  $site,
MessageLocalizer  $localizer 
)
private
Parameters
Site$site
MessageLocalizer$localizer
Returns
string

◆ shouldSiteBeIncluded()

Wikibase\Lib\Modules\SitesModule::shouldSiteBeIncluded ( Site  $site,
array  $groups 
)
private

Whether it's needed to add a Site to the JS variable.

Parameters
Site$site
string[]$groups
Returns
bool

Member Data Documentation

◆ $cache

Wikibase\Lib\Modules\SitesModule::$cache
private

◆ $clientSettings

Wikibase\Lib\Modules\SitesModule::$clientSettings
private

◆ $repoSettings

Wikibase\Lib\Modules\SitesModule::$repoSettings
private

◆ $siteLookup

Wikibase\Lib\Modules\SitesModule::$siteLookup
private

◆ SITE_DETAILS_TTL

const Wikibase\Lib\Modules\SitesModule::SITE_DETAILS_TTL = 3600
private

How many seconds the result of getSiteDetails() is cached.


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