X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateArticleCount.php;h=dff5aec8e469e60e4cb54356bbd226409c2d9862;hb=4c7cd244699256a2ae45ead1b0651291540ab114;hp=55f535d20e3401eea9a0165ea010959cd8a699f1;hpb=69bd2e54d698f32120940f80f3493479297ecf74;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateArticleCount.php b/maintenance/updateArticleCount.php index 55f535d20e..dff5aec8e4 100644 --- a/maintenance/updateArticleCount.php +++ b/maintenance/updateArticleCount.php @@ -35,7 +35,7 @@ class UpdateArticleCount extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Count of the number of articles and update the site statistics table"; + $this->addDescription( 'Count of the number of articles and update the site statistics table' ); $this->addOption( 'update', 'Update the site_stats table with the new count' ); $this->addOption( 'use-master', 'Count using the master database' ); } @@ -44,9 +44,9 @@ class UpdateArticleCount extends Maintenance { $this->output( "Counting articles..." ); if ( $this->hasOption( 'use-master' ) ) { - $dbr = wfGetDB( DB_MASTER ); + $dbr = $this->getDB( DB_MASTER ); } else { - $dbr = wfGetDB( DB_SLAVE, 'vslow' ); + $dbr = $this->getDB( DB_SLAVE, 'vslow' ); } $counter = new SiteStatsInit( $dbr ); $result = $counter->articles(); @@ -54,11 +54,11 @@ class UpdateArticleCount extends Maintenance { $this->output( "found {$result}.\n" ); if ( $this->hasOption( 'update' ) ) { $this->output( "Updating site statistics table... " ); - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->getDB( DB_MASTER ); $dbw->update( 'site_stats', - array( 'ss_good_articles' => $result ), - array( 'ss_row_id' => 1 ), + [ 'ss_good_articles' => $result ], + [ 'ss_row_id' => 1 ], __METHOD__ ); $this->output( "done.\n" );