4 * Maintenance script to re-initialise or update the site statistics table
9 * @author Rob Church <robchur@gmail.com>
10 * @licence GNU General Public Licence 2.0 or later
13 require_once( "Maintenance.php" );
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" );
23 public function execute() {
24 $this->output( "Refresh Site Statistics\n\n" );
25 SiteStats
::init( $this->hasOption('update'), $this->hasOption('noviews') );
29 $maintClass = "InitStats";
30 require_once( DO_MAINTENANCE
);