X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fblock%2FBlockRestrictionStore.php;h=4fa4cfe782f995c42aacaec04298bcc26426aee5;hb=bd5a37aacf600bdd5f3a6e7998f92bd1d9326a8a;hp=df09eadc8fe7ee6b6526ab4999e27dfc9b1c1ed9;hpb=2586339be2c2be12dcf67c64d7f663d0e632c664;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/block/BlockRestrictionStore.php b/includes/block/BlockRestrictionStore.php index df09eadc8f..4fa4cfe782 100644 --- a/includes/block/BlockRestrictionStore.php +++ b/includes/block/BlockRestrictionStore.php @@ -66,7 +66,7 @@ class BlockRestrictionStore { return []; } - $db = $db ?: $this->loadBalancer->getConnection( DB_REPLICA ); + $db = $db ?: $this->loadBalancer->getConnectionRef( DB_REPLICA ); $result = $db->select( [ 'ipblocks_restrictions', 'page' ], @@ -104,7 +104,7 @@ class BlockRestrictionStore { return false; } - $dbw = $this->loadBalancer->getConnection( DB_MASTER ); + $dbw = $this->loadBalancer->getConnectionRef( DB_MASTER ); $dbw->insert( 'ipblocks_restrictions', @@ -125,7 +125,7 @@ class BlockRestrictionStore { * @return bool */ public function update( array $restrictions ) { - $dbw = $this->loadBalancer->getConnection( DB_MASTER ); + $dbw = $this->loadBalancer->getConnectionRef( DB_MASTER ); $dbw->startAtomic( __METHOD__ ); @@ -197,7 +197,7 @@ class BlockRestrictionStore { $parentBlockId = (int)$parentBlockId; - $db = $this->loadBalancer->getConnection( DB_MASTER ); + $db = $this->loadBalancer->getConnectionRef( DB_MASTER ); $db->startAtomic( __METHOD__ ); @@ -230,7 +230,7 @@ class BlockRestrictionStore { * @return bool */ public function delete( array $restrictions ) { - $dbw = $this->loadBalancer->getConnection( DB_MASTER ); + $dbw = $this->loadBalancer->getConnectionRef( DB_MASTER ); $result = true; foreach ( $restrictions as $restriction ) { if ( !$restriction instanceof Restriction ) { @@ -260,7 +260,7 @@ class BlockRestrictionStore { * @return bool */ public function deleteByBlockId( $blockId ) { - $dbw = $this->loadBalancer->getConnection( DB_MASTER ); + $dbw = $this->loadBalancer->getConnectionRef( DB_MASTER ); return $dbw->delete( 'ipblocks_restrictions', [ 'ir_ipb_id' => $blockId ], @@ -277,7 +277,7 @@ class BlockRestrictionStore { * @return bool */ public function deleteByParentBlockId( $parentBlockId ) { - $dbw = $this->loadBalancer->getConnection( DB_MASTER ); + $dbw = $this->loadBalancer->getConnectionRef( DB_MASTER ); return $dbw->deleteJoin( 'ipblocks_restrictions', 'ipblocks',