Merge "Adding interfaces for ORM row and table classes so these can be used for type...
[lhc/web/wiklou.git] / maintenance / updateSpecialPages.php
index df3cdf5..a1a2e2f 100644 (file)
@@ -58,14 +58,15 @@ class UpdateSpecialPages extends Maintenance {
                        }
                        $this->output( sprintf( "completed in %.2fs\n", $seconds ) );
                        # Wait for the slave to catch up
-                       wfWaitForSlaves( 5 );
+                       wfWaitForSlaves();
                }
 
                // This is needed to initialise $wgQueryPages
                require_once( "$IP/includes/QueryPage.php" );
 
                foreach ( $wgQueryPages as $page ) {
-                       @list( $class, $special, $limit ) = $page;
+                       list( $class, $special ) = $page;
+                       $limit = isset( $page[2] ) ? $page[2] : null;
 
                        # --list : just show the name of pages
                        if ( $this->hasOption( 'list' ) ) {
@@ -78,7 +79,7 @@ class UpdateSpecialPages extends Maintenance {
                                continue;
                        }
 
-                       $specialObj = SpecialPage::getPage( $special );
+                       $specialObj = SpecialPageFactory::getPage( $special );
                        if ( !$specialObj ) {
                                $this->output( "No such special page: $special\n" );
                                exit;
@@ -127,10 +128,10 @@ class UpdateSpecialPages extends Maintenance {
                                                $this->output( "Reconnected\n\n" );
                                        } else {
                                                # Commit the results
-                                               $dbw->commit();
+                                               $dbw->commit( __METHOD__ );
                                        }
                                        # Wait for the slave to catch up
-                                       wfWaitForSlaves( 5 );
+                                       wfWaitForSlaves();
                                } else {
                                        $this->output( "cheap, skipped\n" );
                                }