From 7f3cc47e4d1fcdc866428b0d4689b045148d5ea8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 27 Nov 2006 18:27:25 +0000 Subject: [PATCH] * Fix regression when selecting mysql 4.0 schema in installer * Detect PHP parse errors in generated config and dump the file as a debugging aid, instead of silently corrupting the behavior of the installer --- config/index.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/config/index.php b/config/index.php index a99ba330d7..d9507cc4c8 100644 --- a/config/index.php +++ b/config/index.php @@ -534,7 +534,9 @@ print "
  • Environment check ## MySQL specific: $conf->DBprefix = importPost( "DBprefix" ); $conf->DBschema = importPost( "DBschema", "mysql4" ); - $conf->DBmysql5 = ($conf->DBschema == "mysql5" || $conf->DBschema == "mysql5-binary"); + $conf->DBmysql5 = ($conf->DBschema == "mysql5" || + $conf->DBschema == "mysql5-binary") + ? "true" : "false"; $conf->LanguageCode = importPost( "LanguageCode", "en" ); ## Postgres specific: @@ -615,12 +617,20 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $local = writeLocalSettings( $conf ); echo "
  • \n"; echo "

    Generating configuration file...

    \n"; - // for debugging: // echo "
    " . htmlspecialchars( $local ) . "
    \n"; echo "
  • \n"; $wgCommandLineMode = false; chdir( ".." ); - eval($local); + $ok = eval( $local ); + if( $ok === false ) { + dieout( "Errors in generated configuration; " . + "most likely due to a bug in the installer... " . + "Config file was: " . + "
    " .
    +				htmlspecialchars( $local ) .
    +				"
    " . + "" ); + } $conf->DBtypename = ''; foreach (array_keys($ourdb) as $db) { if ($conf->DBtype === $db) -- 2.20.1