dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "tests: Remove use of $IP and MediaWikiTestCase in libs/composer tests"
[lhc/web/wiklou.git]
/
maintenance
/
storage
/
orphanStats.php
diff --git
a/maintenance/storage/orphanStats.php
b/maintenance/storage/orphanStats.php
index
d7d0b84
..
219b47c
100644
(file)
--- a/
maintenance/storage/orphanStats.php
+++ b/
maintenance/storage/orphanStats.php
@@
-23,6
+23,8
@@
require_once __DIR__ . '/../Maintenance.php';
require_once __DIR__ . '/../Maintenance.php';
+use MediaWiki\MediaWikiServices;
+
/**
* Maintenance script that shows some statistics on the blob_orphans table,
* created with trackBlobs.php.
/**
* Maintenance script that shows some statistics on the blob_orphans table,
* created with trackBlobs.php.
@@
-37,7
+39,8
@@
class OrphanStats extends Maintenance {
}
protected function &getDB( $cluster, $groups = [], $wiki = false ) {
}
protected function &getDB( $cluster, $groups = [], $wiki = false ) {
- $lb = wfGetLBFactory()->getExternalLB( $cluster );
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $lb = $lbFactory->getExternalLB( $cluster );
return $lb->getConnection( DB_REPLICA );
}
return $lb->getConnection( DB_REPLICA );
}
@@
-45,9
+48,9
@@
class OrphanStats extends Maintenance {
public function execute() {
$dbr = $this->getDB( DB_REPLICA );
if ( !$dbr->tableExists( 'blob_orphans' ) ) {
public function execute() {
$dbr = $this->getDB( DB_REPLICA );
if ( !$dbr->tableExists( 'blob_orphans' ) ) {
- $this->
error( "blob_orphans doesn't seem to exist, need to run trackBlobs.php first", true
);
+ $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;
$num = 0;
$totalSize = 0;
@@
-80,5
+83,5
@@
class OrphanStats extends Maintenance {
}
}
}
}
-$maintClass =
"OrphanStats"
;
+$maintClass =
OrphanStats::class
;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;