MediaWiki master
MediaWiki\Parser\Parsoid\Config\SiteConfig Class Reference

Site-level configuration for Parsoid. More...

Inherits ISiteConfig.

Collaboration diagram for MediaWiki\Parser\Parsoid\Config\SiteConfig:

Public Member Functions

 __construct (ServiceOptions $config, array $parsoidSettings, ObjectFactory $objectFactory, Language $contentLanguage, StatsdDataFactoryInterface $stats, MagicWordFactory $magicWordFactory, NamespaceInfo $namespaceInfo, SpecialPageFactory $specialPageFactory, InterwikiLookup $interwikiLookup, UserOptionsLookup $userOptionsLookup, LanguageFactory $languageFactory, LanguageConverterFactory $languageConverterFactory, LanguageNameUtils $languageNameUtils, UrlUtils $urlUtils, array $extensionParsoidModules, ParserFactory $parserFactory, Config $mwConfig, bool $isTimedMediaHandlerLoaded)
 
 allowedExternalImagePrefixes ()
 
 baseURI ()
 
 bswRegexp ()
 
 canonicalNamespaceId (string $name)
 
 categoryRegexp ()
 
 exportMetadataToHeadBcp47 (Document $document, ContentMetadataCollector $metadata, string $defaultTitle, Bcp47Code $lang)
 
 galleryOptions ()
 
 getExternalLinkTarget ()
 
 getLogger ()
 
 getMagicWordMatcher (string $id)
 
 getMaxTemplateDepth ()
 
 getMWConfigValue (string $key)
 Lookup config.
 
 getNoFollowConfig ()
 
 getObjectFactory ()
 
 getParameterizedAliasMatcher (array $words)
 
 interwikiMagic ()
 
 interwikiMap ()
 
 iwp ()
 
 langBcp47 ()
 
 langConverterEnabledBcp47 (Bcp47Code $lang)
 
 legalTitleChars ()
 
 linkPrefixRegex ()
 
 magicLinkEnabled (string $which)
 
 mainpage ()
 
 mainPageLinkTarget ()
 
 metrics ()
 
 namespaceCase (int $ns)
 
 namespaceHasSubpages (int $ns)
 
 namespaceId (string $name)
 
 namespaceIsTalk (int $ns)
 
 namespaceName (int $ns)
 
 redirectRegexp ()
 
 relativeLinkPrefix ()
 
 rtl ()
 
 script ()
 
 scriptpath ()
 
 server ()
 
 setMaxTemplateDepth (int $depth)
 Overrides the max template depth in the MediaWiki configuration.
 
 specialPageLocalName (string $alias)
 
 timezoneOffset ()
 
 ucfirst (string $str)
 
 variants ()
 Language variant information.
 
 variantsFor (Bcp47Code $code)
 Language variant information for the given language (or null if unknown).
 
 widthOption ()
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Protected Member Functions

 getFunctionSynonyms ()
 
 getMagicWords ()
 
 getNonNativeExtensionTags ()
 
 getProtocols ()
 
 getSpecialNSAliases ()
 
 getSpecialPageAliases (string $specialPage)
 
 getVariableIDs ()
 
 linkTrail ()
 

Protected Attributes

const COMMENT_REGEXP_FRAGMENT = '<!--(?>[\s\S]*?-->)'
 Regular expression fragment for matching wikitext comments.
 

Detailed Description

Site-level configuration for Parsoid.

This includes both global configuration and wiki-level configuration.

Since
1.39
Access: internal

Definition at line 65 of file SiteConfig.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\Config\SiteConfig::__construct ( ServiceOptions $config,
array $parsoidSettings,
ObjectFactory $objectFactory,
Language $contentLanguage,
StatsdDataFactoryInterface $stats,
MagicWordFactory $magicWordFactory,
NamespaceInfo $namespaceInfo,
SpecialPageFactory $specialPageFactory,
InterwikiLookup $interwikiLookup,
UserOptionsLookup $userOptionsLookup,
LanguageFactory $languageFactory,
LanguageConverterFactory $languageConverterFactory,
LanguageNameUtils $languageNameUtils,
UrlUtils $urlUtils,
array $extensionParsoidModules,
ParserFactory $parserFactory,
Config $mwConfig,
bool $isTimedMediaHandlerLoaded )
Parameters
ServiceOptions$configMediaWiki main configuration object
array$parsoidSettingsParsoid-specific options array from main configuration.
ObjectFactory$objectFactory
Language$contentLanguageContent language.
StatsdDataFactoryInterface$stats
MagicWordFactory$magicWordFactory
NamespaceInfo$namespaceInfo
SpecialPageFactory$specialPageFactory
InterwikiLookup$interwikiLookup
UserOptionsLookup$userOptionsLookup
LanguageFactory$languageFactory
LanguageConverterFactory$languageConverterFactory
LanguageNameUtils$languageNameUtils
UrlUtils$urlUtils
array$extensionParsoidModules
ParserFactory$parserFactory
Config$mwConfig
bool$isTimedMediaHandlerLoaded

