r10823 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10822‎ | r10823 | r10824 >
Date:10:22, 29 August 2005
Author:vibber
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/maintenance/initStats.php (added) (history)

Diff [purge]

Index: trunk/phase3/maintenance/initStats.php
@@ -0,0 +1,25 @@
 2+<?php
 3+
 4+require_once( 'commandLine.inc' );
 5+
 6+$dbr =& wfGetDB( DB_SLAVE );
 7+
 8+$edits = $dbr->selectField( 'revision', 'COUNT(rev_id)', '' );
 9+$pages = $dbr->selectField( 'page', 'COUNT(page_id)',
 10+ array(
 11+ 'page_namespace' => 0,
 12+ 'page_is_redirect' => 0,
 13+ 'page_len > 0',
 14+ )
 15+); // HACK APPROXIMATION
 16+
 17+echo "$wgDBname: setting edits $edits, pages $pages\n";
 18+
 19+$dbw =& wfGetDB( DB_MASTER );
 20+$dbw->insert( 'site_stats',
 21+ array( 'ss_row_id'=> 1,
 22+ 'ss_total_views' => 0,
 23+ 'ss_total_edits' => $edits,
 24+ 'ss_good_articles' => $pages ) );
 25+
 26+?>
\ No newline at end of file
Property changes on: trunk/phase3/maintenance/initStats.php
___________________________________________________________________
Added: svn:eol-style
127 + native
Added: svn:keywords
228 + Author Date Id Revision

Status & tagging log