Index: trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc |
— | — | @@ -1,7 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -define( 'BATCH_SIZE', 50 ); |
5 | | - |
6 | 4 | function autoreview_current( $user, $db ) { |
7 | 5 | global $wgFlaggedRevsNamespaces; |
8 | 6 | echo "Auto-reviewing all current page versions...\n"; |
— | — | @@ -9,6 +7,7 @@ |
10 | 8 | echo( "Invalid user specified!" ); |
11 | 9 | exit(0); |
12 | 10 | } |
| 11 | + $BATCH_SIZE = 50; |
13 | 12 | $start = $db->selectField( 'page', 'MIN(page_id)', false, __FUNCTION__ ); |
14 | 13 | $end = $db->selectField( 'page', 'MAX(page_id)', false, __FUNCTION__ ); |
15 | 14 | if( is_null( $start ) || is_null( $end ) ){ |
— | — | @@ -16,9 +15,9 @@ |
17 | 16 | return; |
18 | 17 | } |
19 | 18 | # Do remaining chunk |
20 | | - $end += BATCH_SIZE - 1; |
| 19 | + $end += $BATCH_SIZE - 1; |
21 | 20 | $blockStart = $start; |
22 | | - $blockEnd = $start + BATCH_SIZE - 1; |
| 21 | + $blockEnd = $start + $BATCH_SIZE - 1; |
23 | 22 | $count = 0; |
24 | 23 | $changed = 0; |
25 | 24 | while( $blockEnd <= $end ) { |
— | — | @@ -48,8 +47,8 @@ |
49 | 48 | $count++; |
50 | 49 | } |
51 | 50 | $db->freeResult( $res ); |
52 | | - $blockStart += BATCH_SIZE - 1; |
53 | | - $blockEnd += BATCH_SIZE - 1; |
| 51 | + $blockStart += $BATCH_SIZE - 1; |
| 52 | + $blockEnd += $BATCH_SIZE - 1; |
54 | 53 | wfWaitForSlaves( 5 ); |
55 | 54 | } |
56 | 55 | echo "Auto-reviewing of all pages complete ... {$count} rows [{$changed} changed]\n"; |