jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380215 )
Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 ...................................................................... build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: Id3b2e140468b1ab02355dc549c23bdc6fde4287c --- M PageTriage.hooks.php M api/ApiPageTriageAction.php M api/ApiPageTriageList.php M api/ApiPageTriageTagging.php M composer.json M cron/updatePageTriageQueue.php M cron/updateUserMetadata.php M includes/ArticleMetadata.php M includes/PageTriage.php M includes/PageTriageUtil.php M tests/phpunit/ArticleMetadataTest.php M tools/cleanupPageTriage.php M tools/cleanupPageTriageLog.php M tools/cleanupPageTriagePageTags.php 14 files changed, 37 insertions(+), 37 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php index 9cdecdd..e3fb056 100644 --- a/PageTriage.hooks.php +++ b/PageTriage.hooks.php @@ -40,11 +40,11 @@ // following components, BasicData is accessing pagetriage_page, // which is not safe to use slave db $config = [ - 'LinkCount' => DB_SLAVE, - 'CategoryCount' => DB_SLAVE, - 'Snippet' => DB_SLAVE, - 'UserData' => DB_SLAVE, - 'DeletionTag' => DB_SLAVE + 'LinkCount' => DB_REPLICA, + 'CategoryCount' => DB_REPLICA, + 'Snippet' => DB_REPLICA, + 'UserData' => DB_REPLICA, + 'DeletionTag' => DB_REPLICA ]; $acp->configComponentDb( $config ); $acp->compileMetadata(); @@ -482,11 +482,11 @@ // page just gets added to pagetriage queue and hence not safe to use slave db // for BasicData since it's accessing pagetriage_page table $config = [ - 'LinkCount' => DB_SLAVE, - 'CategoryCount' => DB_SLAVE, - 'Snippet' => DB_SLAVE, - 'UserData' => DB_SLAVE, - 'DeletionTag' => DB_SLAVE + 'LinkCount' => DB_REPLICA, + 'CategoryCount' => DB_REPLICA, + 'Snippet' => DB_REPLICA, + 'UserData' => DB_REPLICA, + 'DeletionTag' => DB_REPLICA ]; $acp->configComponentDb( $config ); $acp->compileMetadata(); @@ -777,7 +777,7 @@ $pageId = $event->getTitle()->getArticleID(); - $articleMetadata = new ArticleMetadata( [ $pageId ], false, DB_SLAVE ); + $articleMetadata = new ArticleMetadata( [ $pageId ], false, DB_REPLICA ); $metaData = $articleMetadata->getMetadata(); if ( !$metaData ) { diff --git a/api/ApiPageTriageAction.php b/api/ApiPageTriageAction.php index 19ea253..0fdc542 100644 --- a/api/ApiPageTriageAction.php +++ b/api/ApiPageTriageAction.php @@ -7,7 +7,7 @@ $params = $this->extractRequestParams(); - if ( !ArticleMetadata::validatePageId( [ $params['pageid'] ], DB_SLAVE ) ) { + if ( !ArticleMetadata::validatePageId( [ $params['pageid'] ], DB_REPLICA ) ) { $this->dieWithError( 'apierror-bad-pagetriage-page' ); } diff --git a/api/ApiPageTriageList.php b/api/ApiPageTriageList.php index 8f773d4..c8766c7 100644 --- a/api/ApiPageTriageList.php +++ b/api/ApiPageTriageList.php @@ -21,7 +21,7 @@ $pages = self::getPageIds( $opts ); $pageIdValidated = true; } - $pageIdValidateDb = DB_SLAVE; + $pageIdValidateDb = DB_REPLICA; $sortedMetaData = []; @@ -167,7 +167,7 @@ } // Database setup - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); // Offset the list by timestamp if ( @@ -228,7 +228,7 @@ * @return string */ private static function buildTagQuery( $opts ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $tagConds = ''; $searchableTags = [ diff --git a/api/ApiPageTriageTagging.php b/api/ApiPageTriageTagging.php index cd09b14..5d30133 100644 --- a/api/ApiPageTriageTagging.php +++ b/api/ApiPageTriageTagging.php @@ -7,7 +7,7 @@ $params = $this->extractRequestParams(); - if ( !ArticleMetadata::validatePageId( [ $params['pageid'] ], DB_SLAVE ) ) { + if ( !ArticleMetadata::validatePageId( [ $params['pageid'] ], DB_REPLICA ) ) { $this->dieWithError( 'apierror-bad-pagetriage-page' ); } diff --git a/composer.json b/composer.json index 7898723..d980e06 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { diff --git a/cron/updatePageTriageQueue.php b/cron/updatePageTriageQueue.php index 3134ba2..806917c 100644 --- a/cron/updatePageTriageQueue.php +++ b/cron/updatePageTriageQueue.php @@ -29,7 +29,7 @@ } protected function init() { - $this->dbr = wfGetDB( DB_SLAVE ); + $this->dbr = wfGetDB( DB_REPLICA ); $this->dbw = wfGetDB( DB_MASTER ); } diff --git a/cron/updateUserMetadata.php b/cron/updateUserMetadata.php index fe9ccd8..1970195 100644 --- a/cron/updateUserMetadata.php +++ b/cron/updateUserMetadata.php @@ -28,7 +28,7 @@ } protected function init() { - $this->dbr = wfGetDB( DB_SLAVE ); + $this->dbr = wfGetDB( DB_REPLICA ); } public function execute() { @@ -96,7 +96,7 @@ if ( $acp ) { $acp->registerComponent( 'UserData' ); // safe to use slave db for data compilation - $acp->configComponentDb( [ 'UserData' => DB_SLAVE ] ); + $acp->configComponentDb( [ 'UserData' => DB_REPLICA ] ); $acp->compileMetadata(); } diff --git a/includes/ArticleMetadata.php b/includes/ArticleMetadata.php index 739251d..34374ca 100644 --- a/includes/ArticleMetadata.php +++ b/includes/ArticleMetadata.php @@ -115,7 +115,7 @@ // Grab metadata from database after cache attempt if ( $articles ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ @@ -175,7 +175,7 @@ // Compile the data if it is not available, this is a very rare case unless // the metadata gets deleted manually if ( $articles ) { - $acp = ArticleCompileProcessor::newFromPageId( $articles, false, DB_SLAVE ); + $acp = ArticleCompileProcessor::newFromPageId( $articles, false, DB_REPLICA ); if ( $acp ) { $pageData += $acp->compileMetadata( $acp::SAVE_DEFERRED ); } @@ -217,7 +217,7 @@ if ( $tags === false ) { $tags = []; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ 'pagetriage_tags' ], [ 'ptrt_tag_id', 'ptrt_tag_name' ], @@ -378,7 +378,7 @@ * example: array( 'BasicData' => DB_SLAVE, 'UserData' => DB_MASTER ) */ public function configComponentDb( $config ) { - $dbMode = [ DB_MASTER, DB_SLAVE ]; + $dbMode = [ DB_MASTER, DB_REPLICA ]; foreach ( $this->componentDb as $key => $value ) { if ( isset( $config[$key] ) && in_array( $config[$key], $dbMode ) ) { $this->componentDb[$key] = $config[$key]; @@ -394,7 +394,7 @@ public function compileMetadata( $mode = self::SAVE_IMMEDIATE ) { if ( $mode === self::SAVE_DEFERRED ) { foreach ( $this->component as $key => $value ) { - $this->componentDb[$key] = DB_SLAVE; + $this->componentDb[$key] = DB_REPLICA; } } @@ -471,7 +471,7 @@ */ protected function save() { $dbw = wfGetDB( DB_MASTER ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); if ( !$this->mPageId ) { return; diff --git a/includes/PageTriage.php b/includes/PageTriage.php index e22bc79..bcd13f2 100644 --- a/includes/PageTriage.php +++ b/includes/PageTriage.php @@ -167,7 +167,7 @@ return true; } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->selectRow( [ 'pagetriage_page' ], diff --git a/includes/PageTriageUtil.php b/includes/PageTriageUtil.php index 654ea92..45fea44 100644 --- a/includes/PageTriageUtil.php +++ b/includes/PageTriageUtil.php @@ -26,7 +26,7 @@ return null; } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $row = $dbr->selectRow( 'pagetriage_page', 'ptrp_reviewed', [ 'ptrp_page_id' => $article->getID() ] @@ -76,7 +76,7 @@ return $data; } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $table = [ 'pagetriage_page', 'page' ]; $conds = [ @@ -143,7 +143,7 @@ $time = wfTimestamp( TS_UNIX ) - 7 * 24 * 60 * 60; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $table = [ 'pagetriage_page', 'page' ]; $conds = [ @@ -193,7 +193,7 @@ $time = 'last-day'; } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $key = wfMemcKey( 'pagetriage', 'top-triager', $time, self::getCacheVersion() ); $topTriager = $wgMemc->get( $key ); @@ -270,7 +270,7 @@ } if ( $title ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ 'page' ], [ 'page_namespace', 'page_title' ], @@ -331,7 +331,7 @@ return; } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ 'pagetriage_page_tags' ], diff --git a/tests/phpunit/ArticleMetadataTest.php b/tests/phpunit/ArticleMetadataTest.php index e0a9068..5a12678 100644 --- a/tests/phpunit/ArticleMetadataTest.php +++ b/tests/phpunit/ArticleMetadataTest.php @@ -16,7 +16,7 @@ protected function setUp() { parent::setUp(); $this->pageId = []; - $this->dbr = wfGetDB( DB_SLAVE ); + $this->dbr = wfGetDB( DB_REPLICA ); // Set up some page_id to test $count = $start = 0; diff --git a/tools/cleanupPageTriage.php b/tools/cleanupPageTriage.php index 47ab19d..5a2c2dc 100644 --- a/tools/cleanupPageTriage.php +++ b/tools/cleanupPageTriage.php @@ -19,7 +19,7 @@ public function execute() { $dbw = wfGetDB( DB_MASTER ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $count = $this->batchSize; $start = 0; diff --git a/tools/cleanupPageTriageLog.php b/tools/cleanupPageTriageLog.php index b1b8c18..ac83c70 100644 --- a/tools/cleanupPageTriageLog.php +++ b/tools/cleanupPageTriageLog.php @@ -20,7 +20,7 @@ public function execute() { $dbw = wfGetDB( DB_MASTER ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); // clean up the following type and action $logTypes = [ diff --git a/tools/cleanupPageTriagePageTags.php b/tools/cleanupPageTriagePageTags.php index 43a0fcc..40bd2e3 100644 --- a/tools/cleanupPageTriagePageTags.php +++ b/tools/cleanupPageTriagePageTags.php @@ -19,7 +19,7 @@ public function execute() { $dbw = wfGetDB( DB_MASTER ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $count = $this->batchSize; $start = 0; -- To view, visit https://gerrit.wikimedia.org/r/380215 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3b2e140468b1ab02355dc549c23bdc6fde4287c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageTriage Gerrit-Branch: master Gerrit-Owner: Libraryupgrader <tools.libraryupgra...@tools.wmflabs.org> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits