|
| __construct (ApiHelper $api, array $opts) |
| - Parameters
-
|
|
| reset () |
|
| disableSubpagesForNS (int $ns) |
|
| enableSubpagesForNS (int $ns) |
|
| setupInterwikiMap (array $iwData) |
| Compute the interwiki map based on mock raw data.
|
|
| interwikiMap () |
| Interwiki link data.
|
|
| server () |
| The base URL of the server.
|
|
| script () |
| The URL path to index.php.
|
|
| scriptpath () |
| FIXME: This is only used to compute the modules path below and maybe shouldn't be exposed.
|
|
| baseURI () |
| Site base URI.
|
|
| allowedExternalImagePrefixes () |
| Allowed external image URL prefixes.
|
|
| getMWConfigValue (string $key) |
| Lookup config.- Parameters
-
- Returns
- mixed|null config value for $key, if present or null, if not.
|
|
| setInterwikiMagic (bool $val) |
|
| interwikiMagic () |
| Treat language links as magic connectors, not inline links.
|
|
| fakeTimestamp () |
| Fake timestamp, for unit tests.
|
|
| timezoneOffset () |
| Hardcode value for parser tests.
|
|
| widthOption () |
| Default thumbnail width.
|
|
| registerParserTestExtension (ExtensionModule $ext) |
| Register an extension for use in parser tests.
|
|
| setExternalLinkTarget ( $value) |
|
| getExternalLinkTarget () |
| - Returns
- string|false
|
|
| hasVideoInfo () |
|
| galleryOptions () |
| Default gallery options for this wiki.
|
|
| relativeLinkPrefix () |
| Prefix for relative links.
|
|
| canonicalNamespaceId (string $name) |
| Map a canonical namespace name to its index.- Note
- This replaces canonicalNamespaces
- Parameters
-
string | $name | all-lowercase and with underscores rather than spaces. |
- Returns
- int|null
|
|
| namespaceId (string $name) |
| Map a namespace name to its index.- Note
- This replaces canonicalNamespaces
- Parameters
-
- Returns
- int|null
|
|
| namespaceName (int $ns) |
| Map a namespace index to its preferred name.- Note
- This replaces namespaceNames
- Parameters
-
- Returns
- string|null
|
|
| namespaceHasSubpages (int $ns) |
| Test if a namespace has subpages.- Note
- This replaces namespacesWithSubpages
- Parameters
-
- Returns
- bool
|
|
| namespaceCase (int $ns) |
| Return namespace case setting.- Parameters
-
- Returns
- string 'first-letter' or 'case-sensitive'
|
|
| specialPageLocalName (string $alias) |
| Get the default local name for a special page.- Parameters
-
string | $alias | Special page alias |
- Returns
- string|null
|
|
| iwp () |
| Wiki identifier, for cache keys.
|
|
| legalTitleChars () |
| Legal title characters.
|
|
| linkPrefixRegex () |
| Link prefix regular expression.
|
|
| lang () |
| Wiki language code.
|
|
| mainpage () |
| Main page title.
|
|
| rtl () |
| Whether the wiki language is right-to-left.
|
|
| langConverterEnabledBcp47 (Bcp47Code $lang) |
| Whether language converter is enabled for the specified language.- Parameters
-
- Returns
- bool
|
|
| exportMetadataToHeadBcp47 (Document $document, ContentMetadataCollector $metadata, string $defaultTitle, Bcp47Code $lang) |
| Export content metadata via meta tags (and via a stylesheet for now to aid some clients).- Parameters
-
Document | $document | |
ContentMetadataCollector | $metadata | |
string | $defaultTitle | The default title to display, as an unescaped string |
Bcp47Code | $lang | a BCP-47 language code |
|
|
| redirectRegexp () |
| A regexp matching the localized 'REDIRECT' marker for this wiki.
|
|
| categoryRegexp () |
| A regexp matching the localized 'Category' prefix for this wiki.
|
|
| bswRegexp () |
| A regexp matching localized behavior switches for this wiki.
|
|
| 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)
|
|
| variantsFor (Bcp47Code $lang) |
| Language variant information for the given language (or null if unknown).- Parameters
-
Bcp47Code | $lang | The 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
|
|
| getMagicWordMatcher (string $id) |
| Get a regexp matching a localized magic word, given its id.FIXME: misleading function name- Parameters
-
- Returns
- string
|
|
| getParameterizedAliasMatcher (array $words) |
| Get a matcher function for fetching values out of interpolated magic words, ie those with $1 in their aliases.The matcher takes a string and returns null if it doesn't match any of the words, or an associative array if it did match:
- k: The magic word that matched
- v: The value of $1 that was matched (the JS also returned 'a' with the specific alias that matched, but that seems to be unused and so is omitted here)
- Parameters
-
string[] | $words | Magic words to match |
- Returns
- callable
|
|
| ensureExtensionTag (string $tag) |
| This function is public so it can be used to synchronize env for hybrid parserTests.
|
|
| getMaxTemplateDepth () |
| Get the maximum template depth.- Returns
- int
|
|
| metrics () |
| Statistics aggregator, for counting and timing.- Returns
- StatsdDataFactoryInterface|null
|
|
| getNoFollowConfig () |
| - Returns
- array
|
|
| registerExtensionModule ( $configOrSpec) |
| Register a Parsoid extension module.
|
|
| unregisterExtensionModule (int $extId) |
| Unregister a Parsoid extension module.
|
|
| getExtensionModules () |
| Return the set of Parsoid extension modules associated with this SiteConfig.
|
|
| __construct () |
| Base constructor.
|
|
| getObjectFactory () |
| Return an object factory to use when instantiating extensions.
|
|
| tagNeedsNowikiStrippedInTagPF (string $lowerTagName) |
|
| getContentModelHandler (string $contentmodel) |
| Return a ContentModelHandler for the specified $contentmodel, if one is registered.
|
|
| isExtensionTag (string $name) |
| Determine whether a given name, which must have already been converted to lower case, is a valid extension tag name.
|
|
| isAnnotationTag (string $tagName) |
|
| getAnnotationTags () |
| Get an array of defined annotation tags in lower case.
|
|
| getExtensionTagNameMap () |
| Get an array of defined extension tags, with the lower case name in the key, and the value being arbitrary.
|
|
| getExtTagConfig (string $tagName) |
|
| getExtTagImpl (string $tagName) |
|
| getExtDOMProcessors () |
| Return an array mapping extension name to an array of object factory specs for Ext\DOMProcessor objects.
|
|
| getWt2HtmlLimits () |
|
| getHtml2WtLimits () |
|
| getLogger () |
| General log channel.
|
|
| setLogger (?LoggerInterface $logger) |
| Set the log channel, for debugging.
|
|
| nativeGalleryEnabled () |
| "Native gallery" serialization.
|
|
| addHTMLTemplateParameters () |
| When processing template parameters, parse them to HTML and add it to the template parameters data.
|
|
| linting () |
| Whether to enable linter Backend.
|
|
| tidyWhitespaceBugMaxLength () |
| Maximum run length for Tidy whitespace bug.
|
|
| scrubBidiChars () |
| If enabled, bidi chars adjacent to category links will be stripped in the html -> wt serialization pass.
|
|
| bswPagePropRegexp () |
| Regex matching all double-underscore magic words.
|
|
| namespaceIsTalk (int $ns) |
| Test if a namespace is a talk namespace.
|
|
| ucfirst (string $str) |
| Uppercasing method for titles.
|
|
| interwikiMapNoNamespaces () |
| Interwiki link data, after removing items that conflict with namespace names.
|
|
| interwikiMatcher (string $href) |
| Match interwiki URLs.
|
|
| linkTrailRegex () |
| Link trail regular expression.
|
|
| langBcp47 () |
| Wiki language code.
|
|
| langConverterEnabled (string $lang) |
| Whether language converter is enabled for the specified language.
|
|
| langConverterEnabledForLanguage (string $lang) |
| Is the language converter enabled for this language?
|
|
| exportMetadataToHead (Document $document, ContentMetadataCollector $metadata, string $defaultTitle, string $lang) |
| Export content metadata via meta tags (and via a stylesheet for now to aid some clients).
|
|
| solTransparentWikitextRegexp () |
| A regex matching a line containing just whitespace, comments, and sol transparent links and behavior switches.
|
|
| solTransparentWikitextNoWsRegexp (bool $addIncludes=false) |
| A regex matching a line containing just comments and sol transparent links and behavior switches.
|
|
| magicWords () |
| List all magic words by alias.
|
|
| mwAliases () |
| List all magic words by canonical name.
|
|
| getMagicWordForFunctionHook (string $str) |
| Return canonical magic word for a function hook.
|
|
| getMagicWordForVariable (string $str) |
| Return canonical magic word for a variable.
|
|
| magicWordCanonicalName (string $word) |
| Get canonical magicword name for the input word.
|
|
| isMagicWord (string $word) |
| Check if a string is a recognized magic word.
|
|
| getMagicWordWT (string $word, string $suggest) |
| Convert the internal canonical magic word name to the wikitext alias.
|
|
| getMediaPrefixParameterizedAliasMatcher () |
| Get a matcher function for fetching values out of interpolated magic words which are media prefix options.
|
|
| getExtResourceURLPatternMatcher () |
| Matcher for ISBN/RFC/PMID URL patterns, returning the type and number.
|
|
| makeExtResourceURL (array $match, string $href, string $content) |
| Serialize ISBN/RFC/PMID URL patterns.
|
|
| getProtocolsRegex (bool $excludeProtRel=false) |
| Get a regex fragment matching URL protocols, quoted for an exclamation mark delimiter.
|
|
| hasValidProtocol (string $potentialLink) |
| Matcher for valid protocols, must be anchored at start of string.
|
|
| findValidProtocol (string $potentialLink) |
| Matcher for valid protocols, may occur at any point within string.
|
|
|
static | fromSettings (array $parsoidSettings) |
|
static | createLogger (?string $filePath=null) |
|
| addNamespace (array $ns) |
| Add a new namespace to the config.
|
|
| linkTrail () |
| Return raw link trail regexp from config.- Returns
- string
|
|
| getVariableIDs () |
| - Returns
- array
|
|
| haveComputedFunctionSynonyms () |
| Does the SiteConfig provide precomputed function synonyms? If no, the SiteConfig is expected to provide an implementation for updateFunctionSynonym.- Returns
- bool
|
|
| updateFunctionSynonym (string $func, string $magicword, bool $caseSensitive) |
| - Parameters
-
string | $func | |
string | $magicword | |
bool | $caseSensitive | |
|
|
| getMagicWords () |
| - Returns
- array
|
|
| getNonNativeExtensionTags () |
| Get an array of defined extension tags, with the lower case name in the key, the value arbitrary.This is the set of extension tags that are configured in M/W core. $coreExtModules may already be part of it, but eventually this distinction will disappear since all extension tags have to be defined against the Parsoid's extension API.- Returns
- array
|
|
| getSpecialNSAliases () |
| Return name spaces aliases for the NS_SPECIAL namespace.- Returns
- array
|
|
| getSpecialPageAliases (string $specialPage) |
| Return Special Page aliases for a special page name.- Parameters
-
- Returns
- array
|
|
| getProtocols () |
| Get the list of valid protocols.- Returns
- array
|
|
| processExtensionModule (ExtensionModule $ext) |
| Register a Parsoid-compatible extension.
|
|
| getExtConfig () |
|
| exportMetadataHelper (Document $document, string $modulesLoadURI, array $modules, array $moduleStyles, array $jsConfigVars, string $htmlTitle, $lang) |
| Helper function to create <head> elements from metadata.
|
|
| getFunctionSynonyms () |
| Get a list of precomputed function synonyms.
|
|
static | quoteTitleRe (string $s, string $delimiter='/') |
| Quote a title regex.
|
|
| $nsNames = [] |
| @phan-var array<int,string>
|
|
| $nsCase = [] |
| @phan-var array<int,string>
|
|
| $nsIds = [] |
| @phan-var array<string,int>
|
|
| $nsCanon = [] |
| @phan-var array<string,int>
|
|
| $nsWithSubpages = [] |
| @phan-var array<int,bool>
|
|
| $magicWordMap |
|
| $functionSynonyms |
|
| $interwikiMapNoNamespaces |
|
| $linkTrailRegex = false |
|
| $logger = null |
|
| $iwMatcherBatchSize = 4096 |
|
| $addHTMLTemplateParameters = false |
|
| $scrubBidiChars = false |
|
| $linterEnabled = false |
|
| $extConfig = null |
|
| $wt2htmlLimits |
| @phan-var array<string,int>
|
|
| $html2wtLimits |
| @phan-var array<string,int>
|
|