mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
Replace uses of DB_MASTER with DB_PRIMARY
This requires MediaWiki version 1.36 Change-Id: Idc9edb06b2a080ea9d64e6cdac0b68eb14c485f9
This commit is contained in:
parent
217c43090f
commit
33f94693fb
|
@ -7,7 +7,7 @@
|
|||
"descriptionmsg": "discussiontools-desc",
|
||||
"manifest_version": 2,
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.35.0",
|
||||
"MediaWiki": ">= 1.36.0",
|
||||
"extensions": {
|
||||
"VisualEditor": ">= 0.1.2",
|
||||
"Linter": "*"
|
||||
|
|
|
@ -48,7 +48,7 @@ class SubscriptionStore {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param int $dbIndex DB_MASTER or DB_REPLICA
|
||||
* @param int $dbIndex DB_PRIMARY or DB_REPLICA
|
||||
*
|
||||
* @return IDatabase
|
||||
*/
|
||||
|
@ -118,7 +118,7 @@ class SubscriptionStore {
|
|||
}
|
||||
|
||||
$options += [ 'forWrite' => false ];
|
||||
$db = $this->getConnectionRef( $options['forWrite'] ? DB_MASTER : DB_REPLICA );
|
||||
$db = $this->getConnectionRef( $options['forWrite'] ? DB_PRIMARY : DB_REPLICA );
|
||||
|
||||
$rows = $this->fetchSubscriptions(
|
||||
$db,
|
||||
|
@ -152,7 +152,7 @@ class SubscriptionStore {
|
|||
array $options = []
|
||||
) : array {
|
||||
$options += [ 'forWrite' => false ];
|
||||
$db = $this->getConnectionRef( $options['forWrite'] ? DB_MASTER : DB_REPLICA );
|
||||
$db = $this->getConnectionRef( $options['forWrite'] ? DB_PRIMARY : DB_REPLICA );
|
||||
|
||||
$rows = $this->fetchSubscriptions(
|
||||
$db,
|
||||
|
@ -214,7 +214,7 @@ class SubscriptionStore {
|
|||
if ( !$user->isRegistered() ) {
|
||||
return false;
|
||||
}
|
||||
$dbw = $this->getConnectionRef( DB_MASTER );
|
||||
$dbw = $this->getConnectionRef( DB_PRIMARY );
|
||||
$dbw->upsert(
|
||||
'discussiontools_subscription',
|
||||
[
|
||||
|
@ -251,7 +251,7 @@ class SubscriptionStore {
|
|||
if ( !$user->isRegistered() ) {
|
||||
return false;
|
||||
}
|
||||
$dbw = $this->getConnectionRef( DB_MASTER );
|
||||
$dbw = $this->getConnectionRef( DB_PRIMARY );
|
||||
$dbw->update(
|
||||
'discussiontools_subscription',
|
||||
[ 'sub_state' => 0 ],
|
||||
|
@ -278,7 +278,7 @@ class SubscriptionStore {
|
|||
if ( $this->readOnlyMode->isReadOnly() ) {
|
||||
return false;
|
||||
}
|
||||
$dbw = $this->getConnectionRef( DB_MASTER );
|
||||
$dbw = $this->getConnectionRef( DB_PRIMARY );
|
||||
|
||||
$conditions = [
|
||||
'sub_item' => $itemName,
|
||||
|
|
Loading…
Reference in a new issue