Index: trunk/extensions/FlaggedRevs/maintenance/updateLinks.php |
— | — | @@ -4,11 +4,9 @@ |
5 | 5 | require dirname(__FILE__) . '/../../../maintenance/commandLine.inc'; |
6 | 6 | require dirname(__FILE__) . '/updateLinks.inc'; |
7 | 7 | |
8 | | -error_reporting( E_ALL & (~E_NOTICE) ); |
| 8 | +error_reporting( E_ALL ); |
9 | 9 | |
10 | | -$db = wfGetDB( DB_MASTER ); |
| 10 | +update_flaggedrevs(); |
11 | 11 | |
12 | | -update_flaggedrevs( $db ); |
| 12 | +update_flaggedpages(); |
13 | 13 | |
14 | | -update_flaggedpages( $db ); |
15 | | - |
Index: trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc |
— | — | @@ -2,8 +2,9 @@ |
3 | 3 | |
4 | 4 | define( 'BATCH_SIZE',500 ); |
5 | 5 | |
6 | | -function update_flaggedrevs( $db ) { |
| 6 | +function update_flaggedrevs() { |
7 | 7 | echo "Populating and correcting flaggedrevs columns\n"; |
| 8 | + $db = wfGetDB( DB_MASTER ); |
8 | 9 | $start = $db->selectField( 'flaggedrevs', 'MIN(fr_rev_id)', false, __FUNCTION__ ); |
9 | 10 | $end = $db->selectField( 'flaggedrevs', 'MAX(fr_rev_id)', false, __FUNCTION__ ); |
10 | 11 | if( is_null( $start ) || is_null( $end ) ){ |
— | — | @@ -20,7 +21,8 @@ |
21 | 22 | echo "...doing fr_rev_id from $blockStart to $blockEnd\n"; |
22 | 23 | $cond = "fr_rev_id BETWEEN $blockStart AND $blockEnd AND page_id = fr_rev_id"; |
23 | 24 | $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'), |
25 | 27 | $cond, __FUNCTION__ ); |
26 | 28 | # Go through and clean up missing items, as well as correct fr_quality... |
27 | 29 | foreach( $res as $row ) { |
— | — | @@ -29,7 +31,7 @@ |
30 | 32 | if( FlaggedRevs::isPristine( $tags ) ) { |
31 | 33 | $quality = 2; |
32 | 34 | } else { |
33 | | - $quality = FlaggedRevs::isQuality( $tags ) ? : 1 : 0; |
| 35 | + $quality = FlaggedRevs::isQuality( $tags ) ? 1 : 0; |
34 | 36 | } |
35 | 37 | $time = $sha1 = $file = null; |
36 | 38 | # Check for file version to see if stored the old way... |
— | — | @@ -66,8 +68,9 @@ |
67 | 69 | echo "fr_quality and fr_img_* columns update complete ... {$count} rows [{$changed} changed]\n"; |
68 | 70 | } |
69 | 71 | |
70 | | -function update_flaggedpages( $db ) { |
| 72 | +function update_flaggedpages() { |
71 | 73 | echo "Populating and correcting flaggedpages columns\n"; |
| 74 | + $db = wfGetDB( DB_MASTER ); |
72 | 75 | $start = $db->selectField( 'page', 'MIN(page_id)', false, __FUNCTION__ ); |
73 | 76 | $end = $db->selectField( 'page', 'MAX(page_id)', false, __FUNCTION__ ); |
74 | 77 | if( is_null( $start ) || is_null( $end ) ){ |