Merge "registration: Only allow one extension to set a specific config setting"
[lhc/web/wiklou.git] / maintenance / storage / testCompression.php
index 58644c2..deb2ca6 100644 (file)
@@ -30,10 +30,11 @@ if ( !isset( $args[0] ) ) {
        exit( 1 );
 }
 
+$lang = Language::factory( 'en' );
 $title = Title::newFromText( $args[0] );
 if ( isset( $options['start'] ) ) {
        $start = wfTimestamp( TS_MW, strtotime( $options['start'] ) );
-       echo "Starting from " . $wgLang->timeanddate( $start ) . "\n";
+       echo "Starting from " . $lang->timeanddate( $start ) . "\n";
 } else {
        $start = '19700101000000';
 }
@@ -46,10 +47,14 @@ if ( isset( $options['limit'] ) ) {
 }
 $type = isset( $options['type'] ) ? $options['type'] : 'ConcatenatedGzipHistoryBlob';
 
-$dbr = $this->getDB( DB_SLAVE );
+$dbr = $this->getDB( DB_REPLICA );
 $res = $dbr->select(
        [ 'page', 'revision', 'text' ],
-       '*',
+       array_merge(
+               Revision::selectFields(),
+               Revision::selectPageFields(),
+               Revision::selectTextFields()
+       ),
        [
                'page_namespace' => $title->getNamespace(),
                'page_title' => $title->getDBkey(),
@@ -83,7 +88,7 @@ printf( "%s\nCompression ratio for %d revisions: %5.2f, %s -> %d\n",
        $type,
        count( $hashes ),
        $uncompressedSize / strlen( $serialized ),
-       $wgLang->formatSize( $uncompressedSize ),
+       $lang->formatSize( $uncompressedSize ),
        strlen( $serialized )
 );
 printf( "Compression time: %5.2f ms\n", $t * 1000 );