Made rebuildtextindex.php bail out if search is not supported.
authorMax Semenik <maxsem@users.mediawiki.org>
Mon, 1 Nov 2010 20:14:46 +0000 (20:14 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Mon, 1 Nov 2010 20:14:46 +0000 (20:14 +0000)
RELEASE-NOTES
maintenance/rebuildtextindex.php

index 9872f06..7ee3394 100644 (file)
@@ -186,6 +186,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Use hreflang to specify canonical and alternate links, search engine friendly
   when a wiki has multiple variant languages.
 * (bug 19593) Specifying --server in now works for all maintenance scripts
+* Now rebuildtextindex.php warns if SQLite doesn't support full-text search.
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive
index 8673f9e..9717ebe 100644 (file)
@@ -48,9 +48,18 @@ 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 ( !$this->db->checkForEnabledSearch() ) {
+                               $this->error( "Your database schema is not configured for full-text search support. Run update.php.\n" );
+                       }
+               }
+               
                $wgTitle = Title::newFromText( "Rebuild text index script" );
        
-               if ( $wgDBtype == 'mysql' ) {
+               if ( $this->db->getType() == 'mysql' ) {
                        $this->dropMysqlTextIndex();
                        $this->populateSearchIndex();
                        $this->createMysqlTextIndex();