|
MediaWiki
REL1_23
|
Cache for article titles (prefixed DB keys) and ids linked from one source. More...
Public Member Functions | |
| addBadLinkObj ($title) | |
| addGoodLinkObj ($id, $title, $len=-1, $redir=null, $revision=0, $model=0) | |
| 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 | destroySingleton () |
| Destroy the singleton instance, a new one will be created next time singleton() is called. | |
| static | setSingleton (LinkCache $instance) |
| Set the singleton instance to a given object. | |
| static & | singleton () |
| Get an instance of this class. | |
Static Protected Attributes | |
| static | $instance |
Private Attributes | |
| $mBadLinks = array() | |
| $mClassVer = 4 | |
| $mForUpdate = false | |
| $mGoodLinkFields = array() | |
| $mGoodLinks = array() | |
Cache for article titles (prefixed DB keys) and ids linked from one source.
Definition at line 29 of file LinkCache.php.
| LinkCache::addBadLinkObj | ( | $ | title | ) |
| $title | Title |
Definition at line 168 of file LinkCache.php.
References $title, and isBadLink().
Referenced by addLinkObj().
| LinkCache::addGoodLinkObj | ( | $ | id, |
| $ | title, | ||
| $ | len = -1, |
||
| $ | redir = null, |
||
| $ | revision = 0, |
||
| $ | model = 0 |
||
| ) |
| LinkCache::addGoodLinkObjFromRow | ( | $ | title, |
| $ | row | ||
| ) |
Same as above with better interface.
| $title | Title |
| $row | object which has the fields page_id, page_is_redirect, page_latest and page_content_model |
Definition at line 154 of file LinkCache.php.
References $title, array(), and empty.
Referenced by addLinkObj().
| LinkCache::addLink | ( | $ | title | ) |
Add a title to the link cache, return the page_id or zero if non-existent.
| string | $title | title to add |
Definition at line 203 of file LinkCache.php.
References $title, addLinkObj(), and Title\newFromDBkey().
| LinkCache::addLinkObj | ( | $ | nt | ) |
Add a title to the link cache, return the page_id or zero if non-existent.
| $nt | Title object to add |
Definition at line 218 of file LinkCache.php.
References $f, $key, $options, $s, addBadLinkObj(), addGoodLinkObjFromRow(), array(), getGoodLinkID(), global, isBadLink(), wfGetDB(), wfProfileIn(), and wfProfileOut().
Referenced by addLink().
| LinkCache::clear | ( | ) |
| LinkCache::clearBadLink | ( | $ | title | ) |
Definition at line 175 of file LinkCache.php.
References $title.
| LinkCache::clearLink | ( | $ | title | ) |
| static LinkCache::destroySingleton | ( | ) | [static] |
Destroy the singleton instance, a new one will be created next time singleton() is called.
Definition at line 63 of file LinkCache.php.
| LinkCache::forUpdate | ( | $ | update = null | ) |
General accessor to get/set whether SELECT FOR UPDATE should be used.
| $update |
Definition at line 84 of file LinkCache.php.
References wfSetVar().
Definition at line 193 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.
| $title | Title | |
| string | $field | ('length','redirect','revision','model') |
Definition at line 107 of file LinkCache.php.
References $title.
| LinkCache::getGoodLinkID | ( | $ | title | ) |
| $title |
Definition at line 92 of file LinkCache.php.
References $title.
Referenced by addLinkObj().
Definition at line 189 of file LinkCache.php.
| LinkCache::isBadLink | ( | $ | title | ) |
| $title |
Definition at line 120 of file LinkCache.php.
References $title.
Referenced by addBadLinkObj(), and addLinkObj().
| static LinkCache::setSingleton | ( | LinkCache $ | instance | ) | [static] |
| static& LinkCache::singleton | ( | ) | [static] |
Get an instance of this class.
Definition at line 49 of file LinkCache.php.
References $instance.
Referenced by NewParserTest\addDBData(), LinkHolderArray\doVariants(), LinkBatch\execute(), RefreshLinks\fixLinksFromArticle(), Title\getArticleID(), Title\getContentModel(), Title\getLatestRevID(), Title\getLength(), Title\getLinksFrom(), Title\getLinksTo(), Title\isRedirect(), TitleCleanup\moveInconsistentPage(), CoreParserFunctions\pageid(), LinkHolderArray\replaceInternal(), Title\resetArticleID(), RefreshLinksJob2\run(), RefreshLinksJob\runForTitle(), WikiPageTest\setUp(), Parser\statelessFetchTemplate(), and NewParserTest\tearDown().
LinkCache::$instance [static, protected] |
Definition at line 42 of file LinkCache.php.
Referenced by setSingleton(), and singleton().
LinkCache::$mBadLinks = array() [private] |
Definition at line 36 of file LinkCache.php.
LinkCache::$mClassVer = 4 [private] |
Definition at line 32 of file LinkCache.php.
LinkCache::$mForUpdate = false [private] |
Definition at line 37 of file LinkCache.php.
LinkCache::$mGoodLinkFields = array() [private] |
Definition at line 35 of file LinkCache.php.
LinkCache::$mGoodLinks = array() [private] |
Definition at line 34 of file LinkCache.php.