mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
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:
parent
7739d6315b
commit
1b2b09a458
@ -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;
|
||||
|
@ -128,6 +128,22 @@
|
||||
|
||||
<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
|
||||
$req->showTable();
|
||||
|
23
install.php
23
install.php
@ -534,6 +534,8 @@ PHP;
|
||||
echo "<li>Creating '$template/_config.php'...</li>";
|
||||
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
|
||||
|
||||
@ -830,6 +829,16 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user