Merge "resourceloader: Remove wgAvailableSkins from mw.config"
[lhc/web/wiklou.git] / maintenance / benchmarks / benchmarkPurge.php
index e67d226..e681a04 100644 (file)
@@ -37,13 +37,13 @@ class BenchmarkPurge extends Benchmarker {
        public function execute() {
                global $wgUseSquid, $wgSquidServers;
                if ( !$wgUseSquid ) {
-                       $this->error( "Squid purge benchmark doesn't do much without squid support on.", true );
+                       $this->fatalError( "Squid purge benchmark doesn't do much without squid support on." );
                } else {
                        $this->output( "There are " . count( $wgSquidServers ) . " defined squid servers:\n" );
                        if ( $this->hasOption( 'count' ) ) {
-                               $lengths = array( intval( $this->getOption( 'count' ) ) );
+                               $lengths = [ intval( $this->getOption( 'count' ) ) ];
                        } else {
-                               $lengths = array( 1, 10, 100 );
+                               $lengths = [ 1, 10, 100 ];
                        }
                        foreach ( $lengths as $length ) {
                                $urls = $this->randomUrlList( $length );
@@ -54,7 +54,7 @@ class BenchmarkPurge extends Benchmarker {
        }
 
        /**
-        * Run a bunch of URLs through SquidUpdate::purge()
+        * Run a bunch of URLs through CdnCacheUpdate::purge()
         * to benchmark Squid response times.
         * @param array $urls A bunch of URLs to purge
         * @param int $trials How many times to run the test?
@@ -79,7 +79,7 @@ class BenchmarkPurge extends Benchmarker {
         * @return array
         */
        private function randomUrlList( $length ) {
-               $list = array();
+               $list = [];
                for ( $i = 0; $i < $length; $i++ ) {
                        $list[] = $this->randomUrl();
                }
@@ -114,5 +114,5 @@ class BenchmarkPurge extends Benchmarker {
        }
 }
 
-$maintClass = "BenchmarkPurge";
+$maintClass = BenchmarkPurge::class;
 require_once RUN_MAINTENANCE_IF_MAIN;