Add help
authorRob Church <robchurch@users.mediawiki.org>
Mon, 1 May 2006 15:57:22 +0000 (15:57 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Mon, 1 May 2006 15:57:22 +0000 (15:57 +0000)
maintenance/initStats.php

index 0fd881f..fb5603d 100644 (file)
@@ -16,6 +16,11 @@ echo( "Refresh Site Statistics\n\n" );
 $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..." );
@@ -54,4 +59,10 @@ if( isset( $options['update'] ) ) {
 
 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