2365718cc674c0b588faf2bfc5fb35818953a993
[lhc/web/wiklou.git] / maintenance / initStats.php
1 <?php
2
3 /**
4 * Maintenance script to re-initialise or update the site statistics table
5 *
6 * @file
7 * @ingroup Maintenance
8 * @author Brion Vibber
9 * @author Rob Church <robchur@gmail.com>
10 * @licence GNU General Public Licence 2.0 or later
11 */
12
13 require_once( "Maintenance.php" );
14
15 class InitStats extends Maintenance {
16 public function __construct() {
17 parent::__construct();
18 $this->mDescription = "Re-initialise the site statistics tables";
19 $this->addParam( 'update', 'Update the existing statistics (preserves the ss_total_views field)' );
20 $this->addParam( 'noviews', "Don't update the page view counter" );
21 }
22
23 public function execute() {
24 $this->output( "Refresh Site Statistics\n\n" );
25 SiteStats::init( $this->hasOption('update'), $this->hasOption('noviews') );
26 }
27 }
28
29 $maintClass = "InitStats";
30 require_once( DO_MAINTENANCE );