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:
Umherirrender 2022-08-16 22:35:22 +02:00
parent 617fc26963
commit 1356d4847d

View file

@ -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__,