mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-24 06:54:08 +00:00
phan: Fix use of IMaintainableDatabase::tableExists
Since core change dffca06 the tableExists function is only for maintenance database connections. DBConnRef implements that interface, use that Follow-Up: I282cd08d47be1e16cd05903d92561da04889768f Change-Id: I161c39ad0fce3c48b470a5595a2c58a26c2014a1
This commit is contained in:
parent
617fc26963
commit
1356d4847d
|
@ -29,6 +29,7 @@ use WikiMap;
|
|||
use Wikimedia\Assert\Assert;
|
||||
use Wikimedia\IPUtils;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\IMaintainableDatabase;
|
||||
|
||||
/**
|
||||
* Handle sending notifications on login from unknown source.
|
||||
|
@ -289,7 +290,7 @@ class LoginNotify implements LoggerAwareInterface {
|
|||
$lb = MediaWikiServices::getInstance()
|
||||
->getDBLoadBalancerFactory()
|
||||
->getMainLB( $wiki );
|
||||
$dbrLocal = $lb->getConnection( DB_REPLICA, [], $wiki );
|
||||
$dbrLocal = $lb->getConnectionRef( DB_REPLICA, [], $wiki );
|
||||
|
||||
if ( !$this->hasCheckUserTables( $dbrLocal ) ) {
|
||||
// Skip this wiki, no checkuser table.
|
||||
|
@ -384,10 +385,10 @@ class LoginNotify implements LoggerAwareInterface {
|
|||
/**
|
||||
* Does this wiki have a checkuser table?
|
||||
*
|
||||
* @param IDatabase $dbr Database to check
|
||||
* @param IMaintainableDatabase $dbr Database to check
|
||||
* @return bool
|
||||
*/
|
||||
private function hasCheckUserTables( IDatabase $dbr ) {
|
||||
private function hasCheckUserTables( IMaintainableDatabase $dbr ) {
|
||||
if ( !$dbr->tableExists( 'cu_changes', __METHOD__ ) ) {
|
||||
$this->log->warning( "LoginNotify: No checkuser table on {wikiId}", [
|
||||
'method' => __METHOD__,
|
||||
|
|
Loading…
Reference in a new issue