From ee4386a8c90281d1af2797c202354ca6bdc64e5e Mon Sep 17 00:00:00 2001 From: paladox Date: Wed, 18 Dec 2019 20:25:35 +0000 Subject: [PATCH] DB_SLAVE -> DB_REPLICA (#44) * --amend * Add Beerpay badge * Remove beerpay badge. * Remove erroneous release folder from master branch. * DB_SLAVE -> DB_REPLICA DB_SLAVE has been removed under 1.34 thus throws an exception. * Update Targets.php * Update linktitles-cli.php * Update Special.php --- includes/Special.php | 2 +- includes/Targets.php | 2 +- linktitles-cli.php | 2 +- tests/phpunit/TargetsTest.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Special.php b/includes/Special.php index 72e15c4..d147950 100644 --- a/includes/Special.php +++ b/includes/Special.php @@ -103,7 +103,7 @@ class Special extends \SpecialPage { $startTime = microtime( true ); // Connect to the database - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); // Fetch the start index and max number of records from the POST // request. diff --git a/includes/Targets.php b/includes/Targets.php index 72f37fc..8bc46f1 100644 --- a/includes/Targets.php +++ b/includes/Targets.php @@ -134,7 +134,7 @@ class Targets { // shortest to longest. Only titles from 'normal' pages (namespace uid // = 0) are returned. Since the db may be sqlite, we need a try..catch // structure because sqlite does not support the CHAR_LENGTH function. - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $this->queryResult = $dbr->select( 'page', array( 'page_title', 'page_namespace' , "weight" => $weightSelect), diff --git a/linktitles-cli.php b/linktitles-cli.php index a4d175f..d8f4aca 100755 --- a/linktitles-cli.php +++ b/linktitles-cli.php @@ -154,7 +154,7 @@ class Cli extends \Maintenance { $config = new Config(); // Retrieve page names from the database. - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $namespacesClause = str_replace( '_', ' ','(' . implode( ', ', $config->sourceNamespaces ) . ')' ); $res = $dbr->select( 'page', diff --git a/tests/phpunit/TargetsTest.php b/tests/phpunit/TargetsTest.php index 2a7f8fc..a2debea 100644 --- a/tests/phpunit/TargetsTest.php +++ b/tests/phpunit/TargetsTest.php @@ -40,7 +40,7 @@ class TargetsTest extends LinkTitles\TestCase { // Count number of articles: Inspired by updateArticleCount.php maintenance // script: https://doc.wikimedia.org/mediawiki-core/master/php/updateArticleCount_8php_source.html - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $counter = new SiteStatsInit( $dbr ); $count = $counter->pages();