Storing IP in RC. Off by default. Tested:
[lhc/web/wiklou.git] / maintenance / rebuildtextindex.php
index bbc5327..d99cea2 100644 (file)
@@ -1,6 +1,6 @@
-<?
-
-# Rebuild link tracking tables from scratch.  This takes several
+<?php
+define("MEDIAWIKI",true);
+# Rebuild search index table from scratch.  This takes several
 # hours, depending on the database size and server configuration.
 
 if ( ! is_readable( "../LocalSettings.php" ) ) {
@@ -9,12 +9,16 @@ if ( ! is_readable( "../LocalSettings.php" ) ) {
        exit();
 }
 
+$wgCommandLineMode = true;
 $DP = "../includes";
-include_once( "../LocalSettings.php" );
-include_once( "../AdminSettings.php" );
+require_once( "../LocalSettings.php" );
+require_once( "../AdminSettings.php" );
+
+$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
+ini_set( "include_path", "$IP$sep$include_path" );
 
-include_once( "{$IP}/Setup.php" );
-include_once( "./rebuildtextindex.inc" );
+require_once( "Setup.php" );
+require_once( "./rebuildtextindex.inc" );
 $wgTitle = Title::newFromText( "Rebuild text index script" );
 set_time_limit(0);