Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -295,13 +295,13 @@ |
296 | 296 | |
297 | 297 | MySQL is the recommended DBMS. PostgreSQL or SQLite can also be used, but |
298 | 298 | support for them is somewhat less mature. There is experimental support for IBM |
299 | | -DB2 and Microsoft SQL Server. |
| 299 | +DB2 and Oracle. |
300 | 300 | |
301 | 301 | The supported versions are: |
302 | 302 | |
303 | 303 | * MySQL 5.0.2 or later |
304 | 304 | * PostgreSQL 8.3 or later |
305 | | -* SQLite 3 |
| 305 | +* SQLite 3.3.7 or later |
306 | 306 | * Oracle 9.0.1 or later |
307 | 307 | |
308 | 308 | == Upgrading == |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -634,19 +634,32 @@ |
635 | 635 | $allNames[] = wfMsg( "config-type-$name" ); |
636 | 636 | } |
637 | 637 | |
638 | | - if ( !$this->getVar( '_CompiledDBs' ) ) { |
| 638 | + // cache initially available databases to make sure that everything will be displayed correctly |
| 639 | + // after a refresh on env checks page |
| 640 | + $databases = $this->getVar( '_CompiledDBs-preFilter' ); |
| 641 | + if ( !$databases ) { |
| 642 | + $databases = $this->getVar( '_CompiledDBs' ); |
| 643 | + $this->setVar( '_CompiledDBs-preFilter', $databases ); |
| 644 | + } |
| 645 | + |
| 646 | + $databases = array_flip ( $databases ); |
| 647 | + foreach ( array_keys( $databases ) as $db ) { |
| 648 | + $installer = $this->getDBInstaller( $db ); |
| 649 | + $status = $installer->checkPrerequisites(); |
| 650 | + if ( !$status->isGood() ) { |
| 651 | + $this->showStatusMessage( $status ); |
| 652 | + } |
| 653 | + if ( !$status->isOK() ) { |
| 654 | + unset( $databases[$db] ); |
| 655 | + } |
| 656 | + } |
| 657 | + $databases = array_flip( $databases ); |
| 658 | + if ( !$databases ) { |
639 | 659 | $this->showError( 'config-no-db', $wgLang->commaList( $allNames ) ); |
640 | 660 | // @todo FIXME: This only works for the web installer! |
641 | 661 | return false; |
642 | 662 | } |
643 | | - |
644 | | - // Check for FTS3 full-text search module |
645 | | - $sqlite = $this->getDBInstaller( 'sqlite' ); |
646 | | - if ( $sqlite->isCompiled() ) { |
647 | | - if( DatabaseSqlite::getFulltextSearchModule() != 'FTS3' ) { |
648 | | - $this->showMessage( 'config-no-fts3' ); |
649 | | - } |
650 | | - } |
| 663 | + $this->setVar( '_CompiledDBs', $databases ); |
651 | 664 | } |
652 | 665 | |
653 | 666 | /** |
Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -103,6 +103,7 @@ |
104 | 104 | If you are on shared hosting, ask your hosting provider to install a suitable database driver. |
105 | 105 | If you compiled PHP yourself, reconfigure it with a database client enabled, for example using <code>./configure --with-mysql</code>. |
106 | 106 | If you installed PHP from a Debian or Ubuntu package, then you also need install the php5-mysql module.', |
| 107 | + 'config-outdated-sqlite' => "'''Warning''': you have SQLite $1, which is lower than minimum required version $2. SQLite will be unavailable.", |
107 | 108 | 'config-no-fts3' => "'''Warning''': SQLite is compiled without the [//sqlite.org/fts3.html FTS3 module], search features will be unavailable on this backend.", |
108 | 109 | 'config-register-globals' => "'''Warning: PHP's <code>[http://php.net/register_globals register_globals]</code> option is enabled.''' |
109 | 110 | '''Disable it if you can.''' |
Index: trunk/phase3/includes/installer/SqliteInstaller.php |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
16 | 16 | class SqliteInstaller extends DatabaseInstaller { |
| 17 | + const MINIMUM_VERSION = '3.3.7'; |
17 | 18 | |
18 | 19 | /** |
19 | 20 | * @var DatabaseSqlite |
— | — | @@ -32,6 +33,24 @@ |
33 | 34 | return self::checkExtension( 'pdo_sqlite' ); |
34 | 35 | } |
35 | 36 | |
| 37 | + /** |
| 38 | + * |
| 39 | + * @return Status: |
| 40 | + */ |
| 41 | + public function checkPrerequisites() { |
| 42 | + $result = Status::newGood(); |
| 43 | + // Bail out if SQLite is too old |
| 44 | + $db = new DatabaseSqliteStandalone( ':memory:' ); |
| 45 | + if ( version_compare( $db->getServerVersion(), self::MINIMUM_VERSION, '<' ) ) { |
| 46 | + $result->fatal( 'config-outdated-sqlite', $db->getServerVersion(), self::MINIMUM_VERSION ); |
| 47 | + } |
| 48 | + // Check for FTS3 full-text search module |
| 49 | + if( DatabaseSqlite::getFulltextSearchModule() != 'FTS3' ) { |
| 50 | + $result->warning( 'config-no-fts3' ); |
| 51 | + } |
| 52 | + return $result; |
| 53 | + } |
| 54 | + |
36 | 55 | public function getGlobalDefaults() { |
37 | 56 | if ( isset( $_SERVER['DOCUMENT_ROOT'] ) ) { |
38 | 57 | $path = str_replace( |
Index: trunk/phase3/includes/installer/DatabaseInstaller.php |
— | — | @@ -55,6 +55,15 @@ |
56 | 56 | public abstract function isCompiled(); |
57 | 57 | |
58 | 58 | /** |
| 59 | + * Checks for installation prerequisites other than those checked by isCompiled() |
| 60 | + * @since 1.19 |
| 61 | + * @return Status |
| 62 | + */ |
| 63 | + public function checkPrerequisites() { |
| 64 | + return Status::newGood(); |
| 65 | + } |
| 66 | + |
| 67 | + /** |
59 | 68 | * Get HTML for a web form that configures this database. Configuration |
60 | 69 | * at this time should be the minimum needed to connect and test |
61 | 70 | * whether install or upgrade is required. |