Postgres uses TIMESTAMPTZ not DATETIME.
[lhc/web/wiklou.git] / maintenance / updateSearchIndex.php
index eede109..eed3571 100644 (file)
@@ -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" );
                }
        }
 
@@ -119,4 +118,4 @@ class UpdateSearchIndex extends Maintenance {
 }
 
 $maintClass = "UpdateSearchIndex";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );