summaryrefslogtreecommitdiff
path: root/maintenance/initStats.php
blob: 05377481724c2d53ec563bc1a0acc8bf6515fb4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

/**
 * Maintenance script to re-initialise or update the site statistics table
 *
 * @addtogroup Maintenance
 * @author Brion Vibber
 * @author Rob Church <robchur@gmail.com>
 * @licence GNU General Public Licence 2.0 or later
 */
 
$options = array( 'help', 'update', 'noviews' );
require_once( 'commandLine.inc' );
echo( "Refresh Site Statistics\n\n" );

if( isset( $options['help'] ) ) {
	showHelp();
	exit();
}

require "$IP/maintenance/initStats.inc";
wfInitStats( $options );

function showHelp() {
	echo( "Re-initialise the site statistics tables.\n\n" );
	echo( "Usage: php initStats.php [--update|--noviews]\n\n" );
	echo( " --update : Update the existing statistics (preserves the ss_total_views field)\n" );
	echo( "--noviews : Don't update the page view counter\n\n" );
}