(bug 11654) updateSearchIndex.php now uses a wiki-specific position file.
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 4 Jun 2009 01:10:06 +0000 (01:10 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 4 Jun 2009 01:10:06 +0000 (01:10 +0000)
maintenance/updateSearchIndex.php

index f51617b..571e65f 100644 (file)
@@ -22,7 +22,7 @@ require_once( 'updateSearchIndex.inc' );
 if ( isset( $options['p'] ) ) {
        $posFile = $options['p'];
 } else {
-       $posFile = 'searchUpdate.pos';
+       $posFile = 'searchUpdate.' . wfWikiId() . '.pos';
 }
 
 if ( isset( $options['e'] ) ) {
@@ -33,6 +33,11 @@ if ( isset( $options['e'] ) ) {
 
 if ( isset( $options['s'] ) ) {
        $start = $options['s'];
+elseif( is_readable( 'searchUpdate.pos' ) ) {
+       # B/c to the old position file name which was hardcoded
+       # We can safely delete the file when we're done though.
+       $start = file_get_contents( 'searchUpdate.pos' );
+       unlink( 'searchUpdate.pos' );
 } else {
        $start = @file_get_contents( $posFile );
        if ( !$start ) {