unset( $this->mBadLinks[$title] );
}
- /* obsolete, for old $wgLinkCacheMemcached stuff */
- public function clearLink( $title ) {}
+ public function clearLink( $title ) {
+ $dbkey = $title->getPrefixedDbKey();
+ if( isset($this->mBadLinks[$dbkey]) ) {
+ unset($this->mBadLinks[$dbkey]);
+ }
+ if( isset($this->mGoodLinks[$dbkey]) ) {
+ unset($this->mGoodLinks[$dbkey]);
+ }
+ if( isset($this->mGoodLinkFields[$dbkey]) ) {
+ unset($this->mGoodLinkFields[$dbkey]);
+ }
+ }
public function getGoodLinks() { return $this->mGoodLinks; }
public function getBadLinks() { return array_keys( $this->mBadLinks ); }
*/
public function getArticleID( $flags = 0 ) {
$linkCache = LinkCache::singleton();
- if ( $flags & GAID_FOR_UPDATE ) {
+ if( $flags & GAID_FOR_UPDATE ) {
$oldUpdate = $linkCache->forUpdate( true );
+ $linkCache->clearLink( $this );
$this->mArticleID = $linkCache->addLinkObj( $this );
$linkCache->forUpdate( $oldUpdate );
} else {
- if ( -1 == $this->mArticleID ) {
+ if( -1 == $this->mArticleID ) {
$this->mArticleID = $linkCache->addLinkObj( $this );
}
}