Remove redundant item loading code in User::createNew
[lhc/web/wiklou.git] / maintenance / rebuildFileCache.php
index 19d8d06..ae6a75e 100644 (file)
@@ -60,18 +60,18 @@ class RebuildFileCache extends Maintenance {
                global $wgRequestTime;
 
                if ( !$this->enabled ) {
-                       $this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true );
+                       $this->fatalError( "Nothing to do -- \$wgUseFileCache is disabled." );
                }
 
                $start = $this->getOption( 'start', "0" );
                if ( !ctype_digit( $start ) ) {
-                       $this->error( "Invalid value for start parameter.", true );
+                       $this->fatalError( "Invalid value for start parameter." );
                }
                $start = intval( $start );
 
                $end = $this->getOption( 'end', "0" );
                if ( !ctype_digit( $end ) ) {
-                       $this->error( "Invalid value for end parameter.", true );
+                       $this->fatalError( "Invalid value for end parameter." );
                }
                $end = intval( $end );
 
@@ -87,7 +87,7 @@ class RebuildFileCache extends Maintenance {
                        ? $end
                        : $dbr->selectField( 'page', 'MAX(page_id)', false, __METHOD__ );
                if ( !$start ) {
-                       $this->error( "Nothing to do.", true );
+                       $this->fatalError( "Nothing to do." );
                }
 
                $_SERVER['HTTP_ACCEPT_ENCODING'] = 'bgzip'; // hack, no real client
@@ -104,7 +104,7 @@ class RebuildFileCache extends Maintenance {
                        $res = $dbr->select( 'page',
                                [ 'page_namespace', 'page_title', 'page_id' ],
                                [ 'page_namespace' => MWNamespace::getContentNamespaces(),
-                                       "page_id BETWEEN $blockStart AND $blockEnd" ],
+                                       "page_id BETWEEN " . (int)$blockStart . " AND " . (int)$blockEnd ],
                                __METHOD__,
                                [ 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' ]
                        );
@@ -140,7 +140,7 @@ class RebuildFileCache extends Maintenance {
                                                }
                                        }
 
-                                       MediaWiki\suppressWarnings(); // header notices
+                                       Wikimedia\suppressWarnings(); // header notices
                                        // Cache ?action=view
                                        $wgRequestTime = microtime( true ); # T24852
                                        ob_start();
@@ -157,7 +157,7 @@ class RebuildFileCache extends Maintenance {
                                        $context->getOutput()->clearHTML();
                                        $historyHtml = ob_get_clean();
                                        $historyCache->saveToFileCache( $historyHtml );
-                                       MediaWiki\restoreWarnings();
+                                       Wikimedia\restoreWarnings();
 
                                        if ( $rebuilt ) {
                                                $this->output( "Re-cached page '$title' (id {$row->page_id})..." );
@@ -179,5 +179,5 @@ class RebuildFileCache extends Maintenance {
        }
 }
 
-$maintClass = "RebuildFileCache";
+$maintClass = RebuildFileCache::class;
 require_once RUN_MAINTENANCE_IF_MAIN;