Definition at line 143 of file SiteConfig.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ allowedExternalImagePrefixes()

MediaWiki\Parser\Parsoid\Config\SiteConfig::allowedExternalImagePrefixes ( )

Definition at line 237 of file SiteConfig.php.

◆ baseURI()

MediaWiki\Parser\Parsoid\Config\SiteConfig::baseURI ( )

Definition at line 285 of file SiteConfig.php.

◆ bswRegexp()

MediaWiki\Parser\Parsoid\Config\SiteConfig::bswRegexp ( )

Definition at line 334 of file SiteConfig.php.

◆ canonicalNamespaceId()

MediaWiki\Parser\Parsoid\Config\SiteConfig::canonicalNamespaceId ( string $name)

Definition at line 344 of file SiteConfig.php.

◆ categoryRegexp()

MediaWiki\Parser\Parsoid\Config\SiteConfig::categoryRegexp ( )

Definition at line 320 of file SiteConfig.php.

References NS_CATEGORY.

◆ exportMetadataToHeadBcp47()

MediaWiki\Parser\Parsoid\Config\SiteConfig::exportMetadataToHeadBcp47 ( Document $document,
ContentMetadataCollector $metadata,
string $defaultTitle,
Bcp47Code $lang )

Parameters
Document$document
ContentMetadataCollector$metadata
string$defaultTitle
Bcp47Code$lang

Definition at line 540 of file SiteConfig.php.

◆ galleryOptions()

MediaWiki\Parser\Parsoid\Config\SiteConfig::galleryOptions ( )

Definition at line 233 of file SiteConfig.php.

◆ getExternalLinkTarget()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getExternalLinkTarget ( )
Returns
string|false

Definition at line 758 of file SiteConfig.php.

◆ getFunctionSynonyms()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getFunctionSynonyms ( )
protected

Definition at line 646 of file SiteConfig.php.

◆ getLogger()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getLogger ( )

Definition at line 212 of file SiteConfig.php.

◆ getMagicWordMatcher()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getMagicWordMatcher ( string $id)

Definition at line 656 of file SiteConfig.php.

◆ getMagicWords()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getMagicWords ( )
protected
Returns
array<string,array> $magicWord => [ int $caseSensitive, string ...$alias ]

Definition at line 651 of file SiteConfig.php.

◆ getMaxTemplateDepth()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getMaxTemplateDepth ( )

Definition at line 694 of file SiteConfig.php.

◆ getMWConfigValue()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getMWConfigValue ( string $key)

Lookup config.

Parameters
string$key
Returns
mixed config value for $key, if present or null, if not.

Definition at line 496 of file SiteConfig.php.

◆ getNoFollowConfig()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getNoFollowConfig ( )
Returns
array

Definition at line 749 of file SiteConfig.php.

◆ getNonNativeExtensionTags()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getNonNativeExtensionTags ( )
protected

Definition at line 686 of file SiteConfig.php.

◆ getObjectFactory()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getObjectFactory ( )

Definition at line 207 of file SiteConfig.php.

◆ getParameterizedAliasMatcher()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getParameterizedAliasMatcher ( array $words)

Definition at line 661 of file SiteConfig.php.

◆ getProtocols()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getProtocols ( )
protected

Definition at line 744 of file SiteConfig.php.

◆ getSpecialNSAliases()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getSpecialNSAliases ( )
protected

Definition at line 718 of file SiteConfig.php.

References NS_SPECIAL.

◆ getSpecialPageAliases()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getSpecialPageAliases ( string $specialPage)
protected

Definition at line 737 of file SiteConfig.php.

◆ getVariableIDs()

MediaWiki\Parser\Parsoid\Config\SiteConfig::getVariableIDs ( )
protected

Definition at line 641 of file SiteConfig.php.

