Minor followup to r111795, make doSha1LegacyUpdates return it's count value so it...
authorSam Reed <reedy@users.mediawiki.org>
Tue, 6 Mar 2012 19:21:07 +0000 (19:21 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 6 Mar 2012 19:21:07 +0000 (19:21 +0000)
Don't return true in doSha1Updates(), return 0 if table is empty

maintenance/populateRevisionSha1.php

index e829848..6125fc0 100644 (file)
@@ -67,7 +67,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
                $end = $db->selectField( $table, "MAX($idCol)", false, __METHOD__ );
                if ( !$start || !$end ) {
                        $this->output( "...$table table seems to be empty.\n" );
-                       return true;
+                       return 0;
                }
 
                $count = 0;
@@ -95,7 +95,10 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
                }
                return $count;
        }
-       
+
+       /**
+        * @return int
+        */
        protected function doSha1LegacyUpdates() {
                $count = 0;
                $db = $this->getDB( DB_MASTER );
@@ -116,8 +119,16 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
                        }
                }
                $db->commit( __METHOD__ );
+               return $count;
        }
 
+       /**
+        * @param $row
+        * @param $table
+        * @param $idCol
+        * @param $prefix
+        * @return bool
+        */
        protected function upgradeRow( $row, $table, $idCol, $prefix ) {
                $db = $this->getDB( DB_MASTER );
                if ( $table === 'archive' ) {
@@ -140,6 +151,10 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
                }
        }
 
+       /**
+        * @param $row
+        * @return bool
+        */
        protected function upgradeLegacyArchiveRow( $row ) {
                $db = $this->getDB( DB_MASTER );
                $rev = Revision::newFromArchiveRow( $row );