From 5b90115e04a55d074e6ba58fbe609378141e1fbd Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Mon, 1 Nov 2010 20:14:46 +0000 Subject: [PATCH] Made rebuildtextindex.php bail out if search is not supported. --- RELEASE-NOTES | 1 + maintenance/rebuildtextindex.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9872f06832..7ee3394c02 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index 8673f9e3f6..9717ebe21d 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -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(); -- 2.20.1