From 5a63ad05b50c69a5f292cad2352b4c2db6646789 Mon Sep 17 00:00:00 2001
From: "green-ponies (jgen)" <jgen.tech@gmail.com>
Date: Tue, 31 Jan 2012 00:35:20 -0500
Subject: [PATCH] Fix for installer failing with new DSN define.

---
 install.php | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/install.php b/install.php
index 78d85065..09da4d33 100755
--- a/install.php
+++ b/install.php
@@ -119,6 +119,7 @@ if(is_readable("config.php")) {
 	exit;
 }
 require_once "core/compat.inc.php";
+require_once "core/util.inc.php";
 require_once "core/database.class.php";
 
 do_install();
@@ -160,6 +161,7 @@ function do_install() { // {{{
 	if(isset($_POST['database_type']) && isset($_POST['database_host']) && isset($_POST['database_user']) && isset($_POST['database_name'])) {
 		global $database_dsn;
 		$database_dsn = "{$_POST['database_type']}:user={$_POST['database_user']};password={$_POST['database_password']};host={$_POST['database_host']};dbname={$_POST['database_name']}";
+		define('DATABASE_DSN', $database_dsn);
 		install_process();
 	}
 	else if(file_exists("auto_install.conf")) {
@@ -362,9 +364,10 @@ function build_dirs() { // {{{
 } // }}}
 function write_config() { // {{{
 	global $database_dsn;
-	$file_content = "<"+"?php\n"+
-	"define('DATABASE_DSN', '$database_dsn');\n"+
-	"?"+">";
+
+	$file_content = '<' . '?php' . "\n" .
+			"define('DATABASE_DSN', '$database_dsn');\n" .
+			'?' . '>';
 	
 	if(is_writable("./") && file_put_contents("config.php", $file_content)) {
 		assert(file_exists("config.php"));