Made installer not install on SQLite less than 3.3.7, would prevent stuff like bug 25746. Also, threw MSSQL out of release notes - it can't be installed through the usual means.

This commit is contained in:
Max Semenik 2012-01-04 10:41:39 +00:00
parent f2503ff12c
commit 16b811c803
5 changed files with 53 additions and 11 deletions

View file

@ -295,13 +295,13 @@ MediaWiki 1.19 requires PHP 5.2.3. PHP 4 is no longer supported.
MySQL is the recommended DBMS. PostgreSQL or SQLite can also be used, but
support for them is somewhat less mature. There is experimental support for IBM
DB2 and Microsoft SQL Server.
DB2 and Oracle.
The supported versions are:
* MySQL 5.0.2 or later
* PostgreSQL 8.3 or later
* SQLite 3
* SQLite 3.3.7 or later
* Oracle 9.0.1 or later
== Upgrading ==

View file

@ -54,6 +54,15 @@ abstract class DatabaseInstaller {
*/
public abstract function isCompiled();
/**
* Checks for installation prerequisites other than those checked by isCompiled()
* @since 1.19
* @return Status
*/
public function checkPrerequisites() {
return Status::newGood();
}
/**
* Get HTML for a web form that configures this database. Configuration
* at this time should be the minimum needed to connect and test

View file

@ -103,6 +103,7 @@ The following database types are supported: $1.
If you are on shared hosting, ask your hosting provider to install a suitable database driver.
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-outdated-sqlite' => "'''Warning''': you have SQLite $1, which is lower than minimum required version $2. SQLite will be unavailable.",
'config-no-fts3' => "'''Warning''': SQLite is compiled without the [//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.'''

View file

@ -634,19 +634,32 @@ abstract class Installer {
$allNames[] = wfMsg( "config-type-$name" );
}
if ( !$this->getVar( '_CompiledDBs' ) ) {
// cache initially available databases to make sure that everything will be displayed correctly
// after a refresh on env checks page
$databases = $this->getVar( '_CompiledDBs-preFilter' );
if ( !$databases ) {
$databases = $this->getVar( '_CompiledDBs' );
$this->setVar( '_CompiledDBs-preFilter', $databases );
}
$databases = array_flip ( $databases );
foreach ( array_keys( $databases ) as $db ) {
$installer = $this->getDBInstaller( $db );
$status = $installer->checkPrerequisites();
if ( !$status->isGood() ) {
$this->showStatusMessage( $status );
}
if ( !$status->isOK() ) {
unset( $databases[$db] );
}
}
$databases = array_flip( $databases );
if ( !$databases ) {
$this->showError( 'config-no-db', $wgLang->commaList( $allNames ) );
// @todo FIXME: This only works for the web installer!
return false;
}
// Check for FTS3 full-text search module
$sqlite = $this->getDBInstaller( 'sqlite' );
if ( $sqlite->isCompiled() ) {
if( DatabaseSqlite::getFulltextSearchModule() != 'FTS3' ) {
$this->showMessage( 'config-no-fts3' );
}
}
$this->setVar( '_CompiledDBs', $databases );
}
/**

View file

@ -13,6 +13,7 @@
* @since 1.17
*/
class SqliteInstaller extends DatabaseInstaller {
const MINIMUM_VERSION = '3.3.7';
/**
* @var DatabaseSqlite
@ -32,6 +33,24 @@ class SqliteInstaller extends DatabaseInstaller {
return self::checkExtension( 'pdo_sqlite' );
}
/**
*
* @return Status:
*/
public function checkPrerequisites() {
$result = Status::newGood();
// Bail out if SQLite is too old
$db = new DatabaseSqliteStandalone( ':memory:' );
if ( version_compare( $db->getServerVersion(), self::MINIMUM_VERSION, '<' ) ) {
$result->fatal( 'config-outdated-sqlite', $db->getServerVersion(), self::MINIMUM_VERSION );
}
// Check for FTS3 full-text search module
if( DatabaseSqlite::getFulltextSearchModule() != 'FTS3' ) {
$result->warning( 'config-no-fts3' );
}
return $result;
}
public function getGlobalDefaults() {
if ( isset( $_SERVER['DOCUMENT_ROOT'] ) ) {
$path = str_replace(