* Make parsertests work with interwiki table on sqlite
authorMark A. Hershberger <mah@users.mediawiki.org>
Fri, 30 Jul 2010 20:17:28 +0000 (20:17 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Fri, 30 Jul 2010 20:17:28 +0000 (20:17 +0000)
* re r69542 temporary fix for new-installer + interwiki table
* temporary fix for outputing LocalSettings.php in the CliInstaller

includes/installer/CliInstaller.php
includes/installer/DatabaseInstaller.php
maintenance/parserTests.inc

index 56602b5..9b356d8 100644 (file)
@@ -2,12 +2,12 @@
 
 /**
  * Class for the core installer command line interface.
- * 
+ *
  * @ingroup Deployment
  * @since 1.17
  */
 class CliInstaller extends CoreInstaller {
-       
+
        private $optionMap = array(
                'dbtype' => 'wgDBtype',
                'dbserver' => 'wgDBserver',
@@ -78,6 +78,9 @@ class CliInstaller extends CoreInstaller {
                        array( $this, 'startStage' ),
                        array( $this, 'endStage' )
                );
+
+               $ls = new LocalSettingsGenerator( $this );
+               file_put_contents( "LocalSettings.php", $ls->getText() );
        }
 
        public function startStage( $step ) {
index 456e8e5..7342fa2 100644 (file)
@@ -398,8 +398,9 @@ abstract class DatabaseInstaller {
                foreach( $rows as $row ) {
                        $row = preg_replace( '/^\s*([^#]*?)\s*(#.*)?$/', '\\1', $row ); // strip comments - whee
                        if ( $row == "" ) continue;
+                       $row .= "||";
                        $interwikis[] = array_combine(
-                               array( 'iw_prefix', 'iw_url', 'iw_local' ),
+                               array( 'iw_prefix', 'iw_url', 'iw_local', 'iw_api', 'iw_wikiid' ),
                                explode( '|', $row )
                        );
                }
index 3c315ed..e1d5d86 100644 (file)
@@ -673,21 +673,33 @@ class ParserTest {
                $db->insert( 'interwiki', array(
                        array( 'iw_prefix' => 'wikipedia',
                                   'iw_url'    => 'http://en.wikipedia.org/wiki/$1',
+                                  'iw_api'    => '',
+                                  'iw_wikiid' => '',
                                   'iw_local'  => 0 ),
                        array( 'iw_prefix' => 'meatball',
                                   'iw_url'    => 'http://www.usemod.com/cgi-bin/mb.pl?$1',
+                                  'iw_api'    => '',
+                                  'iw_wikiid' => '',
                                   'iw_local'  => 0 ),
                        array( 'iw_prefix' => 'zh',
                                   'iw_url'    => 'http://zh.wikipedia.org/wiki/$1',
+                                  'iw_api'    => '',
+                                  'iw_wikiid' => '',
                                   'iw_local'  => 1 ),
                        array( 'iw_prefix' => 'es',
                                   'iw_url'    => 'http://es.wikipedia.org/wiki/$1',
+                                  'iw_api'    => '',
+                                  'iw_wikiid' => '',
                                   'iw_local'  => 1 ),
                        array( 'iw_prefix' => 'fr',
                                   'iw_url'    => 'http://fr.wikipedia.org/wiki/$1',
+                                  'iw_api'    => '',
+                                  'iw_wikiid' => '',
                                   'iw_local'  => 1 ),
                        array( 'iw_prefix' => 'ru',
                                   'iw_url'    => 'http://ru.wikipedia.org/wiki/$1',
+                                  'iw_api'    => '',
+                                  'iw_wikiid' => '',
                                   'iw_local'  => 1 ),
                        ) );