Merge "Add passing ''italic'''s case to 'Unclosed and unmatched quotes' test"
[lhc/web/wiklou.git] / maintenance / rebuildtextindex.php
index 6c400bd..494e0a7 100644 (file)
@@ -28,6 +28,10 @@ require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 class RebuildTextIndex extends Maintenance {
        const RTI_CHUNK_SIZE = 500;
+
+       /**
+        * @var DatabaseBase
+        */
        private $db;
 
        public function __construct() {
@@ -50,11 +54,11 @@ class RebuildTextIndex extends Maintenance {
 
                $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 );
                        }
                }
 
@@ -108,7 +112,7 @@ class RebuildTextIndex extends Maintenance {
         */
        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__ );
@@ -137,4 +141,4 @@ class RebuildTextIndex extends Maintenance {
 }
 
 $maintClass = "RebuildTextIndex";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );