summaryrefslogtreecommitdiff
path: root/maintenance/updateSearchIndex.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/updateSearchIndex.php')
-rw-r--r--maintenance/updateSearchIndex.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/maintenance/updateSearchIndex.php b/maintenance/updateSearchIndex.php
index 97863101..eed3571c 100644
--- a/maintenance/updateSearchIndex.php
+++ b/maintenance/updateSearchIndex.php
@@ -55,11 +55,10 @@ class UpdateSearchIndex extends Maintenance {
# We can safely delete the file when we're done though.
$start = file_get_contents( 'searchUpdate.pos' );
unlink( 'searchUpdate.pos' );
+ } elseif( is_readable( $posFile ) ) {
+ $start = file_get_contents( $posFile );
} else {
- $start = @file_get_contents( $posFile );
- if ( !$start ) {
- $start = wfTimestamp( TS_MW, time() - 86400 );
- }
+ $start = wfTimestamp( TS_MW, time() - 86400 );
}
$lockTime = $this->getOption( 'l', 20 );
@@ -70,10 +69,10 @@ class UpdateSearchIndex extends Maintenance {
fwrite( $file, $end );
fclose( $file );
} else {
- $this->output( "*** Couldn't write to the $posFile!\n" );
+ $this->error( "*** Couldn't write to the $posFile!\n" );
}
} else {
- $this->output( "*** Couldn't write to the $posFile!\n" );
+ $this->error( "*** Couldn't write to the $posFile!\n" );
}
}