Installer: added an environment check for SQLite search capabilities
authorMax Semenik <maxsem@users.mediawiki.org>
Fri, 1 Oct 2010 21:06:32 +0000 (21:06 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Fri, 1 Oct 2010 21:06:32 +0000 (21:06 +0000)
includes/installer/Installer.i18n.php
includes/installer/Installer.php

index e3d7811..bd9b6bc 100644 (file)
@@ -96,6 +96,8 @@ If you are on shared hosting, ask your hosting provider to install a suitable da
 If you compiled PHP yourself, reconfigure it with a database client enabled, for example using <code>./configure --with-mysql</code>.
 If you installed PHP from a Debian or Ubuntu package, then you also need install the php5-mysql module.',
        'config-have-db'                  => 'Found database {{PLURAL:$2|driver|drivers}}: $1.',
+       'config-have-fts3'                => 'SQLite is compiled with the [http://sqlite.org/fts3.html FTS3] module, search features will be available on this backend.',
+       'config-no-fts3'                  => "'''Warning''': SQLite is compiled without the [http://sqlite.org/fts3.html FTS3] module, search features will be unavailable on this backend.",
        'config-register-globals'         => "'''Warning: PHP's <code>[http://php.net/register_globals register_globals]</code> option is enabled.'''
 '''Disable it if you can.'''
 MediaWiki will work, but your server is exposed to potential security vulnerabilities.",
index 91b5956..c296cfe 100644 (file)
@@ -443,6 +443,16 @@ abstract class Installer {
                }
 
                $this->showMessage( 'config-have-db', $wgLang->listToText( $goodNames ), count( $goodNames ) );
+
+               // Check for FTS3 full-text search module
+               $sqlite = $this->getDBInstaller( $name );
+               if ( $sqlite->isCompiled() ) {
+                       $db = new DatabaseSqliteStandalone( ':memory:' );
+                       $this->showMessage( $db->getFulltextSearchModule() == 'FTS3'
+                               ? 'config-have-fts3'
+                               : 'config-no-fts3'
+                       );
+               }
        }
 
        /**