resources: Collapse all jQuery UI modules into one deprecated mega-module
[lhc/web/wiklou.git] / maintenance / showSiteStats.php
index 56cc573..1adb13e 100644 (file)
@@ -26,7 +26,7 @@
  * @author Brion Vibber
  * @author Rob Church <robchur@gmail.com>
  *
- * @license GNU General Public License 2.0 or later
+ * @license GPL-2.0-or-later
  */
 
 require_once __DIR__ . '/Maintenance.php';
@@ -39,21 +39,21 @@ require_once __DIR__ . '/Maintenance.php';
 class ShowSiteStats extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Show the cached statistics";
+               $this->addDescription( 'Show the cached statistics' );
        }
 
        public function execute() {
-               $fields = array(
+               $fields = [
                        'ss_total_edits' => 'Total edits',
                        'ss_good_articles' => 'Number of articles',
                        'ss_total_pages' => 'Total pages',
                        'ss_users' => 'Number of users',
                        'ss_active_users' => 'Active users',
                        'ss_images' => 'Number of images',
-               );
+               ];
 
-               // Get cached stats from slave database
-               $dbr = $this->getDB( DB_SLAVE );
+               // Get cached stats from a replica DB
+               $dbr = $this->getDB( DB_REPLICA );
                $stats = $dbr->selectRow( 'site_stats', '*', '', __METHOD__ );
 
                // Get maximum size for each column
@@ -74,5 +74,5 @@ class ShowSiteStats extends Maintenance {
        }
 }
 
-$maintClass = "ShowSiteStats";
+$maintClass = ShowSiteStats::class;
 require_once RUN_MAINTENANCE_IF_MAIN;