ALlow user to add custom dev servers in installer

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@41574 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
aoneil 2007-09-11 23:38:44 +00:00
parent 7739d6315b
commit 1b2b09a458
3 changed files with 39 additions and 12 deletions

View File

@ -95,11 +95,13 @@ table.testResults {
clear: both;
}
p.mysql,
p.adminAcc {
p.adminAcc,
p.devHelp {
padding-top: 20px;
}
p#mysql_credentials,
p#AdminAccount {
p#AdminAccount,
p#DevSites {
width: 330px;
margin-top: 0;
float: left;

View File

@ -126,7 +126,23 @@
rather log-in with a username instead of an email address, enter that instead.
</p>
<br />
<br />
<h4>Development Servers</h4>
<p id="DevSites">
<label for="devsites">Development servers:</label>
<span class="middleColumn"><textarea name="devsites" id="devsites" rows="5" />localhost
127.0.0.1</textarea></span>
</p>
<p class="devHelp">
SilverStripe allows you to run a site in <a href="http://doc.silverstripe.com/doku.php?id=devmode">development mode</a>.
This shows all error messages in the web browser instead of emailing them to the administrator, and allows
the database to be built without logging in as administrator. Please enter the host/domain names for servers
you will be using for development.
</p>
<br />
<h4 id="requirements">Requirements</h4>
<?php

View File

@ -532,7 +532,9 @@ PHP;
}
echo "<li>Creating '$template/_config.php'...</li>";
flush();
flush();
$devServers = $this->var_export_array_nokeys(explode("\n", $_POST['devsites']));
$this->createFile("$template/_config.php", <<<PHP
<?
@ -551,14 +553,11 @@ global \$databaseConfig;
"database" => "{$config['mysql']['database']}",
);
// By default, sites running on localhost or hosts
// beginning with 'dev' are set to dev mode. For
// a description of what dev mode does, see
// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.com/doku.php?id=devmode
// You can set your site to dev mode by uncommenting
// the line below:
//Director::set_environment_type('dev');
// for a description of what dev mode does.
Director::set_dev_servers($devServers);
$theme
@ -829,7 +828,17 @@ TEXT
return false;
}
function var_export_array_nokeys($array) {
$retval = "array(\n";
foreach($array as $item) {
$retval .= "\t'";
$retval .= trim($item);
$retval .= "',\n";
}
$retval .= ")";
return $retval;
}
}
/**