Merge "Add MediaWikiTestCase::checkHasDiff3 and use it"
[lhc/web/wiklou.git] / maintenance / initStats.php
index 054b48d..5d8b886 100644 (file)
@@ -1,7 +1,6 @@
 <?php
-
 /**
- * Maintenance script to re-initialise or update the site statistics table
+ * Re-initialise or update the site statistics table.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  * @author Brion Vibber
  * @author Rob Church <robchur@gmail.com>
- * @licence GNU General Public Licence 2.0 or later
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
+/**
+ * Maintenance script to re-initialise or update the site statistics table
+ *
+ * @ingroup Maintenance
+ */
 class InitStats extends Maintenance {
        public function __construct() {
                parent::__construct();
@@ -64,7 +68,7 @@ class InitStats extends Maintenance {
 
                if ( $this->hasOption( 'active' ) ) {
                        $this->output( "Counting active users..." );
-                       $active = SiteStatsUpdate::cacheUpdate();
+                       $active = SiteStatsUpdate::cacheUpdate( wfGetDB( DB_MASTER ) );
                        $this->output( "{$active}\n" );
                }
 
@@ -81,4 +85,4 @@ class InitStats extends Maintenance {
 }
 
 $maintClass = "InitStats";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );