00001 <?php 00017 $optionsWithArgs = array( 's', 'e', 'p' ); 00018 00019 require_once( 'commandLine.inc' ); 00020 require_once( 'updateSearchIndex.inc' ); 00021 00022 if ( isset( $options['p'] ) ) { 00023 $posFile = $options['p']; 00024 } else { 00025 $posFile = 'searchUpdate.pos'; 00026 } 00027 00028 if ( isset( $options['e'] ) ) { 00029 $end = $options['e']; 00030 } else { 00031 $end = wfTimestampNow(); 00032 } 00033 00034 if ( isset( $options['s'] ) ) { 00035 $start = $options['s']; 00036 } else { 00037 $start = @file_get_contents( $posFile ); 00038 if ( !$start ) { 00039 $start = wfTimestamp( TS_MW, time() - 86400 ); 00040 } 00041 } 00042 00043 if ( isset( $options['l'] ) ) { 00044 $lockTime = $options['l']; 00045 } else { 00046 $lockTime = 20; 00047 } 00048 00049 $quiet = (bool)(@$options['q']); 00050 00051 updateSearchIndex( $start, $end, $lockTime, $quiet ); 00052 00053 $file = fopen( $posFile, 'w' ); 00054 fwrite( $file, $end ); 00055 fclose( $file ); 00056 00057