Remove apparently pointless $dbw parameter to Article::updateCategoryCounts.
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 19 Mar 2008 13:36:33 +0000 (13:36 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 19 Mar 2008 13:36:33 +0000 (13:36 +0000)
includes/Article.php
includes/LinksUpdate.php

index 2515708..10ff075 100644 (file)
@@ -2266,7 +2266,7 @@ class Article {
                foreach( $res as $row ) {
                        $cats []= $row->cl_to;
                }
-               $this->updateCategoryCounts( array(), $cats, $dbw );
+               $this->updateCategoryCounts( array(), $cats );
 
                # Now that it's safely backed up, delete it
                $dbw->delete( 'page', array( 'page_id' => $id ), __METHOD__);
@@ -3354,14 +3354,11 @@ class Article {
         *
         * @param $added array   The names of categories that were added
         * @param $deleted array The names of categories that were deleted
-        * @param $dbw Database  Optional database connection to use
         * @return null
         */
-       public function updateCategoryCounts( $added, $deleted, $dbw = null ) {
+       public function updateCategoryCounts( $added, $deleted ) {
                $ns = $this->mTitle->getNamespace();
-               if( !$dbw ) {
-                       $dbw = wfGetDB( DB_MASTER );
-               }
+               $dbw = wfGetDB( DB_MASTER );
 
                # First make sure the rows exist.  If one of the "deleted" ones didn't
                # exist, we might legitimately not create it, but it's simpler to just
index efda9c4..a4774ff 100644 (file)
@@ -276,7 +276,7 @@ class LinksUpdate {
        function updateCategoryCounts( $added, $deleted ) {
                $a = new Article($this->mTitle);
                $a->updateCategoryCounts(
-                       array_keys( $added ), array_keys( $deleted ), $this->mDb
+                       array_keys( $added ), array_keys( $deleted )
                );
        }