Fix for r79874: only set $mRevIdFetched from fetchContent(), it was overriden by...
[lhc/web/wiklou.git] / includes / installer / SqliteInstaller.php
index 68fc6e3..9393d83 100644 (file)
@@ -5,15 +5,15 @@
  * @file
  * @ingroup Deployment
  */
+
 /**
  * Class for setting up the MediaWiki database using SQLLite.
- * 
+ *
  * @ingroup Deployment
  * @since 1.17
  */
 class SqliteInstaller extends DatabaseInstaller {
-       
+
        protected $globalNames = array(
                'wgDBname',
                'wgSQLiteDataDir',
@@ -41,10 +41,8 @@ class SqliteInstaller extends DatabaseInstaller {
        }
 
        public function getConnectForm() {
-               return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir' ) .
-                       $this->parent->getHelpBox( 'config-sqlite-dir-help' ) .
-                       $this->getTextBox( 'wgDBname', 'config-db-name' ) .
-                       $this->parent->getHelpBox( 'config-sqlite-name-help' );
+               return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir', array(), $this->parent->getHelpBox( 'config-sqlite-dir-help' ) ) .
+                       $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-sqlite-name-help' ) );
        }
 
        public function submitConnectForm() {
@@ -151,55 +149,28 @@ class SqliteInstaller extends DatabaseInstaller {
        }
 
        public function createTables() {
-               global $IP;
-               $status = $this->getConnection();
-               if ( !$status->isOK() ) {
-                       return $status;
-               }
-               // Process common MySQL/SQLite table definitions
-               $err = $this->db->sourceFile( "$IP/maintenance/tables.sql" );
-               if ( $err !== true ) {
-                       //@todo or...?
-                       $this->db->reportQueryError( $err, 0, $sql, __FUNCTION__ );
-               }
-               return $this->setupSearchIndex();
+               $status = parent::createTables();
+               return $this->setupSearchIndex( $status );
        }
 
-       public function setupSearchIndex() {
+       public function setupSearchIndex( &$status ) {
                global $IP;
 
-               $status = Status::newGood();
-
                $module = $this->db->getFulltextSearchModule();
                $fts3tTable = $this->db->checkForEnabledSearch();
                if ( $fts3tTable &&  !$module ) {
                        $status->warning( 'config-sqlite-fts3-downgrade' );
                        $this->db->sourceFile( "$IP/maintenance/sqlite/archives/searchindex-no-fts.sql" );
                } elseif ( !$fts3tTable && $module == 'FTS3' ) {
-                       $status->warning( 'config-sqlite-fts3-add' );
                        $this->db->sourceFile( "$IP/maintenance/sqlite/archives/searchindex-fts3.sql" );
                }
                return $status;
        }
 
-       public function doUpgrade() {
-               global $wgDatabase;
-               LBFactory::enableBackend();
-               $wgDatabase = wfGetDB( DB_MASTER );
-               ob_start( array( 'SqliteInstaller', 'outputHandler' ) );
-               do_all_updates( false, true );
-               ob_end_flush();
-               return true;
-       }
-
-       public static function outputHandler( $string ) {
-               return htmlspecialchars( $string );
-       }
-
        public function getLocalSettings() {
                $dir = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) );
                return
 "# SQLite-specific settings
 \$wgSQLiteDataDir    = \"{$dir}\";";
        }
-}
\ No newline at end of file
+}