From ee80c43ca01d98fda0caf129e655d27e5a0676c6 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 16 May 2003 13:37:02 +0000 Subject: [PATCH] Prefill link cache with brokenlinks too --- includes/LinkCache.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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(); } -- 2.20.1