From: Brion Vibber Date: Mon, 29 Aug 2005 10:22:03 +0000 (+0000) Subject: Quick hacky script to initialize site_stats row where missing. X-Git-Tag: 1.6.0~1765 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=48d5b739e940857c7a2c95f113ecc2e9c60a78b9;p=lhc%2Fweb%2Fwiklou.git Quick hacky script to initialize site_stats row where missing. Note: the good pages count is probably wrong, since this is no longer easy to count content on 1.5 schema. It may overcount some pages which don't actually contain a '[' character. --- diff --git a/maintenance/initStats.php b/maintenance/initStats.php new file mode 100644 index 0000000000..85804596be --- /dev/null +++ b/maintenance/initStats.php @@ -0,0 +1,25 @@ +selectField( 'revision', 'COUNT(rev_id)', '' ); +$pages = $dbr->selectField( 'page', 'COUNT(page_id)', + array( + 'page_namespace' => 0, + 'page_is_redirect' => 0, + 'page_len > 0', + ) +); // HACK APPROXIMATION + +echo "$wgDBname: setting edits $edits, pages $pages\n"; + +$dbw =& wfGetDB( DB_MASTER ); +$dbw->insert( 'site_stats', + array( 'ss_row_id'=> 1, + 'ss_total_views' => 0, + 'ss_total_edits' => $edits, + 'ss_good_articles' => $pages ) ); + +?> \ No newline at end of file