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, StatsFactory $statsFactory, MagicWordFactory $magicWordFactory, NamespaceInfo $namespaceInfo, SpecialPageFactory $specialPageFactory, InterwikiLookup $interwikiLookup, UserOptionsLookup $userOptionsLookup, LanguageFactory $languageFactory, LanguageConverterFactory $languageConverterFactory, LanguageNameUtils $languageNameUtils, UrlUtils $urlUtils, IContentHandlerFactory $contentHandlerFactory, 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)
 
 incrementCounter (string $name, array $labels)
 Increment a counter metric.
 
 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)
 
 observeTiming (string $name, float $value, array $labels)
 Record a timing metric.
 
 redirectRegexp ()
 
 relativeLinkPrefix ()
 
 rtl ()
 
 script ()
 
 scriptpath ()
 
 server ()
 
 setMaxTemplateDepth (int $depth)
 Overrides the max template depth in the MediaWiki configuration.
 
 specialPageLocalName (string $alias)
 
 supportsContentModel (string $model)
 Returns true iff Parsoid natively supports the given content model.
 
 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 68 of file SiteConfig.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\Config\SiteConfig::__construct ( ServiceOptions $config,
array $parsoidSettings,
ObjectFactory $objectFactory,
Language $contentLanguage,
StatsdDataFactoryInterface $stats,
StatsFactory $statsFactory,
MagicWordFactory $magicWordFactory,
NamespaceInfo $namespaceInfo,
SpecialPageFactory $specialPageFactory,
InterwikiLookup $interwikiLookup,
UserOptionsLookup $userOptionsLookup,
LanguageFactory $languageFactory,
LanguageConverterFactory $languageConverterFactory,
LanguageNameUtils $languageNameUtils,
UrlUtils $urlUtils,
IContentHandlerFactory $contentHandlerFactory,
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
StatsFactory$statsFactory
MagicWordFactory$magicWordFactory
NamespaceInfo$namespaceInfo
SpecialPageFactory$specialPageFactory
InterwikiLookup$interwikiLookup
UserOptionsLookup$userOptionsLookup
LanguageFactory$languageFactory
LanguageConverterFactory$languageConverterFactory
LanguageNameUtils$languageNameUtils
UrlUtils$urlUtils
IContentHandlerFactory$contentHandlerFactory
array$extensionParsoidModules
ParserFactory$parserFactory
Config$mwConfig
bool$isTimedMediaHandlerLoaded

Definition at line 150 of file SiteConfig.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ allowedExternalImagePrefixes()

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

Definition at line 292 of file SiteConfig.php.

◆ baseURI()

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

Definition at line 340 of file SiteConfig.php.

◆ bswRegexp()

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

Definition at line 389 of file SiteConfig.php.

◆ canonicalNamespaceId()

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

Definition at line 399 of file SiteConfig.php.

◆ categoryRegexp()

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

Definition at line 375 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 595 of file SiteConfig.php.

◆ galleryOptions()

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

Definition at line 288 of file SiteConfig.php.

◆ getExternalLinkTarget()

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

Definition at line 818 of file SiteConfig.php.

◆ getFunctionSynonyms()

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

Definition at line 706 of file SiteConfig.php.

◆ getLogger()

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

Definition at line 223 of file SiteConfig.php.

◆ getMagicWordMatcher()

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

Definition at line 716 of file SiteConfig.php.

◆ getMagicWords()

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

Definition at line 711 of file SiteConfig.php.

◆ getMaxTemplateDepth()

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

Definition at line 754 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 551 of file SiteConfig.php.

◆ getNoFollowConfig()

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

Definition at line 809 of file SiteConfig.php.

◆ getNonNativeExtensionTags()

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

Definition at line 746 of file SiteConfig.php.

◆ getObjectFactory()

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

Definition at line 218 of file SiteConfig.php.

◆ getParameterizedAliasMatcher()

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

Definition at line 721 of file SiteConfig.php.

◆ getProtocols()

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

Definition at line 804 of file SiteConfig.php.

◆ getSpecialNSAliases()

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

Definition at line 778 of file SiteConfig.php.

References NS_SPECIAL.

◆ getSpecialPageAliases()

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

Definition at line 797 of file SiteConfig.php.

◆ getVariableIDs()

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

Definition at line 701 of file SiteConfig.php.

◆ incrementCounter()

MediaWiki\Parser\Parsoid\Config\SiteConfig::incrementCounter ( string $name,
array $labels )

Increment a counter metric.

Parameters
string$name
array$labels
Returns
void

Definition at line 279 of file SiteConfig.php.

◆ interwikiMagic()

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

Definition at line 442 of file SiteConfig.php.

◆ interwikiMap()

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

Definition at line 452 of file SiteConfig.php.

◆ iwp()

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

Definition at line 512 of file SiteConfig.php.

◆ langBcp47()

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

Definition at line 532 of file SiteConfig.php.

◆ langConverterEnabledBcp47()

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

Definition at line 563 of file SiteConfig.php.

◆ legalTitleChars()

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

Definition at line 516 of file SiteConfig.php.

◆ linkPrefixRegex()

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

Definition at line 520 of file SiteConfig.php.

◆ linkTrail()

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

Definition at line 528 of file SiteConfig.php.

◆ magicLinkEnabled()

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

Definition at line 447 of file SiteConfig.php.

◆ mainpage()

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

Definition at line 536 of file SiteConfig.php.

◆ mainPageLinkTarget()

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

Definition at line 541 of file SiteConfig.php.

◆ metrics()

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

Definition at line 244 of file SiteConfig.php.

◆ namespaceCase()

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

Definition at line 422 of file SiteConfig.php.

◆ namespaceHasSubpages()

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

Definition at line 417 of file SiteConfig.php.

◆ namespaceId()

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

Definition at line 405 of file SiteConfig.php.

◆ namespaceIsTalk()

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

Definition at line 427 of file SiteConfig.php.

◆ namespaceName()

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

Definition at line 411 of file SiteConfig.php.

◆ observeTiming()

MediaWiki\Parser\Parsoid\Config\SiteConfig::observeTiming ( string $name,
float $value,
array $labels )

Record a timing metric.

Parameters
string$name
float$value
array$labels
Returns
void

Definition at line 264 of file SiteConfig.php.

◆ redirectRegexp()

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

Definition at line 370 of file SiteConfig.php.

◆ relativeLinkPrefix()

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

Definition at line 347 of file SiteConfig.php.

◆ rtl()

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

Definition at line 555 of file SiteConfig.php.

◆ script()

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

Definition at line 576 of file SiteConfig.php.

◆ scriptpath()

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

Definition at line 580 of file SiteConfig.php.

◆ server()

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

Definition at line 584 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 762 of file SiteConfig.php.

◆ specialPageLocalName()

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

Definition at line 437 of file SiteConfig.php.

◆ supportsContentModel()

MediaWiki\Parser\Parsoid\Config\SiteConfig::supportsContentModel ( string $model)

Returns true iff Parsoid natively supports the given content model.

Parameters
string$modelcontent model identifier
Returns
bool

Definition at line 829 of file SiteConfig.php.

◆ timezoneOffset()

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

Definition at line 617 of file SiteConfig.php.

◆ ucfirst()

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

Definition at line 432 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
since 1.43; use ::variantsFor() (T320662)

Definition at line 629 of file SiteConfig.php.

References wfDeprecated().

◆ 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 677 of file SiteConfig.php.

◆ widthOption()

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

Definition at line 693 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 74 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 76 of file SiteConfig.php.


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