BUGFIX: Removed tutorial folder and moved html to its own theme. Now all code can be written in mysite. Edited installer to just switch SSViewer::set_theme(). BUGFIX: Fixed installer on trunk - now includes proper classs

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@65323 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
wrossiter 2008-11-05 23:01:15 +00:00
parent 49b11d2ae4
commit 744fa262c0
20 changed files with 107 additions and 129 deletions

View File

@ -10,61 +10,61 @@
document.getElementById(id).style.display = 'none';
}
</script>
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/layout.css" />
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/typography.css" />
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/form.css" />
<link rel="stylesheet" type="text/css" href="config-form.css" />
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/layout.css" />
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/typography.css" />
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/form.css" />
<link rel="stylesheet" type="text/css" href="config-form.css" />
<link rel="shortcut icon" href="favicon.ico" />
</head>
<body>
<div id="BgContainer">
<div id="Container">
<div id="BgContainer">
<div id="Container">
<div id="Header">
<h1>SilverStripe CMS Installation</h1>
<p>Version <?php echo $silverstripe_version; ?></p>
</div>
<div id="Navigation">&nbsp;</div>
<div class="clear"><!-- --></div>
<div id="Layout">
<h1>SilverStripe CMS Installation</h1>
<p>Version <?php echo $silverstripe_version; ?></p>
</div>
<div id="Navigation">&nbsp;</div>
<div class="clear"><!-- --></div>
<div id="Layout">
<div class="typography">
<h1>Welcome to SilverStripe</h1>
<p>Thanks for choosing to use SilverStripe! Please follow the instructions below to get SilverStripe installed.</p>
<form action="install.php" method="post">
<?php if(isset($hasErrorOtherThanDatabase)) { ?>
<p class="error">
You aren't currently able to install the software. Please <a href="#requirements">see below</a> for details.<br />
If you are having problems meeting the requirements, see the <a href="http://doc.silverstripe.com/doku.php?id=server-requirements">server requirements wiki page</a>.
<p class="error">
You aren't currently able to install the software. Please <a href="#requirements">see below</a> for details.<br />
If you are having problems meeting the requirements, see the <a href="http://doc.silverstripe.com/doku.php?id=server-requirements">server requirements wiki page</a>.
</p>
<?php } else { ?>
<?php if($req->hasWarnings()) { ?>
<p class="warning">
There are some issues that we recommend you look at before installing, however, you are still able to install the software.
Please see below for details.<br />
If you are having problems meeting the requirements, see the <a href="http://doc.silverstripe.com/doku.php?id=server-requirements">server requirements wiki page</a>.
<p class="warning">
There are some issues that we recommend you look at before installing, however, you are still able to install the software.
Please see below for details.<br />
If you are having problems meeting the requirements, see the <a href="http://doc.silverstripe.com/doku.php?id=server-requirements">server requirements wiki page</a>.
</p>
<?php } else if(!$dbReq->hasErrors()) { ?>
<p class="good">
<p class="good">
You're ready to install! &nbsp;&nbsp;
</p>
<?php } ?>
<p>
<b>Template to install:</b>
</p>
</p>
<?php } ?>
<p>
<b>Template to install:</b>
</p>
<ul id="Themes">
<li><input type="radio" name="template" value="default" id="BlackCandy" checked="checked" /><label for="BlackCandy">BlackCandy, default template ready to use.</label></li>
<li><input type="radio" name="template" value="tutorial" id="EmptyTemplate" /><label for="EmptyTemplate">Empty template, ready to begin the tutorial.</label></li>
</ul>
<p>You can change the template or download another from the SilverStripe website after installation.</p>
<li><input type="radio" name="template" value="blackcandy" id="BlackCandy" checked="checked" /><label for="BlackCandy">BlackCandy, default template ready to use.</label></li>
<li><input type="radio" name="template" value="tutorial" id="EmptyTemplate" /><label for="EmptyTemplate">Empty template, ready to begin the tutorial.</label></li>
</ul>
<p>You can change the template or download another from the SilverStripe website after installation.</p>
<input type="checkbox" id="stats" name="stats" checked="checked"><label for="stats">Send information on my webserver to SilverStripe (this is only version information, used for statistical purposes)</label><br />
<input type="checkbox" id="stats" name="stats" checked="checked"><label for="stats">Send information on my webserver to SilverStripe (this is only version information, used for statistical purposes)</label><br />
<?php if($alreadyInstalled) { ?>
<p class="warning">
<p class="warning">
<strong>Note:</strong> It seems as though SilverStripe is already installed here. If you ask me to install, I will overwrite
the <strong>.htaccess</strong> and <strong>mysite/_config.php</strong> files.
<br />
@ -90,23 +90,23 @@
<input type="hidden" name="database" value="MySQLDatabase" />
<h4>MySQL Database</h4>
<?php if($dbReq->hasErrors()) { ?>
<p class="error"><!-- class="error" -->
These database details don't appear to be correct. Please enter the correct details before installing.
<p class="error"><!-- class="error" -->
These database details don't appear to be correct. Please enter the correct details before installing.
</p>
<?php } else { ?>
<p class="good">
These database details look all good!
<p class="good">
These database details look all good!
</p>
<?php } ?>
<p id="mysql_credentials">
<label for="mysql_server">MySQL server:</label>
<label for="mysql_server">MySQL server:</label>
<span class="middleColumn"><input id="mysql_server" class="text" type="text" name="mysql[server]" value="<?php echo $databaseConfig['server']; ?>" /></span>
<label for="mysql_username">MySQL username:</label>
<span class="middleColumn"><input id="mysql_username" class="text" type="text" name="mysql[username]" value="<?php echo $databaseConfig['username']; ?>" /></span>
<label for="mysql_password">MySQL password:</label>
<label for="mysql_username">MySQL username:</label>
<span class="middleColumn"><input id="mysql_username" class="text" type="text" name="mysql[username]" value="<?php echo $databaseConfig['username']; ?>" /></span>
<label for="mysql_password">MySQL password:</label>
<span class="middleColumn"><input id="mysql_password" class="text" type="password" name="mysql[password]" value="<?php echo $databaseConfig['password']; ?>" /></span>
<label for="mysql_database">MySQL database:</label>
<label for="mysql_database">MySQL database:</label>
<span class="middleColumn"><input id="mysql_database" class="text" type="text" name="mysql[database]" value="<?php echo $databaseConfig['database']; ?>" onchange="this.value = this.value.replace(/[^A-Za-z0-9_]+/g,'');" /></span>
<input type="submit" class="action" value="Re-check requirements" />
</p>
@ -120,9 +120,9 @@
<h4>SilverStripe Administration Account</h4>
<p id="AdminAccount">
<label for="admin_username">Administrator email:</label>
<label for="admin_username">Administrator email:</label>
<span class="middleColumn"><input type="text" class="text" name="admin[username]" id="admin_username" value="<?php echo $adminConfig['username']; ?>" /></span>
<label for="admin_password">Administrator password:</label>
<label for="admin_password">Administrator password:</label>
<span class="middleColumn"><input type="text" class="text" name="admin[password]" id="admin_password" value="<?php echo $adminConfig['password']; ?>" /></span>
<label for="admin_firstname">Administrator first name:</label>
<span class="middleColumn"><input type="text" class="text" name="admin[firstname]" id="admin_firstname" value="<?php echo $adminConfig['firstname']; ?>" /></span>
@ -134,22 +134,22 @@
rather log-in with a username instead of an email address, enter that instead.
</p>
<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 />
<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>
@ -157,17 +157,17 @@
$req->showTable();
?>
</form>
</div>
</div>
</form>
</div>
</div>
<div class="clear"><!-- --></div>
</div>
<div id="Footer">
<div class="footerTop"><!-- --></div>
<p>Copyright &copy; 2007 | Powered by <a href="http://www.silverstripe.com">SilverStripe Open Source CMS</a></p>
</div>
</div>
<div id="Footer">
<div class="footerTop"><!-- --></div>
<p>Copyright &copy; 2007 | Powered by <a href="http://www.silverstripe.com">SilverStripe Open Source CMS</a></p>
</div>
</div>
</body>
</html>
</html>

View File

@ -151,7 +151,6 @@ class InstallRequirements {
$this->requireFile('jsparty', array("File permissions", "jsparty/ folder exists", "There's no jsparty folder."));
$this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null));
$this->requireWriteable('mysite', array("File permissions", "Is the mysite/ folder writeable?", null));
if(file_exists('tutorial')) $this->requireWriteable('tutorial', array("File permissions", "Is the tutorial/ folder writeable?", null));
$this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null));
$this->requireTempFolder(array('File permissions', 'Is the temporary folder writeable?', null));
@ -607,45 +606,29 @@ class Installer extends InstallRequirements {
@$_SESSION['StatsID'] = file_get_contents($url);
}
// Delete old _config.php files
if(file_exists('tutorial/_config.php')) {
unlink('tutorial/_config.php');
}
if(file_exists('mysite/_config.php')) {
unlink('mysite/_config.php');
}
$theme = $_POST['template'];
// Write the config file
$template = $_POST['template'] == 'tutorial' ? 'tutorial' : 'mysite';
$theme = '';
if($_POST['template'] != 'tutorial') {
$theme = <<<PHP
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.com/cms-themes-and-skin
SSViewer::set_theme('blackcandy');
PHP;
}
global $usingEnv;
if($usingEnv) {
echo "<li>Creating '$template/_config.php' for use with _ss_environment.php...</li>\n";
echo "<li>Creating 'mysite/_config.php' for use with _ss_environment.php...</li>\n";
flush();
$this->createFile("$template/_config.php", <<<PHP
$this->createFile("mysite/_config.php", <<<PHP
<?php
global \$project;
\$project = '$template';
\$project = 'mysite';
global \$database;
\$database = "{$config['mysql']['database']}";
require_once("conf/ConfigureFromEnv.php");
$theme
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.com/cms-themes-and-skin
SSViewer::set_theme('$theme');
?>
PHP
@ -653,7 +636,7 @@ PHP
} else {
echo "<li>Creating '$template/_config.php'...</li>\n";
echo "<li>Creating 'mysite/_config.php'...</li>\n";
flush();
@ -661,11 +644,11 @@ PHP
$devServers = $this->var_export_array_nokeys(explode("\n", $_POST['devsites']));
$escapedPassword = addslashes($config['mysql']['password']);
$this->createFile("$template/_config.php", <<<PHP
$this->createFile("mysite/_config.php", <<<PHP
<?php
global \$project;
\$project = '$template';
\$project = 'mysite';
global \$databaseConfig;
\$databaseConfig = array(
@ -682,7 +665,9 @@ global \$databaseConfig;
// for a description of what dev mode does.
Director::set_dev_servers($devServers);
$theme
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.com/cms-themes-and-skin
SSViewer::set_theme('$theme');
?>
PHP
@ -697,21 +682,37 @@ PHP
// Load the sapphire runtime
$_SERVER['SCRIPT_FILENAME'] = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/sapphire/main.php';
chdir('sapphire');
/**
* @TODO - Remove Dependance on CMS FOLDER.
* This will be refactored into dev/build
*/
require_once('core/Object.php');
require_once('core/ViewableData.php');
require_once('core/control/RequestHandler.php');
require_once('core/control/Controller.php');
require_once('../cms/code/LeftAndMain.php');
require_once('../cms/code/CMSMenuItem.php');
require_once('../cms/code/CMSMenu.php');
require_once('core/i18n.php');
require_once('core/i18nEntityProvider.php');
require_once('core/model/DataObjectInterface.php');
require_once('core/model/DataObject.php');
require_once('email/Email.php');
require_once('security/Security.php');
require_once('dev/Debug.php');
require_once('core/SSViewer.php');
require_once('core/Core.php');
require_once('core/ManifestBuilder.php');
require_once('core/ClassInfo.php');
require_once('core/Object.php');
require_once('core/control/Director.php');
require_once('core/ViewableData.php');
require_once('core/Session.php');
require_once('core/control/RequestHandler.php');
require_once('core/control/Controller.php');
require_once('filesystem/Filesystem.php');
echo "<li>Building database schema...</li>";
flush();
// Build database
$_GET['flush'] = true;
$con = new Controller();

View File

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 285 B

View File

Before

Width:  |  Height:  |  Size: 51 B

After

Width:  |  Height:  |  Size: 51 B

View File

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

View File

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 446 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

View File

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 556 B

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 173 B

After

Width:  |  Height:  |  Size: 173 B

View File

Before

Width:  |  Height:  |  Size: 176 B

After

Width:  |  Height:  |  Size: 176 B

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,23 +0,0 @@
<?php
class Page extends SiteTree {
static $db = array(
);
static $defaults = array(
);
}
class Page_Controller extends ContentController {
function init() {
parent::init();
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
}
?>