require_once __DIR__ . '/../Maintenance.php';
+use MediaWiki\MediaWikiServices;
+
/**
* Maintenance script that shows some statistics on the blob_orphans table,
* created with trackBlobs.php.
}
protected function &getDB( $cluster, $groups = [], $wiki = false ) {
- $lb = wfGetLBFactory()->getExternalLB( $cluster );
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $lb = $lbFactory->getExternalLB( $cluster );
return $lb->getConnection( DB_REPLICA );
}
if ( !$dbr->tableExists( 'blob_orphans' ) ) {
$this->fatalError( "blob_orphans doesn't seem to exist, need to run trackBlobs.php first" );
}
- $res = $dbr->select( 'blob_orphans', '*', false, __METHOD__ );
+ $res = $dbr->select( 'blob_orphans', '*', '', __METHOD__ );
$num = 0;
$totalSize = 0;
}
}
-$maintClass = "OrphanStats";
+$maintClass = OrphanStats::class;
require_once RUN_MAINTENANCE_IF_MAIN;