Doxygen documentation update: * Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group. * Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file. * Removed some empty comments * Removed some ?> Added following groups: * ExternalStorage * JobQueue * MaintenanceLanguage One more thing: there are still a lot of warnings when generating the doc.
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Maintenance script to provide a better count of the number of articles
|
|
* and update the site statistics table, if desired
|
|
*
|
|
* @file
|
|
* @ingroup Maintenance
|
|
* @author Rob Church <robchur@gmail.com>
|
|
*/
|
|
|
|
$options = array( 'update', 'help' );
|
|
require_once( 'commandLine.inc' );
|
|
require_once( 'updateArticleCount.inc.php' );
|
|
echo( "Update Article Count\n\n" );
|
|
|
|
if( isset( $options['help'] ) && $options['help'] ) {
|
|
echo( "Usage: php updateArticleCount.php [--update]\n\n" );
|
|
echo( "--update : Update site statistics table\n" );
|
|
exit( 0 );
|
|
}
|
|
|
|
echo( "Counting articles..." );
|
|
$counter = new ArticleCounter();
|
|
$result = $counter->count();
|
|
|
|
if( $result !== false ) {
|
|
echo( "found {$result}.\n" );
|
|
if( isset( $options['update'] ) && $options['update'] ) {
|
|
echo( "Updating site statistics table... " );
|
|
$dbw = wfGetDB( DB_MASTER );
|
|
$dbw->update( 'site_stats', array( 'ss_good_articles' => $result ), array( 'ss_row_id' => 1 ), __METHOD__ );
|
|
echo( "done.\n" );
|
|
} else {
|
|
echo( "To update the site statistics table, run the script with the --update option.\n" );
|
|
}
|
|
} else {
|
|
echo( "failed.\n" );
|
|
}
|
|
echo( "\n" );
|
|
|