class RebuildTextIndex extends Maintenance {
const RTI_CHUNK_SIZE = 500;
+
+ /**
+ * @var DatabaseBase
+ */
private $db;
public function __construct() {
$this->db = wfGetDB( DB_MASTER );
if ( $this->db->getType() == 'sqlite' ) {
- if ( !$this->db->getFulltextSearchModule() ) {
- $this->error( "Your version of SQLite module for PHP doesn't support full-text search (FTS3).\n" );
+ if ( !DatabaseSqlite::getFulltextSearchModule() ) {
+ $this->error( "Your version of SQLite module for PHP doesn't support full-text search (FTS3).\n", true );
}
if ( !$this->db->checkForEnabledSearch() ) {
- $this->error( "Your database schema is not configured for full-text search support. Run update.php.\n" );
+ $this->error( "Your database schema is not configured for full-text search support. Run update.php.\n", true );
}
}
*/
private function dropMysqlTextIndex() {
$searchindex = $this->db->tableName( 'searchindex' );
- if ( $this->db->indexExists( 'searchindex', 'si_title' ) ) {
+ if ( $this->db->indexExists( 'searchindex', 'si_title', __METHOD__ ) ) {
$this->output( "Dropping index...\n" );
$sql = "ALTER TABLE $searchindex DROP INDEX si_title, DROP INDEX si_text";
$this->db->query( $sql, __METHOD__ );
}
$maintClass = "RebuildTextIndex";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );