MediaWiki
REL1_19
|
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) | |
replaceText ($text) | |
Replace link placeholders with plain text of links (not HTML-formatted). | |
replaceTextCallback ($matches) | |
Callback for replaceText() | |
Public Attributes | |
$internals = array() | |
$interwikis = array() | |
$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 11 of file LinkHolderArray.php.
LinkHolderArray::__construct | ( | $ | parent | ) |
Definition at line 17 of file LinkHolderArray.php.
References $parent.
Reduce memory usage to reduce the impact of circular references.
Definition at line 24 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 37 of file LinkHolderArray.php.
Recreate the Title objects.
Definition at line 57 of file LinkHolderArray.php.
References Title\newFromText().
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 180 of file LinkHolderArray.php.
LinkHolderArray::doVariants | ( | &$ | colours | ) | [protected] |
Modify $this->internals and $colours according to language variant linking rules.
Definition at line 419 of file LinkHolderArray.php.
References $dbr, $output, $title, $wgContLang, Linker\getLinkColour(), Title\makeName(), Title\makeTitle(), Title\newFromDBkey(), LinkCache\singleton(), wfGetDB(), and wfRunHooks().
Referenced by replaceInternal().
LinkHolderArray::getSubArray | ( | $ | text | ) |
Get a subset of the current LinkHolderArray which is sufficient to interpret the given text.
Definition at line 138 of file LinkHolderArray.php.
Returns true if the memory requirements of this object are getting large.
Definition at line 171 of file LinkHolderArray.php.
References $wgLinkHolderBatchSize.
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.
$nt | Title |
Definition at line 194 of file LinkHolderArray.php.
References Linker\splitTrail(), wfProfileIn(), and wfProfileOut().
LinkHolderArray::merge | ( | $ | other | ) |
Merge another LinkHolderArray into this one.
$other | LinkHolderArray |
Definition at line 76 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.
$other | LinkHolderArray |
$texts | Array of strings |
Definition at line 100 of file LinkHolderArray.php.
LinkHolderArray::mergeForeignCallback | ( | $ | m | ) | [protected] |
Definition at line 130 of file LinkHolderArray.php.
LinkHolderArray::replace | ( | &$ | text | ) |
makeLinkObj() is deprecated. Replace link placeholders with actual links, in the buffer Placeholders created in Skin::makeLinkObj() Returns an array of link CSS classes, indexed by PDBK.
Definition at line 235 of file LinkHolderArray.php.
References replaceInternal(), replaceInterwiki(), wfProfileIn(), and wfProfileOut().
LinkHolderArray::replaceInternal | ( | &$ | text | ) | [protected] |
Replace internal links.
Definition at line 248 of file LinkHolderArray.php.
References $dbr, $output, $res, $title, $wgContLang, doVariants(), Linker\getLinkColour(), Linker\link(), Title\makeTitle(), LinkCache\singleton(), wfGetDB(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by replace().
LinkHolderArray::replaceInterwiki | ( | &$ | text | ) | [protected] |
Replace interwiki links.
Definition at line 394 of file LinkHolderArray.php.
References $output, Linker\link(), wfProfileIn(), and wfProfileOut().
Referenced by replace().
LinkHolderArray::replaceText | ( | $ | text | ) |
Replace link placeholders with plain text of links (not HTML-formatted).
$text | String |
Definition at line 565 of file LinkHolderArray.php.
References wfProfileIn(), and wfProfileOut().
LinkHolderArray::replaceTextCallback | ( | $ | matches | ) |
Callback for replaceText()
$matches | Array |
Definition at line 584 of file LinkHolderArray.php.
References $matches.
LinkHolderArray::$internals = array() |
Definition at line 12 of file LinkHolderArray.php.
LinkHolderArray::$interwikis = array() |
Definition at line 12 of file LinkHolderArray.php.
LinkHolderArray::$parent |
Definition at line 14 of file LinkHolderArray.php.
Referenced by __construct().
LinkHolderArray::$size = 0 |
Definition at line 13 of file LinkHolderArray.php.
LinkHolderArray::$tempIdOffset [protected] |
Definition at line 15 of file LinkHolderArray.php.