$wgUseBetterLinksUpdate no longer needed, removed, doDumbUpdate removed
[lhc/web/wiklou.git] / includes / LinksUpdate.php
index 8106e58..1c76afc 100644 (file)
@@ -21,11 +21,6 @@ class LinksUpdate {
                /* Update link tables with outgoing links from an updated article */
                /* Relies on the 'link cache' to be filled out */
 
-               if ( !$wgUseBetterLinksUpdate ) {
-                       $this->doDumbUpdate();
-                       return;
-               }
-
                $fname = "LinksUpdate::doUpdate";
                wfProfileIn( $fname );
 
@@ -147,81 +142,6 @@ class LinksUpdate {
                wfProfileOut( $fname );
        }
 
-       function doDumbUpdate()
-       {
-               # Old update function. This can probably be removed eventually, if the new one
-               # proves to be stable
-               global $wgLinkCache, $wgDBtransactions;
-               $fname = "LinksUpdate::doDumbUpdate";
-               wfProfileIn( $fname );
-
-               if( $wgDBtransactions ) {
-                       $sql = "BEGIN";
-                       wfQuery( $sql, DB_WRITE, $fname );
-               }
-               
-               $sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}'";
-               wfQuery( $sql, DB_WRITE, $fname );
-
-               $a = $wgLinkCache->getGoodLinks();
-               $sql = "";
-               if ( 0 != count( $a ) ) {
-                       $sql = "INSERT INTO links (l_from,l_to) VALUES ";
-                       $first = true;
-                       foreach( $a as $lt => $lid ) {
-                               if ( ! $first ) { $sql .= ","; }
-                               $first = false;
-
-                               $sql .= "('{$this->mTitleEnc}',{$lid})";
-                       }
-               }
-               if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); }
-
-               $sql = "DELETE FROM brokenlinks WHERE bl_from={$this->mId}";
-               wfQuery( $sql, DB_WRITE, $fname );
-
-               $a = $wgLinkCache->getBadLinks();
-               $sql = "";
-               if ( 0 != count ( $a ) ) {
-                       $sql = "INSERT INTO brokenlinks (bl_from,bl_to) VALUES ";
-                       $first = true;
-                       foreach( $a as $blt ) {
-                               $blt = wfStrencode( $blt );
-                               if ( ! $first ) { $sql .= ","; }
-                               $first = false;
-
-                               $sql .= "({$this->mId},'{$blt}')";
-                       }
-               }
-               if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); }
-               
-               $sql = "DELETE FROM imagelinks WHERE il_from='{$this->mTitleEnc}'";
-               wfQuery( $sql, DB_WRITE, $fname );
-
-               $a = $wgLinkCache->getImageLinks();
-               $sql = "";
-               if ( 0 != count ( $a ) ) {
-                       $sql = "INSERT INTO imagelinks (il_from,il_to) VALUES ";
-                       $first = true;
-                       foreach( $a as $iname => $val ) {
-                               $iname = wfStrencode( $iname );
-                               if ( ! $first ) { $sql .= ","; }
-                               $first = false;
-
-                               $sql .= "('{$this->mTitleEnc}','{$iname}')";
-                       }
-               }
-               if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); }
-
-               $this->fixBrokenLinks();
-
-               if( $wgDBtransactions ) {
-                       $sql = "COMMIT";
-                       wfQuery( $sql, DB_WRITE, $fname );
-               }
-               wfProfileOut( $fname );
-       }
-       
        function fixBrokenLinks() {
                /* Update any brokenlinks *to* this page */
                /* Call for a newly created page, or just to make sure state is consistent */