Remove unused parameter
[mediawiki.git] / maintenance / updateSearchIndex.php
blobf51617bb5fc099274f6dd4218e2fa4a49c0e3324
1 <?php
2 /**
3 * Script for periodic off-peak updating of the search index
5 * Usage: php updateSearchIndex.php [-s START] [-e END] [-p POSFILE] [-l LOCKTIME] [-q]
6 * Where START is the starting timestamp
7 * END is the ending timestamp
8 * POSFILE is a file to load timestamps from and save them to, searchUpdate.pos by default
9 * LOCKTIME is how long the searchindex and cur tables will be locked for
10 * -q means quiet
12 * @file
13 * @ingroup Maintenance
16 /** */
17 $optionsWithArgs = array( 's', 'e', 'p' );
19 require_once( 'commandLine.inc' );
20 require_once( 'updateSearchIndex.inc' );
22 if ( isset( $options['p'] ) ) {
23 $posFile = $options['p'];
24 } else {
25 $posFile = 'searchUpdate.pos';
28 if ( isset( $options['e'] ) ) {
29 $end = $options['e'];
30 } else {
31 $end = wfTimestampNow();
34 if ( isset( $options['s'] ) ) {
35 $start = $options['s'];
36 } else {
37 $start = @file_get_contents( $posFile );
38 if ( !$start ) {
39 $start = wfTimestamp( TS_MW, time() - 86400 );
43 if ( isset( $options['l'] ) ) {
44 $lockTime = $options['l'];
45 } else {
46 $lockTime = 20;
49 $quiet = (bool)(@$options['q']);
51 updateSearchIndex( $start, $end, $lockTime, $quiet );
53 $file = fopen( $posFile, 'w' );
54 fwrite( $file, $end );
55 fclose( $file );