From 48d5b739e940857c7a2c95f113ecc2e9c60a78b9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 29 Aug 2005 10:22:03 +0000 Subject: [PATCH] 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. --- maintenance/initStats.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 maintenance/initStats.php 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 -- 2.20.1