Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Sites\SiteMatrixParser Class Reference

Translates api sitematrix results json into an array of Site objects. More...

Public Member Functions

 __construct ( $scriptPath, $articlePath, $protocol, $expandGroup=true)
 
 sitesFromJson ( $json)
 

Private Member Functions

 getSpecialSites (array $specialSites)
 
 getSitesFromLangGroup (array $langGroup)
 Gets an array of Site objects for all sites of the same language subdomain grouping used in the site matrix. More...
 
 getSiteFromSiteData (array $siteData)
 

Private Attributes

 $scriptPath
 
 $articlePath
 
 $expandGroup
 
 $protocol
 

Detailed Description

Translates api sitematrix results json into an array of Site objects.

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Sites\SiteMatrixParser::__construct (   $scriptPath,
  $articlePath,
  $protocol,
  $expandGroup = true 
)
Parameters
string$scriptPath(e.g. '/w/$1')
string$articlePath(e.g. '/wiki/$1')
string | bool$protocol(true: default, false: strip, string: protocol to force)
boolean$expandGroupexpands site matrix group codes from wiki to wikipedia

Member Function Documentation

◆ getSiteFromSiteData()

Wikibase\Lib\Sites\SiteMatrixParser::getSiteFromSiteData ( array  $siteData)
private
Parameters
array$siteData
Returns
Site

◆ getSitesFromLangGroup()

Wikibase\Lib\Sites\SiteMatrixParser::getSitesFromLangGroup ( array  $langGroup)
private

Gets an array of Site objects for all sites of the same language subdomain grouping used in the site matrix.

Parameters
array$langGroup
Returns
Site[]

◆ getSpecialSites()

Wikibase\Lib\Sites\SiteMatrixParser::getSpecialSites ( array  $specialSites)
private
Parameters
array[]$specialSites
Returns
Site[]

◆ sitesFromJson()

Wikibase\Lib\Sites\SiteMatrixParser::sitesFromJson (   $json)
Parameters
string$json
Exceptions
InvalidArgumentException
Returns
Site[]

Member Data Documentation

◆ $articlePath

Wikibase\Lib\Sites\SiteMatrixParser::$articlePath
private

◆ $expandGroup

Wikibase\Lib\Sites\SiteMatrixParser::$expandGroup
private

◆ $protocol

Wikibase\Lib\Sites\SiteMatrixParser::$protocol
private

◆ $scriptPath

Wikibase\Lib\Sites\SiteMatrixParser::$scriptPath
private

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