X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FSqliteInstaller.php;h=6e1a74f61be2f3dbe7676aed073ef85e90aa4241;hb=a9e9c0e3ffed0ab504e156bff7db1fbb04f615c5;hp=c942878d45ee2f4eb31d913eb09378d76ed33e48;hpb=9be60e572542e97afc3129df6a4453d22da97336;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index c942878d45..6e1a74f61b 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -2,6 +2,21 @@ /** * Sqlite-specific installer. * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * * @file * @ingroup Deployment */ @@ -13,6 +28,7 @@ * @since 1.17 */ class SqliteInstaller extends DatabaseInstaller { + const MINIMUM_VERSION = '3.3.7'; /** * @var DatabaseSqlite @@ -32,6 +48,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( @@ -102,7 +136,7 @@ class SqliteInstaller extends DatabaseInstaller { # if it's still writable if ( $create ) { wfSuppressWarnings(); - $ok = wfMkdirParents( $dir, 0700 ); + $ok = wfMkdirParents( $dir, 0700, __METHOD__ ); wfRestoreWarnings(); if ( !$ok ) { return Status::newFatal( 'config-sqlite-mkdir-error', $dir ); @@ -122,7 +156,7 @@ class SqliteInstaller extends DatabaseInstaller { /** * @return Status */ - public function openConnection( $dbName = null ) { + public function openConnection() { global $wgSQLiteDataDir; $status = Status::newGood(); @@ -188,7 +222,7 @@ class SqliteInstaller extends DatabaseInstaller { } /** - * @return Staus + * @return Status */ public function createTables() { $status = parent::createTables();