r35123 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35122‎ | r35123 | r35124 >
Date:01:13, 21 May 2008
Author:aaron
Status:old
Tags:
Comment:
Remove bs
Modified paths:
  • /trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/updateLinks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/maintenance/updateLinks.php
@@ -4,11 +4,9 @@
55 require dirname(__FILE__) . '/../../../maintenance/commandLine.inc';
66 require dirname(__FILE__) . '/updateLinks.inc';
77
8 -error_reporting( E_ALL & (~E_NOTICE) );
 8+error_reporting( E_ALL );
99
10 -$db = wfGetDB( DB_MASTER );
 10+update_flaggedrevs();
1111
12 -update_flaggedrevs( $db );
 12+update_flaggedpages();
1313
14 -update_flaggedpages( $db );
15 -
Index: trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc
@@ -2,8 +2,9 @@
33
44 define( 'BATCH_SIZE',500 );
55
6 -function update_flaggedrevs( $db ) {
 6+function update_flaggedrevs() {
77 echo "Populating and correcting flaggedrevs columns\n";
 8+ $db = wfGetDB( DB_MASTER );
89 $start = $db->selectField( 'flaggedrevs', 'MIN(fr_rev_id)', false, __FUNCTION__ );
910 $end = $db->selectField( 'flaggedrevs', 'MAX(fr_rev_id)', false, __FUNCTION__ );
1011 if( is_null( $start ) || is_null( $end ) ){
@@ -20,7 +21,8 @@
2122 echo "...doing fr_rev_id from $blockStart to $blockEnd\n";
2223 $cond = "fr_rev_id BETWEEN $blockStart AND $blockEnd AND page_id = fr_rev_id";
2324 $res = $db->select( array('flaggedrevs', 'page'),
24 - array('fr_rev_id','fr_tags','fr_quality','fr_img_name','page_namespace','page_title'),
 25+ array('fr_rev_id','fr_tags','fr_quality','page_namespace','page_title',
 26+ 'fr_img_name','fr_img_timestamp','fr_img_sha1'),
2527 $cond, __FUNCTION__ );
2628 # Go through and clean up missing items, as well as correct fr_quality...
2729 foreach( $res as $row ) {
@@ -29,7 +31,7 @@
3032 if( FlaggedRevs::isPristine( $tags ) ) {
3133 $quality = 2;
3234 } else {
33 - $quality = FlaggedRevs::isQuality( $tags ) ? : 1 : 0;
 35+ $quality = FlaggedRevs::isQuality( $tags ) ? 1 : 0;
3436 }
3537 $time = $sha1 = $file = null;
3638 # Check for file version to see if stored the old way...
@@ -66,8 +68,9 @@
6769 echo "fr_quality and fr_img_* columns update complete ... {$count} rows [{$changed} changed]\n";
6870 }
6971
70 -function update_flaggedpages( $db ) {
 72+function update_flaggedpages() {
7173 echo "Populating and correcting flaggedpages columns\n";
 74+ $db = wfGetDB( DB_MASTER );
7275 $start = $db->selectField( 'page', 'MIN(page_id)', false, __FUNCTION__ );
7376 $end = $db->selectField( 'page', 'MAX(page_id)', false, __FUNCTION__ );
7477 if( is_null( $start ) || is_null( $end ) ){

Status & tagging log