MediaWiki
master
|
Public Member Functions | |
__construct (Parser $parent, ILanguageConverter $languageConverter, HookContainer $hookContainer) | |
__destruct () | |
Reduce memory usage to reduce the impact of circular references. More... | |
clear () | |
Clear all stored link holders. More... | |
isBig () | |
Returns true if the memory requirements of this object are getting large. More... | |
makeHolder (Title $nt, $text='', $trail='', $prefix='') | |
Make a link placeholder. More... | |
merge ( $other) | |
Merge another LinkHolderArray into this one. More... | |
replace (&$text) | |
Replace link placeholders with actual links, in the buffer. More... | |
replaceText ( $text) | |
Replace and link placeholders with plain text of links (not HTML-formatted). More... | |
Protected Member Functions | |
doVariants (&$classes) | |
Modify $this->internals and $classes according to language variant linking rules. More... | |
replaceInternal (&$text) | |
Replace internal links. More... | |
replaceInterwiki (&$text) | |
Replace interwiki links. More... | |
Definition at line 36 of file LinkHolderArray.php.
LinkHolderArray::__construct | ( | Parser | $parent, |
ILanguageConverter | $languageConverter, | ||
HookContainer | $hookContainer | ||
) |
Parser | $parent | |
ILanguageConverter | $languageConverter | |
HookContainer | $hookContainer |
Definition at line 55 of file LinkHolderArray.php.
LinkHolderArray::__destruct | ( | ) |
Reduce memory usage to reduce the impact of circular references.
Definition at line 66 of file LinkHolderArray.php.
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 103 of file LinkHolderArray.php.
|
protected |
Modify $this->internals and $classes according to language variant linking rules.
string[] | &$classes |
Definition at line 310 of file LinkHolderArray.php.
References DB_REPLICA, MediaWiki\Title\Title\getNamespace(), LinkCache\getSelectFields(), NS_CATEGORY, NS_SPECIAL, and wfGetDB().
Referenced by replaceInternal().
LinkHolderArray::isBig | ( | ) |
Returns true if the memory requirements of this object are getting large.
Definition at line 93 of file LinkHolderArray.php.
LinkHolderArray::makeHolder | ( | Title | $nt, |
$text = '' , |
|||
$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 | |
string | $trail | [optional] |
string | $prefix | [optional] |
Definition at line 121 of file LinkHolderArray.php.
References MediaWiki\Title\Title\getNamespace(), MediaWiki\Title\Title\getPrefixedDBkey(), and MediaWiki\Title\Title\isExternal().
LinkHolderArray::merge | ( | $other | ) |
Merge another LinkHolderArray into this one.
LinkHolderArray | $other |
Definition at line 77 of file LinkHolderArray.php.
LinkHolderArray::replace | ( | & | $text | ) |
Replace link placeholders with actual links, in the buffer.
string | &$text |
Definition at line 149 of file LinkHolderArray.php.
References replaceInternal(), and replaceInterwiki().
|
protected |
Replace internal links.
string | &$text |
Definition at line 158 of file LinkHolderArray.php.
References $matches, DB_REPLICA, doVariants(), LinkCache\getSelectFields(), NS_SPECIAL, and wfGetDB().
Referenced by replace().
|
protected |
Replace interwiki links.
string | &$text |
Definition at line 283 of file LinkHolderArray.php.
References $matches.
Referenced by replace().
LinkHolderArray::replaceText | ( | $text | ) |
Replace and link placeholders with plain text of links (not HTML-formatted).
string | $text |
Definition at line 466 of file LinkHolderArray.php.
References $matches.