MediaWiki
REL1_24
|
Public Member Functions | |
__construct ($parent) | |
__destruct () | |
Reduce memory usage to reduce the impact of circular references. | |
__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. | |
__wakeup () | |
Recreate the Title objects. | |
clear () | |
Clear all stored link holders. | |
getSubArray ($text) | |
Get a subset of the current LinkHolderArray which is sufficient to interpret the given text. | |
isBig () | |
Returns true if the memory requirements of this object are getting large. | |
makeHolder ($nt, $text= '', $query=array(), $trail= '', $prefix= '') | |
Make a link placeholder. | |
merge ($other) | |
Merge another LinkHolderArray into this one. | |
mergeForeign ($other, $texts) | |
Merge a LinkHolderArray from another parser instance into this one. | |
replace (&$text) | |
Replace link placeholders with actual links, in the buffer. | |
replaceText ($text) | |
Replace link placeholders with plain text of links (not HTML-formatted). | |
replaceTextCallback ($matches) | |
Callback for replaceText() | |
Public Attributes | |
$internals = array() | |
$interwikis = array() | |
Parser | $parent |
$size = 0 | |
Protected Member Functions | |
doVariants (&$colours) | |
Modify $this->internals and $colours according to language variant linking rules. | |
mergeForeignCallback ($m) | |
replaceInternal (&$text) | |
Replace internal links. | |
replaceInterwiki (&$text) | |
Replace interwiki links. | |
Protected Attributes | |
$tempIdOffset |
Definition at line 27 of file LinkHolderArray.php.
LinkHolderArray::__construct | ( | $ | parent | ) |
Parser | $parent |
Definition at line 40 of file LinkHolderArray.php.
Reduce memory usage to reduce the impact of circular references.
Definition at line 47 of file LinkHolderArray.php.
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 61 of file LinkHolderArray.php.
Recreate the Title objects.
Definition at line 81 of file LinkHolderArray.php.
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 211 of file LinkHolderArray.php.
LinkHolderArray::doVariants | ( | &$ | colours | ) | [protected] |
Modify $this->internals and $colours according to language variant linking rules.
array | $colours |
Definition at line 472 of file LinkHolderArray.php.
LinkHolderArray::getSubArray | ( | $ | text | ) |
Get a subset of the current LinkHolderArray which is sufficient to interpret the given text.
string | $text |
Definition at line 168 of file LinkHolderArray.php.
Returns true if the memory requirements of this object are getting large.
Definition at line 202 of file LinkHolderArray.php.
LinkHolderArray::makeHolder | ( | $ | nt, |
$ | text = '' , |
||
$ | query = array() , |
||
$ | 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 230 of file LinkHolderArray.php.
LinkHolderArray::merge | ( | $ | other | ) |
Merge another LinkHolderArray into this one.
LinkHolderArray | $other |
Definition at line 100 of file LinkHolderArray.php.
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 124 of file LinkHolderArray.php.
LinkHolderArray::mergeForeignCallback | ( | $ | m | ) | [protected] |
LinkHolderArray::replace | ( | &$ | text | ) |
Replace link placeholders with actual links, in the buffer.
string | $text |
Definition at line 271 of file LinkHolderArray.php.
LinkHolderArray::replaceInternal | ( | &$ | text | ) | [protected] |
LinkHolderArray::replaceInterwiki | ( | &$ | text | ) | [protected] |
Replace interwiki links.
string | $text |
Definition at line 446 of file LinkHolderArray.php.
LinkHolderArray::replaceText | ( | $ | text | ) |
Replace link placeholders with plain text of links (not HTML-formatted).
string | $text |
Definition at line 645 of file LinkHolderArray.php.
LinkHolderArray::replaceTextCallback | ( | $ | matches | ) |
Callback for replaceText()
array | $matches |
Definition at line 664 of file LinkHolderArray.php.
LinkHolderArray::$internals = array() |
Definition at line 28 of file LinkHolderArray.php.
LinkHolderArray::$interwikis = array() |
Definition at line 29 of file LinkHolderArray.php.
Parser LinkHolderArray::$parent |
Definition at line 34 of file LinkHolderArray.php.
LinkHolderArray::$size = 0 |
Definition at line 30 of file LinkHolderArray.php.
LinkHolderArray::$tempIdOffset [protected] |
Definition at line 35 of file LinkHolderArray.php.