◆ interwikiMagic()

MediaWiki\Parser\Parsoid\Config\SiteConfig::interwikiMagic ( )

Definition at line 387 of file SiteConfig.php.

◆ interwikiMap()

MediaWiki\Parser\Parsoid\Config\SiteConfig::interwikiMap ( )

Definition at line 397 of file SiteConfig.php.

◆ iwp()

MediaWiki\Parser\Parsoid\Config\SiteConfig::iwp ( )

Definition at line 457 of file SiteConfig.php.

◆ langBcp47()

MediaWiki\Parser\Parsoid\Config\SiteConfig::langBcp47 ( )

Definition at line 477 of file SiteConfig.php.

◆ langConverterEnabledBcp47()

MediaWiki\Parser\Parsoid\Config\SiteConfig::langConverterEnabledBcp47 ( Bcp47Code $lang)
Parameters
Bcp47Code$lang
Returns
bool

Definition at line 508 of file SiteConfig.php.

◆ legalTitleChars()

MediaWiki\Parser\Parsoid\Config\SiteConfig::legalTitleChars ( )

Definition at line 461 of file SiteConfig.php.

◆ linkPrefixRegex()

MediaWiki\Parser\Parsoid\Config\SiteConfig::linkPrefixRegex ( )

Definition at line 465 of file SiteConfig.php.

◆ linkTrail()

MediaWiki\Parser\Parsoid\Config\SiteConfig::linkTrail ( )
protected

Definition at line 473 of file SiteConfig.php.

◆ magicLinkEnabled()

MediaWiki\Parser\Parsoid\Config\SiteConfig::magicLinkEnabled ( string $which)

Definition at line 392 of file SiteConfig.php.

◆ mainpage()

MediaWiki\Parser\Parsoid\Config\SiteConfig::mainpage ( )

Definition at line 481 of file SiteConfig.php.

◆ mainPageLinkTarget()

MediaWiki\Parser\Parsoid\Config\SiteConfig::mainPageLinkTarget ( )

Definition at line 486 of file SiteConfig.php.

◆ metrics()

MediaWiki\Parser\Parsoid\Config\SiteConfig::metrics ( )

Definition at line 220 of file SiteConfig.php.

◆ namespaceCase()

MediaWiki\Parser\Parsoid\Config\SiteConfig::namespaceCase ( int $ns)

Definition at line 367 of file SiteConfig.php.

◆ namespaceHasSubpages()

MediaWiki\Parser\Parsoid\Config\SiteConfig::namespaceHasSubpages ( int $ns)

Definition at line 362 of file SiteConfig.php.

◆ namespaceId()

MediaWiki\Parser\Parsoid\Config\SiteConfig::namespaceId ( string $name)

Definition at line 350 of file SiteConfig.php.

◆ namespaceIsTalk()

MediaWiki\Parser\Parsoid\Config\SiteConfig::namespaceIsTalk ( int $ns)

Definition at line 372 of file SiteConfig.php.

◆ namespaceName()

MediaWiki\Parser\Parsoid\Config\SiteConfig::namespaceName ( int $ns)

Definition at line 356 of file SiteConfig.php.

◆ redirectRegexp()

MediaWiki\Parser\Parsoid\Config\SiteConfig::redirectRegexp ( )

Definition at line 315 of file SiteConfig.php.

◆ relativeLinkPrefix()

MediaWiki\Parser\Parsoid\Config\SiteConfig::relativeLinkPrefix ( )

Definition at line 292 of file SiteConfig.php.

◆ rtl()

MediaWiki\Parser\Parsoid\Config\SiteConfig::rtl ( )

Definition at line 500 of file SiteConfig.php.

◆ script()

MediaWiki\Parser\Parsoid\Config\SiteConfig::script ( )

Definition at line 521 of file SiteConfig.php.

◆ scriptpath()

MediaWiki\Parser\Parsoid\Config\SiteConfig::scriptpath ( )

Definition at line 525 of file SiteConfig.php.

◆ server()

MediaWiki\Parser\Parsoid\Config\SiteConfig::server ( )

Definition at line 529 of file SiteConfig.php.

◆ setMaxTemplateDepth()

MediaWiki\Parser\Parsoid\Config\SiteConfig::setMaxTemplateDepth ( int $depth)

Overrides the max template depth in the MediaWiki configuration.

Parameters
int$depth

Definition at line 702 of file SiteConfig.php.

◆ specialPageLocalName()

