MediaWiki  REL1_19
LinkCache Class Reference

Cache for article titles (prefixed DB keys) and ids linked from one source. More...

List of all members.

Public Member Functions

 addBadLinkObj ($title)
 addGoodLinkObj ($id, $title, $len=-1, $redir=null, $revision=false)
 Add a link for the title to the link cache.
 addGoodLinkObjFromRow ($title, $row)
 Same as above with better interface.
 addLink ($title)
 Add a title to the link cache, return the page_id or zero if non-existent.
 addLinkObj ($nt)
 Add a title to the link cache, return the page_id or zero if non-existent.
 clear ()
 Clears cache.
 clearBadLink ($title)
 clearLink ($title)
 forUpdate ($update=null)
 General accessor to get/set whether SELECT FOR UPDATE should be used.
 getBadLinks ()
 getGoodLinkFieldObj ($title, $field)
 Get a field of a title object from cache.
 getGoodLinkID ($title)
 getGoodLinks ()
 isBadLink ($title)

Static Public Member Functions

static & singleton ()
 Get an instance of this class.

Private Attributes

 $mBadLinks = array()
 $mClassVer = 4
 $mForUpdate = false
 $mGoodLinkFields = array()
 $mGoodLinks = array()

Detailed Description

Cache for article titles (prefixed DB keys) and ids linked from one source.

Definition at line 7 of file LinkCache.php.


Member Function Documentation

Parameters:
$titleTitle

Definition at line 113 of file LinkCache.php.

References $title, and isBadLink().

Referenced by addLinkObj().

Here is the call graph for this function:

Here is the caller graph for this function:

LinkCache::addGoodLinkObj ( id,
title,
len = -1,
redir = null,
revision = false 
)

Add a link for the title to the link cache.

Parameters:
$idInteger: page's ID
$titleTitle object
$lenInteger: text's length
$redirInteger: whether the page is a redirect
$revisionInteger: latest revision's ID

Definition at line 84 of file LinkCache.php.

References $title.

LinkCache::addGoodLinkObjFromRow ( title,
row 
)

Same as above with better interface.

Since:
1.19
Parameters:
$titleTitle
$rowobject which has the fields page_id, page_is_redirect, page_latest

Definition at line 100 of file LinkCache.php.

References $title.

Referenced by addLinkObj().

Here is the caller graph for this function:

LinkCache::addLink ( title)

Add a title to the link cache, return the page_id or zero if non-existent.

Parameters:
$titleString: title to add
Returns:
Integer

Definition at line 143 of file LinkCache.php.

References $title, addLinkObj(), and Title\newFromDBkey().

Here is the call graph for this function:

Add a title to the link cache, return the page_id or zero if non-existent.

Parameters:
$ntTitle object to add
Returns:
Integer

Definition at line 158 of file LinkCache.php.

References $options, $wgAntiLockFlags, addBadLinkObj(), addGoodLinkObjFromRow(), getGoodLinkID(), isBadLink(), wfGetDB(), wfProfileIn(), and wfProfileOut().

Referenced by addLink().

Here is the call graph for this function:

Here is the caller graph for this function:

Clears cache.

Definition at line 211 of file LinkCache.php.

Definition at line 120 of file LinkCache.php.

References $title.

LinkCache::clearLink ( title)
Parameters:
$titleTitle

Definition at line 127 of file LinkCache.php.

References $title.

LinkCache::forUpdate ( update = null)

General accessor to get/set whether SELECT FOR UPDATE should be used.

Returns:
bool

Definition at line 35 of file LinkCache.php.

References wfSetVar().

Here is the call graph for this function:

Definition at line 135 of file LinkCache.php.

LinkCache::getGoodLinkFieldObj ( title,
field 
)

Get a field of a title object from cache.

If this link is not good, it will return NULL.

Parameters:
$titleTitle
$fieldString: ('length','redirect','revision')
Returns:
mixed

Definition at line 58 of file LinkCache.php.

References $title.

Parameters:
$title
Returns:
array|int

Definition at line 43 of file LinkCache.php.

References $title.

Referenced by addLinkObj().

Here is the caller graph for this function:

Definition at line 134 of file LinkCache.php.

LinkCache::isBadLink ( title)
Parameters:
$title
Returns:
bool

Definition at line 71 of file LinkCache.php.

References $title.

Referenced by addBadLinkObj(), and addLinkObj().

Here is the caller graph for this function:


Member Data Documentation

LinkCache::$mBadLinks = array() [private]

Definition at line 14 of file LinkCache.php.

LinkCache::$mClassVer = 4 [private]

Definition at line 10 of file LinkCache.php.

LinkCache::$mForUpdate = false [private]

Definition at line 15 of file LinkCache.php.

LinkCache::$mGoodLinkFields = array() [private]

Definition at line 13 of file LinkCache.php.

LinkCache::$mGoodLinks = array() [private]

Definition at line 12 of file LinkCache.php.


The documentation for this class was generated from the following file: