From: Brion Vibber Date: Fri, 16 May 2003 13:37:02 +0000 (+0000) Subject: Prefill link cache with brokenlinks too X-Git-Tag: 1.1.0~556 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=ee80c43ca01d98fda0caf129e655d27e5a0676c6;p=lhc%2Fweb%2Fwiklou.git Prefill link cache with brokenlinks too --- diff --git a/includes/LinkCache.php b/includes/LinkCache.php index af8505236a..8664ef8f80 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -67,6 +67,8 @@ class LinkCache { $id = $this->getGoodLinkID( $title ); if ( 0 != $id ) { return $id; } + wfProfileIn( "LinkCache::addLink-checkdatabase" ); + $nt = Title::newFromDBkey( $title ); $ns = $nt->getNamespace(); $t = $nt->getDBkey(); @@ -84,6 +86,7 @@ class LinkCache { } if ( 0 == $id ) { $this->addBadLink( $title ); } else { $this->addGoodLink( $id, $title ); } + wfProfileOut(); return $id; } @@ -101,6 +104,15 @@ class LinkCache { Title::makeName( $s->cur_namespace, $s->cur_title ) ); } + + $sql = "SELECT HIGH_PRIORITY bl_to + FROM brokenlinks + WHERE bl_from='{$dbkeyfrom}'"; + $res = wfQuery( $sql, "LinkCache::preFill" ); + while( $s = wfFetchObject( $res ) ) { + $this->addBadLink( $s->bl_to ); + } + wfProfileOut(); }