mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 01:39:30 +02:00
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
This commit is contained in:
@ -103,7 +103,7 @@ class Special extends \SpecialPage {
|
|||||||
$startTime = microtime( true );
|
$startTime = microtime( true );
|
||||||
|
|
||||||
// Connect to the database
|
// Connect to the database
|
||||||
$dbr = wfGetDB( DB_SLAVE );
|
$dbr = wfGetDB( DB_REPLICA );
|
||||||
|
|
||||||
// Fetch the start index and max number of records from the POST
|
// Fetch the start index and max number of records from the POST
|
||||||
// request.
|
// request.
|
||||||
|
@ -134,7 +134,7 @@ class Targets {
|
|||||||
// shortest to longest. Only titles from 'normal' pages (namespace uid
|
// shortest to longest. Only titles from 'normal' pages (namespace uid
|
||||||
// = 0) are returned. Since the db may be sqlite, we need a try..catch
|
// = 0) are returned. Since the db may be sqlite, we need a try..catch
|
||||||
// structure because sqlite does not support the CHAR_LENGTH function.
|
// structure because sqlite does not support the CHAR_LENGTH function.
|
||||||
$dbr = wfGetDB( DB_SLAVE );
|
$dbr = wfGetDB( DB_REPLICA );
|
||||||
$this->queryResult = $dbr->select(
|
$this->queryResult = $dbr->select(
|
||||||
'page',
|
'page',
|
||||||
array( 'page_title', 'page_namespace' , "weight" => $weightSelect),
|
array( 'page_title', 'page_namespace' , "weight" => $weightSelect),
|
||||||
|
@ -154,7 +154,7 @@ class Cli extends \Maintenance {
|
|||||||
$config = new Config();
|
$config = new Config();
|
||||||
|
|
||||||
// Retrieve page names from the database.
|
// Retrieve page names from the database.
|
||||||
$dbr = $this->getDB( DB_SLAVE );
|
$dbr = $this->getDB( DB_REPLICA );
|
||||||
$namespacesClause = str_replace( '_', ' ','(' . implode( ', ', $config->sourceNamespaces ) . ')' );
|
$namespacesClause = str_replace( '_', ' ','(' . implode( ', ', $config->sourceNamespaces ) . ')' );
|
||||||
$res = $dbr->select(
|
$res = $dbr->select(
|
||||||
'page',
|
'page',
|
||||||
|
@ -40,7 +40,7 @@ class TargetsTest extends LinkTitles\TestCase {
|
|||||||
|
|
||||||
// Count number of articles: Inspired by updateArticleCount.php maintenance
|
// Count number of articles: Inspired by updateArticleCount.php maintenance
|
||||||
// script: https://doc.wikimedia.org/mediawiki-core/master/php/updateArticleCount_8php_source.html
|
// 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 );
|
$counter = new SiteStatsInit( $dbr );
|
||||||
$count = $counter->pages();
|
$count = $counter->pages();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user