$dbr =& wfGetDB( DB_SLAVE );
$fname = 'initStats';
+if( isset( $options['help'] ) {
+ showHelp();
+ exit();
+}
+
echo( "Counting total edits..." );
$edits = $dbr->selectField( 'revision', 'COUNT(*)', '', $fname );
echo( "{$edits}\nCounting number of articles..." );
echo( "done.\n\n" );
+function showHelp() {
+ echo( "Re-initialise the site statistics tables.\n\n" );
+ echo( "Usage: php initStats.php [--update]\n\n" );
+ echo( "--update : Update the existing statistics (preserves the ss_total_views field)\n\n" );
+}
+
?>
\ No newline at end of file