MediaWiki\Parser\Parsoid\Config\SiteConfig::specialPageLocalName ( string $alias)

Definition at line 382 of file SiteConfig.php.

◆ timezoneOffset()

MediaWiki\Parser\Parsoid\Config\SiteConfig::timezoneOffset ( )

Definition at line 562 of file SiteConfig.php.

◆ ucfirst()

MediaWiki\Parser\Parsoid\Config\SiteConfig::ucfirst ( string $str)

Definition at line 377 of file SiteConfig.php.

◆ variants()

MediaWiki\Parser\Parsoid\Config\SiteConfig::variants ( )

Language variant information.

Returns
array<string,array> Keys are MediaWiki-internal variant codes (e.g. "zh-cn"), values are arrays with two fields:
  • base: (string) Base language code (e.g. "zh") (MediaWiki-internal)
  • fallbacks: (string[]) Fallback variants (MediaWiki-internal codes)
Deprecated
Use ::variantsFor() (T320662)

Definition at line 574 of file SiteConfig.php.

◆ variantsFor()

MediaWiki\Parser\Parsoid\Config\SiteConfig::variantsFor ( Bcp47Code $code)

Language variant information for the given language (or null if unknown).

Parameters
Bcp47Code$codeThe language for which you want variant information
Returns
?array{base:Bcp47Code,fallbacks:Bcp47Code[]} an array with two fields:
  • base: (Bcp47Code) Base BCP-47 language code (e.g. "zh")
  • fallbacks: (Bcp47Code[]) Fallback variants, as BCP-47 codes

Definition at line 617 of file SiteConfig.php.

◆ widthOption()

MediaWiki\Parser\Parsoid\Config\SiteConfig::widthOption ( )

Definition at line 633 of file SiteConfig.php.

Member Data Documentation

◆ COMMENT_REGEXP_FRAGMENT

const MediaWiki\Parser\Parsoid\Config\SiteConfig::COMMENT_REGEXP_FRAGMENT = '<!--(?>[\s\S]*?-->)'
protected

Regular expression fragment for matching wikitext comments.

Meant for inclusion in other regular expressions.

Definition at line 71 of file SiteConfig.php.

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Parser\Parsoid\Config\SiteConfig::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const ExternalLinkTarget
Name constant for the ExternalLinkTarget setting, for use with Config::get()
const NoFollowDomainExceptions
Name constant for the NoFollowDomainExceptions setting, for use with Config::get()
const NamespaceAliases
Name constant for the NamespaceAliases setting, for use with Config::get()
const Server
Name constant for the Server setting, for use with Config::get()
const NoFollowNsExceptions
Name constant for the NoFollowNsExceptions setting, for use with Config::get()
const AllowExternalImages
Name constant for the AllowExternalImages setting, for use with Config::get()
const UrlProtocols
Name constant for the UrlProtocols setting, for use with Config::get()
const ArticlePath
Name constant for the ArticlePath setting, for use with Config::get()
const LocalTZoffset
Name constant for the LocalTZoffset setting, for use with Config::get()
const MaxTemplateDepth
Name constant for the MaxTemplateDepth setting, for use with Config::get()
const InterlanguageLinkCodeMap
Name constant for the InterlanguageLinkCodeMap setting, for use with Config::get()
const ScriptPath
Name constant for the ScriptPath setting, for use with Config::get()
const GalleryOptions
Name constant for the GalleryOptions setting, for use with Config::get()
const EnableMagicLinks
Name constant for the EnableMagicLinks setting, for use with Config::get()
const ThumbLimits
Name constant for the ThumbLimits setting, for use with Config::get()
const LanguageCode
Name constant for the LanguageCode setting, for use with Config::get()
const LocalInterwikis
Name constant for the LocalInterwikis setting, for use with Config::get()
const InterwikiMagic
Name constant for the InterwikiMagic setting, for use with Config::get()
const LoadScript
Name constant for the LoadScript setting, for use with Config::get()
const AllowExternalImagesFrom
Name constant for the AllowExternalImagesFrom setting, for use with Config::get()
const NoFollowLinks
Name constant for the NoFollowLinks setting, for use with Config::get()
const Script
Name constant for the Script setting, for use with Config::get()
const ExtraInterlanguageLinkPrefixes
Name constant for the ExtraInterlanguageLinkPrefixes setting, for use with Config::get()

Definition at line 73 of file SiteConfig.php.


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