/**
* Get an instance of this class
*/
- function &singleton() {
+ static function &singleton() {
static $instance;
if ( !isset( $instance ) ) {
$instance = new LinkCache;
}
/* private */ function getKey( $title ) {
- global $wgDBname;
- return $wgDBname.':lc:title:'.$title;
+ return wfMemcKey( 'lc', 'title', $title );
}
/**
function getPageLinks() { return $this->mPageLinks; }
function getGoodLinks() { return $this->mGoodLinks; }
function getBadLinks() { return array_keys( $this->mBadLinks ); }
-
+
/**
* Add a title to the link cache, return the page_id or zero if non-existent
- * @param string $title Title to add
+ * @param $title String: title to add
* @return integer
*/
function addLink( $title ) {
return 0;
}
}
-
+
/**
* Add a title to the link cache, return the page_id or zero if non-existent
- * @param Title $nt Title to add
+ * @param $nt Title to add.
* @return integer
*/
function addLinkObj( &$nt ) {