From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- maintenance/storage/orphanStats.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'maintenance/storage/orphanStats.php') diff --git a/maintenance/storage/orphanStats.php b/maintenance/storage/orphanStats.php index 63f9025b..f30f07e4 100644 --- a/maintenance/storage/orphanStats.php +++ b/maintenance/storage/orphanStats.php @@ -20,7 +20,7 @@ * * @ingroup Maintenance ExternalStorage */ -require_once( dirname(__FILE__) . '/../Maintenance.php' ); +require_once( dirname( __FILE__ ) . '/../Maintenance.php' ); class OrphanStats extends Maintenance { public function __construct() { @@ -34,13 +34,12 @@ class OrphanStats extends Maintenance { } public function execute() { - $extDBs = array(); $dbr = wfGetDB( DB_SLAVE ); - if( !$dbr->tableExists( 'blob_orphans' ) ) { + if ( !$dbr->tableExists( 'blob_orphans' ) ) { $this->error( "blob_orphans doesn't seem to exist, need to run trackBlobs.php first", true ); } $res = $dbr->select( 'blob_orphans', '*', false, __METHOD__ ); - + $num = 0; $totalSize = 0; $hashes = array(); @@ -49,7 +48,7 @@ class OrphanStats extends Maintenance { foreach ( $res as $boRow ) { $extDB = $this->getDB( $boRow->bo_cluster ); $blobRow = $extDB->selectRow( 'blobs', '*', array( 'blob_id' => $boRow->bo_blob_id ), __METHOD__ ); - + $num++; $size = strlen( $blobRow->blob_text ); $totalSize += $size; @@ -61,11 +60,11 @@ class OrphanStats extends Maintenance { $this->output( "Number of orphans: $num\n" ); if ( $num > 0 ) { $this->output( "Average size: " . round( $totalSize / $num, 0 ) . " bytes\n" . - "Max size: $maxSize\n" . + "Max size: $maxSize\n" . "Number of unique texts: " . count( $hashes ) . "\n" ); } } } $maintClass = "OrphanStats"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); -- cgit v1.2.3-54-g00ecf