From 00f94e8867b5203b584e23ae0a579e30dc8a8ac8 Mon Sep 17 00:00:00 2001 From: sminnee Date: Wed, 27 Aug 2008 10:52:53 +0000 Subject: [PATCH] Installer will now detect if you have an _ss_environment.php, and if so, use conf/ConfigureFromEnv.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@61633 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- install.php | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/install.php b/install.php index 9ae157a..8e8a7d8 100644 --- a/install.php +++ b/install.php @@ -10,10 +10,12 @@ ini_set('max_execution_time', 300); session_start(); // Include environment files +$usingEnv = false; $envFiles = array('_ss_environment.php', '../_ss_environment.php', '../../_ss_environment.php'); foreach($envFiles as $envFile) { if(@file_exists($envFile)) { include($envFile); + $usingEnv = true; break; } } @@ -624,13 +626,39 @@ SSViewer::set_theme('blackcandy'); PHP; } - echo "
  • Creating '$template/_config.php'...
  • "; - flush(); - $devServers = $this->var_export_array_nokeys(explode("\n", $_POST['devsites'])); + global $usingEnv; + if($usingEnv) { + echo "
  • Creating '$template/_config.php' for use with _ss_environment.php...
  • \n"; + flush(); + $this->createFile("$template/_config.php", << +PHP + ); + + + } else { + echo "
  • Creating '$template/_config.php'...
  • \n"; + flush(); - $escapedPassword = addslashes($config['mysql']['password']); - $this->createFile("$template/_config.php", <<var_export_array_nokeys(explode("\n", $_POST['devsites'])); + + $escapedPassword = addslashes($config['mysql']['password']); + $this->createFile("$template/_config.php", << PHP - ); + ); + } echo "
  • Creating '.htaccess' file...
  • "; flush();