MediaWiki
1.32.5
|
Public Member Functions | |
__construct ( $parent) | |
__destruct () | |
Reduce memory usage to reduce the impact of circular references. More... | |
__sleep () | |
Don't serialize the parent object, it is big, and not needed when it is a parameter to mergeForeign(), which is the only application of serializing at present. More... | |
__wakeup () | |
Recreate the Title objects. More... | |
clear () | |
Clear all stored link holders. More... | |
getSubArray ( $text) | |
Get a subset of the current LinkHolderArray which is sufficient to interpret the given text. More... | |
isBig () | |
Returns true if the memory requirements of this object are getting large. More... | |
makeHolder ( $nt, $text='', $query=[], $trail='', $prefix='') | |
Make a link placeholder. More... | |
merge ( $other) | |
Merge another LinkHolderArray into this one. More... | |
mergeForeign ( $other, $texts) | |
Merge a LinkHolderArray from another parser instance into this one. More... | |
replace (&$text) | |
Replace link placeholders with actual links, in the buffer. More... | |
replaceText ( $text) | |
Replace link placeholders with plain text of links (not HTML-formatted). More... | |
replaceTextCallback ( $matches) | |
Callback for replaceText() More... | |
Public Attributes | |
$internals = [] | |
$interwikis = [] | |
Parser | $parent |
$size = 0 | |
Protected Member Functions | |
doVariants (&$colours) | |
Modify $this->internals and $colours according to language variant linking rules. More... | |
mergeForeignCallback ( $m) | |
replaceInternal (&$text) | |
Replace internal links. More... | |
replaceInterwiki (&$text) | |
Replace interwiki links. More... | |
Protected Attributes | |
$tempIdOffset | |
Definition at line 29 of file LinkHolderArray.php.
LinkHolderArray::__construct | ( | $parent | ) |
LinkHolderArray::__destruct | ( | ) |
Reduce memory usage to reduce the impact of circular references.
Definition at line 50 of file LinkHolderArray.php.
LinkHolderArray::__sleep | ( | ) |
Don't serialize the parent object, it is big, and not needed when it is a parameter to mergeForeign(), which is the only application of serializing at present.
Compact the titles, only serialize the text form.
Definition at line 64 of file LinkHolderArray.php.
References as.
LinkHolderArray::__wakeup | ( | ) |
Recreate the Title objects.
Definition at line 84 of file LinkHolderArray.php.
References as, and Title\newFromText().
LinkHolderArray::clear | ( | ) |
Clear all stored link holders.
Make sure you don't have any text left using these link holders, before you call this
Definition at line 214 of file LinkHolderArray.php.
|
protected |
Modify $this->internals and $colours according to language variant linking rules.
array | &$colours |
Definition at line 452 of file LinkHolderArray.php.
References $colours, $dbr, $linkRenderer, $output, $s, $title, as, captcha-old\count, DB_REPLICA, LinkCache\getSelectFields(), list, Title\makeTitle(), Title\makeTitleSafe(), NS_CATEGORY, NS_SPECIAL, Hooks\run(), and wfGetDB().
Referenced by replaceInternal().
LinkHolderArray::getSubArray | ( | $text | ) |
Get a subset of the current LinkHolderArray which is sufficient to interpret the given text.
string | $text |
Definition at line 171 of file LinkHolderArray.php.
LinkHolderArray::isBig | ( | ) |
Returns true if the memory requirements of this object are getting large.
Definition at line 205 of file LinkHolderArray.php.
References $wgLinkHolderBatchSize.
LinkHolderArray::makeHolder | ( | $nt, | |
$text = '' , |
|||
$query = [] , |
|||
$trail = '' , |
|||
$prefix = '' |
|||
) |
Make a link placeholder.
The text returned can be later resolved to a real link with replaceLinkHolders(). This is done for two reasons: firstly to avoid further parsing of interwiki links, and secondly to allow all existence checks and article length checks (for stub links) to be bundled into a single query.
Title | $nt | |
string | $text | |
array | $query | [optional] |
string | $trail | [optional] |
string | $prefix | [optional] |
Definition at line 233 of file LinkHolderArray.php.
References $query, list, and Linker\splitTrail().
LinkHolderArray::merge | ( | $other | ) |
Merge another LinkHolderArray into this one.
LinkHolderArray | $other |
Definition at line 103 of file LinkHolderArray.php.
References as, and captcha-old\count.
LinkHolderArray::mergeForeign | ( | $other, | |
$texts | |||
) |
Merge a LinkHolderArray from another parser instance into this one.
The keys will not be preserved. Any text which went with the old LinkHolderArray and needs to work with the new one should be passed in the $texts array. The strings in this array will have their link holders converted for use in the destination link holder. The resulting array of strings will be returned.
LinkHolderArray | $other | |
array | $texts | Array of strings |
Definition at line 127 of file LinkHolderArray.php.
References as.
|
protected |
array | $m |
Definition at line 161 of file LinkHolderArray.php.
References $tempIdOffset.
LinkHolderArray::replace | ( | & | $text | ) |
Replace link placeholders with actual links, in the buffer.
string | &$text |
Definition at line 271 of file LinkHolderArray.php.
References replaceInternal(), and replaceInterwiki().
|
protected |
Replace internal links.
string | &$text |
Definition at line 280 of file LinkHolderArray.php.
References $attribs, $colours, $dbr, $link, $linkRenderer, $matches, $output, $query, $res, $s, $title, array(), as, captcha-old\count, DB_REPLICA, doVariants(), LinkCache\getSelectFields(), Linker\makeSelfLinkObj(), Title\makeTitle(), NS_SPECIAL, Hooks\run(), use, and wfGetDB().
Referenced by replace().
|
protected |
Replace interwiki links.
string | &$text |
Definition at line 422 of file LinkHolderArray.php.
References $link, $linkRenderer, $matches, $output, array(), as, and use.
Referenced by replace().
LinkHolderArray::replaceText | ( | $text | ) |
Replace link placeholders with plain text of links (not HTML-formatted).
string | $text |
Definition at line 616 of file LinkHolderArray.php.
LinkHolderArray::replaceTextCallback | ( | $matches | ) |
Callback for replaceText()
array | $matches |
Definition at line 632 of file LinkHolderArray.php.
LinkHolderArray::$internals = [] |
Definition at line 30 of file LinkHolderArray.php.
LinkHolderArray::$interwikis = [] |
Definition at line 31 of file LinkHolderArray.php.
Parser LinkHolderArray::$parent |
Definition at line 37 of file LinkHolderArray.php.
Referenced by __construct().
LinkHolderArray::$size = 0 |
Definition at line 32 of file LinkHolderArray.php.
|
protected |
Definition at line 38 of file LinkHolderArray.php.
Referenced by mergeForeignCallback().