Index: trunk/extensions/TitleKey/rebuildTitleKeys.php |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | function __construct() { |
17 | 17 | parent::__construct(); |
18 | 18 | $this->mDescription = "Rebuilds titlekey table entries for all pages in DB."; |
| 19 | + $this->mBatchSize = 1000; |
19 | 20 | $this->addOption( 'start', 'Page ID to start from', false, true ); |
20 | 21 | } |
21 | 22 | |
— | — | @@ -24,10 +25,9 @@ |
25 | 26 | $dbr = $this->getDB( DB_SLAVE ); |
26 | 27 | |
27 | 28 | $maxId = $dbr->selectField( 'page', 'MAX(page_id)', '', __METHOD__ ); |
28 | | - $chunkSize = 1000; |
29 | 29 | |
30 | 30 | $lastId = 0; |
31 | | - for( ; $start <= $maxId; $start += $chunkSize ) { |
| 31 | + for( ; $start <= $maxId; $start += $this->mBatchSize ) { |
32 | 32 | if( $start != 0 ) { |
33 | 33 | $this->output( "... $start...\n" ); |
34 | 34 | } |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | __METHOD__, |
39 | 39 | array( |
40 | 40 | 'ORDER BY' => 'page_id', |
41 | | - 'LIMIT' => $chunkSize ) ); |
| 41 | + 'LIMIT' => $this->mBatchSize ) ); |
42 | 42 | |
43 | 43 | $titles = array(); |
44 | 44 | foreach( $result as $row ) { |
— | — | @@ -60,4 +60,4 @@ |
61 | 61 | } |
62 | 62 | |
63 | 63 | $maintClass = 'RebuildTitleKeys'; |
64 | | -require_once( DO_MAINTENANCE ); |
| 64 | +require_once( RUN_MAINTENANCE_IF_MAIN ); |