LinkCache Class Reference
[Cache]

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

List of all members.

Public Member Functions

 __construct ()
 forUpdate ($update=NULL)
 General accessor to get/set whether SELECT FOR UPDATE should be used.
 getGoodLinkID ($title)
 getGoodLinkFieldObj ($title, $field)
 Get a field of a title object from cache.
 isBadLink ($title)
 addGoodLinkObj ($id, $title, $len=-1, $redir=NULL)
 Add a link for the title to the link cache.
 addBadLinkObj ($title)
 clearBadLink ($title)
 clearLink ($title)
 getGoodLinks ()
 getBadLinks ()
 addLink ($title, $len=-1, $redir=NULL)
 Add a title to the link cache, return the page_id or zero if non-existent.
 addLinkObj (&$nt, $len=-1, $redirect=NULL)
 Add a title to the link cache, return the page_id or zero if non-existent.
 clear ()
 Clears cache.

Static Public Member Functions

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

Public Attributes

 $mClassVer = 4
 $mGoodLinks
 $mBadLinks
 $mForUpdate


Detailed Description

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

Definition at line 7 of file LinkCache.php.


Constructor & Destructor Documentation

LinkCache::__construct (  ) 

Definition at line 26 of file LinkCache.php.


Member Function Documentation

LinkCache::addBadLinkObj ( title  ) 

Definition at line 81 of file LinkCache.php.

References $title, and isBadLink().

Referenced by addLinkObj().

LinkCache::addGoodLinkObj ( id,
title,
len = -1,
redir = NULL 
)

Add a link for the title to the link cache.

Parameters:
int $id
Title $title
int $len
int $redir

Definition at line 75 of file LinkCache.php.

References $title.

Referenced by addLinkObj().

LinkCache::addLink ( title,
len = -1,
redir = NULL 
)

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

Parameters:
$title String: title to add
$len int, page size
$redir bool, is redirect?
Returns:
integer

Definition at line 115 of file LinkCache.php.

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

LinkCache::addLinkObj ( &$  nt,
len = -1,
redirect = NULL 
)

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

Parameters:
$nt Title to add.
$len int, page size
$redir bool, is redirect?
Returns:
integer

Definition at line 131 of file LinkCache.php.

References $db, $key, $options, $s, $wgAntiLockFlags, addBadLinkObj(), addGoodLinkObj(), getGoodLinkID(), isBadLink(), wfGetDB(), wfProfileIn(), and wfProfileOut().

Referenced by addLink().

LinkCache::clear (  ) 

Clears cache.

Definition at line 190 of file LinkCache.php.

LinkCache::clearBadLink ( title  ) 

Definition at line 88 of file LinkCache.php.

References $title.

LinkCache::clearLink ( title  ) 

Definition at line 92 of file LinkCache.php.

References $title.

LinkCache::forUpdate ( update = NULL  ) 

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

Definition at line 36 of file LinkCache.php.

References wfSetVar().

LinkCache::getBadLinks (  ) 

Definition at line 106 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:
Title $title
string $field ('length','redirect')
Returns:
mixed

Definition at line 55 of file LinkCache.php.

References $title.

LinkCache::getGoodLinkID ( title  ) 

Definition at line 40 of file LinkCache.php.

References $title.

Referenced by addLinkObj().

LinkCache::getGoodLinks (  ) 

Definition at line 105 of file LinkCache.php.

LinkCache::isBadLink ( title  ) 

Definition at line 64 of file LinkCache.php.

References $title.

Referenced by addBadLinkObj(), and addLinkObj().

static& LinkCache::singleton (  )  [static]


Member Data Documentation

LinkCache::$mBadLinks

Definition at line 12 of file LinkCache.php.

LinkCache::$mClassVer = 4

Definition at line 10 of file LinkCache.php.

LinkCache::$mForUpdate

Definition at line 13 of file LinkCache.php.

LinkCache::$mGoodLinks

Definition at line 12 of file LinkCache.php.


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

Generated on Sat Sep 5 02:08:40 2009 for MediaWiki by  doxygen 1.5.9