Index: trunk/phase3/maintenance/dumpTextPass.php |
— | — | @@ -286,8 +286,19 @@ |
287 | 287 | // we wrote some stuff after last checkpoint that needs renamed |
288 | 288 | if (file_exists($filenameList[0])) { |
289 | 289 | $newFilenames = array(); |
290 | | - $firstPageID = str_pad($this->firstPageWritten,9,"0",STR_PAD_LEFT); |
291 | | - $lastPageID = str_pad($this->lastPageWritten,9,"0",STR_PAD_LEFT); |
| 290 | + # we might have just written the header and footer and had no |
| 291 | + # pages or revisions written... perhaps they were all deleted |
| 292 | + # there's no pageID 0 so we use that. the caller is responsible |
| 293 | + # for deciding what to do with a file containing only the |
| 294 | + # siteinfo information and the mw tags. |
| 295 | + if (! $this->firstPageWritten) { |
| 296 | + $firstPageID = str_pad(0,9,"0",STR_PAD_LEFT); |
| 297 | + $lastPageID = str_pad(0,9,"0",STR_PAD_LEFT); |
| 298 | + } |
| 299 | + else { |
| 300 | + $firstPageID = str_pad($this->firstPageWritten,9,"0",STR_PAD_LEFT); |
| 301 | + $lastPageID = str_pad($this->lastPageWritten,9,"0",STR_PAD_LEFT); |
| 302 | + } |
292 | 303 | for ( $i = 0; $i < count( $filenameList ); $i++ ) { |
293 | 304 | $checkpointNameFilledIn = sprintf( $this->checkpointFiles[$i], $firstPageID, $lastPageID ); |
294 | 305 | $fileinfo = pathinfo($filenameList[$i]); |