2012-08-22 03:42:53 +02:00
<!doctype html>
2012-04-11 02:21:56 +02:00
<!-- [if lt IE 7]> <html class="no - js lt - ie9 lt - ie8 lt - ie7" lang="en"> <![endif] -->
<!-- [if IE 7]> <html class="no - js lt - ie9 lt - ie8" lang="en"> <![endif] -->
<!-- [if IE 8]> <html class="no - js lt - ie9" lang="en"> <![endif] -->
<!-- [if gt IE 8]><! --> < html class = "no-js" lang = "en" > <!-- <![endif] -->
2009-06-18 01:14:40 +02:00
< head >
2010-05-25 05:45:51 +02:00
< title > SilverStripe CMS / Framework Installation< / title >
2010-04-14 04:21:26 +02:00
< meta http-equiv = "Content-type" content = "text/html; charset=utf-8" >
2016-01-24 06:12:45 +01:00
< script type = "application/javascript" src = "<?php echo FRAMEWORK_NAME; ?>/thirdparty/jquery/jquery.js" > < / script >
< script type = "application/javascript" src = "<?php echo FRAMEWORK_NAME; ?>/dev/install/install.js" > < / script >
2012-03-24 04:38:57 +01:00
< link rel = "stylesheet" type = "text/css" href = "<?php echo FRAMEWORK_NAME; ?>/dev/install/css/install.css" >
2010-04-14 04:21:26 +02:00
< link rel = "shortcut icon" href = "favicon.ico" >
2009-06-18 01:14:40 +02:00
< / head >
< body >
< div id = "BgContainer" >
< div id = "Container" >
< div id = "Header" >
2012-04-11 02:21:56 +02:00
< h1 > SilverStripe< / h1 >
< div class = "left" >
2012-04-15 05:05:20 +02:00
< h2 > CMS / Framework Installation <?php if($silverstripe_version) echo "<small>Version $silverstripe_version</small>"; ?> < / h2 >
2012-04-11 02:21:56 +02:00
< p > Thanks for choosing to use SilverStripe! Please follow the instructions below and you should be up in running in no time.< br >
If you get stuck, head over to the < a href = "http://silverstripe.org/installing-silverstripe" target = "_blank" > installation forum< / a > , or check out our list of < a href = "http://doc.silverstripe.org/doku.php?id=suggested-web-hosts" target = "_blank" > suggested web hosts< / a > known to work with SilverStripe.
< / p >
< / div >
2009-06-18 01:14:40 +02:00
< / div >
< div id = "Navigation" > < / div >
< div class = "clear" > <!-- --> < / div >
2016-01-06 00:34:58 +01:00
2009-06-18 01:14:40 +02:00
< div id = "Layout" >
< div class = "typography" >
< form action = "install.php" method = "post" >
<?php if(isset($hasErrorOtherThanDatabase)) { ?>
2012-04-11 02:21:56 +02:00
< p class = "message error" >
2010-04-14 04:21:26 +02:00
You aren't currently able to install the software. Please < a href = "#requirements" > see below< / a > for details.< br >
2012-10-05 06:00:39 +02:00
If you are having problems meeting the requirements, see the < a href = "http://doc.silverstripe.org/framework/en/installation/server-requirements" > server requirements< / a > .
2009-06-18 01:14:40 +02:00
< / p >
2016-01-06 00:34:58 +01:00
<?php if (isset($phpIniLocation)) { ?>
2012-03-04 09:01:12 +01:00
< p > Your php.ini file is located at <?php echo $phpIniLocation; ?> < / p >
<?php } ?>
2009-06-18 01:14:40 +02:00
<?php } else { ?>
2010-10-19 00:41:32 +02:00
<?php if($alreadyInstalled) { ?>
2012-04-11 02:21:56 +02:00
< div class = "message warning" >
2010-10-19 00:41:32 +02:00
< p > < strong > Note:< / strong > SilverStripe is already installed here.< br >
If you wish to reinstall SilverStripe, please delete the < strong > mysite/_config.php< / strong > file first.< / p >
< / div >
<?php } else if($req->hasWarnings()) { ?>
2012-04-11 02:21:56 +02:00
< div class = "message warning" >
2012-04-16 02:14:03 +02:00
< p > There are some issues that we recommend you look at before installing, however, you are still able to install the software.
2012-10-05 06:00:39 +02:00
< br > Please see below for details. If you are having problems meeting the requirements, see the < a href = "http://doc.silverstripe.org/framework/en/installation/server-requirements" > server requirements< / a > .< / p >
2012-04-11 02:21:56 +02:00
< / div >
2010-05-25 05:14:47 +02:00
<?php } else if(!$dbReq->hasErrors() && !$adminReq->hasErrors()) { ?>
2012-04-11 02:21:56 +02:00
< div class = "message goodInstall" > < p > You're ready to install! Please confirm the configuration options below. < a href = "#install" > Install SilverStripe< / a > < / p >
< / div >
2010-04-14 04:22:21 +02:00
<?php } ?>
2016-01-06 00:34:58 +01:00
2010-05-25 05:14:47 +02:00
<?php if($dbReq->hasErrors()) { ?>
2012-04-11 02:21:56 +02:00
< div class = "message error" >
< p > The database details don't appear to be correct. Please < a href = "#database_credentials" > review and correct< / a > before installing.< / p >
< / div >
2010-05-25 05:14:47 +02:00
<?php } ?>
2016-01-06 00:34:58 +01:00
2010-05-25 05:14:47 +02:00
<?php if($adminReq->hasErrors()) { ?>
2012-04-11 02:21:56 +02:00
< div class = "message error" >
< p > Please < a href = "#AdminAccount" > enter an email address and password< / a > for the default administrator account before installing.< / p >
< / div >
2010-05-25 05:14:47 +02:00
<?php } ?>
2009-06-18 01:14:40 +02:00
<?php } ?>
2016-01-06 00:34:58 +01:00
2012-04-11 02:21:56 +02:00
< h3 class = "sectionHeading" id = "requirements" > Requirements < small > Step 1 of 5< / small > < / h3 >
2010-10-13 02:57:05 +02:00
<?php $req->showTable(); ?>
2010-10-19 07:03:16 +02:00
<?php $dbReq->showTable(); ?>
2016-01-06 00:34:58 +01:00
2012-04-11 02:21:56 +02:00
< p class = "helpText requirementsHelpText" >
2012-10-05 06:00:39 +02:00
Read more about our < a href = "http://doc.silverstripe.org/framework/en/installation/server-requirements" target = "_blank" > server requirements< / a > .
2010-10-13 02:57:05 +02:00
< / p >
2016-01-06 00:34:58 +01:00
2010-10-13 02:57:05 +02:00
< div class = "action" >
< input type = "submit" class = "action" value = "Re-check requirements" >
< / div >
2012-04-11 02:21:56 +02:00
< div class = "clear" > <!-- --> < / div >
< h3 class = "sectionHeading" > Database Configuration < small > Step 2 of 5< / small > < / h3 >
2010-04-14 04:21:11 +02:00
< div id = "database_credentials" class = "section" >
2016-01-06 00:34:58 +01:00
2010-10-13 02:57:05 +02:00
<?php $dbReq->showTable("Database Configuration"); ?>
2016-01-06 00:34:58 +01:00
2010-10-04 06:24:33 +02:00
< p id = "dbHelp" class = "helpText" >
SilverStripe stores its content in a relational SQL database. Please provide the username and password to connect to the server here.
If this account has permission to create databases, then we will create the database for you; otherwise, you must give the name of a
database that already exists.< br > < br >
< strong > Other databases:< / strong > < br >
Databases in the list that are greyed out cannot currently be used. Click on them for more information and possible remedies.
< / p >
2012-04-15 06:01:06 +02:00
< div class = "fields" >
2010-10-04 06:24:33 +02:00
< div class = "field" >
< ul id = "database_selection" >
< ?php
foreach($databaseClasses as $class => $details) {
2010-10-04 06:43:12 +02:00
$checked = ($databaseConfig['type'] == $class || $type == $class) ? ' checked="checked"' : '';
2010-10-04 06:24:33 +02:00
$disabled = $help = '';
if($usingEnv) {
// All are disabled by default when environment is used
$disabled = 'disabled="disabled"';
// If SS_DATABASE_CLASS is specified, check the database in the list
if(defined('SS_DATABASE_CLASS') & & SS_DATABASE_CLASS == $class) {
$checked = ' checked="checked"';
}
} else {
$disabled = !$details['supported'] || !$details['hasModule'] ? 'notavailable="true"' : '';
if ($disabled) {
if (!$details['supported'] & & !$details['hasModule']) {
$help = 'PHP does not have the required extension, and SilverStripe does not have the correct module installed';
$helpText = '< li style = "width:auto" > '.$details['missingExtensionText'].'< / li > ';
$helpText .= '< li style = "width:auto" > '.$details['missingModuleText'].'< / li > ';
} else if ($details['supported'] & & !$details['hasModule']) {
$help = 'PHP has the required extension, but SilverStripe is missing the module';
$helpText = '< li style = "width:auto" > '.$details['missingModuleText'].'< / li > ';
} else if (!$details['supported'] & & $details['hasModule']) {
$help = 'SilverStripe has the module installed, but PHP is missing the required extension';
$helpText = '< li style = "width:auto" > '.$details['missingExtensionText'].'< / li > ';
}
$help .= "< ul > $helpText< / ul > ";
2010-05-25 06:24:14 +02:00
}
}
2010-10-04 06:24:33 +02:00
echo "< li > ";
echo "< input id = \"$class\" class = \"databaseClass\" type = \"radio\" name = \"db[type]\" value = \"$class\"$checked $ disabled > ";
2010-10-04 06:26:54 +02:00
echo "< label class = \"left\" " . ( $ help | | $ disabled ? ' style = "font-weight:normal;color:grey" ' : ' style = "color:green" ' ) . " for = \"$class\" > {$details['title']}< / label > ";
2010-10-04 06:24:33 +02:00
if ($help) {
2012-04-11 02:21:56 +02:00
echo '< div class = "message error databaseError" > < p > '.$help.'< / p > < / div > ';
2010-10-04 06:24:33 +02:00
}
2010-10-04 06:43:12 +02:00
// generate db-specific config fields
echo '< div class = "dbfields" > ';
if(isset($details['fields'])) foreach($details['fields'] as $fieldName => $fieldSpec) {
$fieldTitle = $fieldSpec['title'];
2010-10-19 02:33:12 +02:00
$fieldType = ($fieldName == 'password') ? 'password' : 'text';
2010-10-04 06:43:12 +02:00
// values
$defaultValue = (isset($fieldSpec['default'])) ? $fieldSpec['default'] : null;
if($usingEnv & & isset($fieldSpec['envVar']) & & defined($fieldSpec['envVar'])) {
$value = constant($fieldSpec['envVar']);
} else {
2013-06-21 00:32:08 +02:00
$value = (isset($databaseConfig[$fieldName]) & & $databaseConfig['type'] == $class) ? $databaseConfig[$fieldName] : $defaultValue;
2010-10-04 06:43:12 +02:00
}
2016-01-06 00:34:58 +01:00
2010-10-04 06:43:12 +02:00
// attributes
$attrs = array(
'id' => "db_{$class}_{$fieldName}",
'class' => 'text',
2010-10-19 02:33:12 +02:00
'type' => $fieldType,
2010-10-04 06:43:12 +02:00
'name' => "db[$class][$fieldName]",
'value' => $value,
);
if($usingEnv & & isset($fieldSpec['envVar']) & & defined($fieldSpec['envVar'])) {
$attrs['disabled'] = 'disabled';
}
if(isset($fieldSpec['envVar'])) {
$attrs['class'] .= ' configured-by-env';
}
$attrHTML = '';
2013-03-23 13:05:33 +01:00
foreach($attrs as $attrName => $attrValue) $attrHTML .= "$attrName=\"" . htmlspecialchars($attrValue) . '"';
2010-10-04 06:43:12 +02:00
if(isset($fieldSpec['attributes'])) $attrs = array_merge($attrs, $fieldSpec['attributes']);
2016-01-06 00:34:58 +01:00
2010-10-04 06:43:12 +02:00
// html
echo "< div class = \"field\" > ";
2010-10-19 03:26:27 +02:00
echo "< label for = \"db_{$class}_$fieldName\" > $fieldTitle:< / label > ";
2010-10-04 06:43:12 +02:00
echo "< span class = \"middleColumn\" > ";
echo "< input $ attrHTML > ";
echo "< / span > ";
echo "< / div > ";
}
echo '< / div > ';
2016-01-06 00:34:58 +01:00
2010-10-04 06:24:33 +02:00
echo "< / li > ";
2010-04-14 04:22:54 +02:00
}
2010-10-04 06:24:33 +02:00
?>
< / ul >
2016-01-06 00:34:58 +01:00
2010-10-12 23:56:46 +02:00
<?php if($envFileExists) { ?>
< div id = "use_environment_field" class = "field" >
< input id = "use_environment" type = "checkbox" name = "useEnv" < ? php if ( $ usingEnv ) echo " checked = \"checked\"" ? > >
2012-10-05 06:00:39 +02:00
< label for = "use_environment" > Use _ss_environment file for configuration (< a href = "http://doc.silverstripe.org/framework/en/topics/environment-management" target = "_blank" > ?< / a > )< / label >
2010-10-12 23:56:46 +02:00
< / div >
<?php } ?>
2016-01-06 00:34:58 +01:00
2010-10-04 06:24:33 +02:00
< / div >
2016-01-06 00:34:58 +01:00
2010-10-04 06:24:33 +02:00
< div class = "action" >
< input type = "submit" class = "action" value = "Re-check requirements" >
< / div >
2010-04-14 04:21:39 +02:00
< / div >
2010-04-14 04:21:11 +02:00
< / div >
2016-01-06 00:34:58 +01:00
2010-04-14 05:46:56 +02:00
< div class = "clear" > <!-- --> < / div >
2016-01-06 00:34:58 +01:00
2012-04-11 02:21:56 +02:00
< h3 class = "sectionHeading" > CMS Admin Account < small > Step 3 of 5< / small > < / h3 >
2016-01-06 00:34:58 +01:00
2010-04-14 04:21:11 +02:00
< div id = "AdminAccount" class = "section" >
2016-01-06 00:34:58 +01:00
2010-10-13 02:45:50 +02:00
< div class = "fieldGroup" >
< p class = "helpText" > We will set up the first administrator account for you automatically. You can change these details later in the "Security" section within the CMS.< / p >
2016-01-06 00:34:58 +01:00
< div class = "field" >
2010-10-12 23:56:46 +02:00
< label for = "admin_username" > Email:< / label >
2010-10-04 06:24:33 +02:00
< span class = "middleColumn" >
2015-09-08 00:04:21 +02:00
< input type = "text" class = "text configured-by-env" name = "admin[username]" id = "admin_username" value = "<?php echo htmlspecialchars($adminConfig['username'], ENT_QUOTES, 'UTF-8'); ?>" < ? php if ( $ usingEnv & & defined ( ' SS_DEFAULT_ADMIN_USERNAME ' ) ) echo ' disabled = "disabled" ' ? > >
2010-10-04 06:24:33 +02:00
< / span >
< / div >
2016-01-06 00:34:58 +01:00
2010-10-04 06:24:33 +02:00
< div class = "field" >
2010-10-12 23:56:46 +02:00
< label for = "admin_password" > Password:< / label >
2010-10-04 06:24:33 +02:00
< span class = "middleColumn" >
2015-09-08 00:04:21 +02:00
< input type = "password" class = "text configured-by-env" name = "admin[password]" id = "admin_password" value = "<?php echo htmlspecialchars($adminConfig['password'], ENT_QUOTES, 'UTF-8'); ?>" < ? php if ( $ usingEnv & & defined ( ' SS_DEFAULT_ADMIN_PASSWORD ' ) ) echo ' disabled = "disabled" ' ? > >
2010-10-04 06:24:33 +02:00
< / span >
< / div >
2010-05-25 05:14:47 +02:00
< / div >
2016-01-06 00:34:58 +01:00
2010-10-13 02:45:50 +02:00
< div class = "fieldGroup" >
< p class = "helpText" >
2010-10-13 02:59:23 +02:00
"Default language" determines the default locale settings
(for dates, currencies, etc.), as well as the default language
of the CMS interface. This can be changed for each user.
2012-04-11 02:21:56 +02:00
< br >
< strong > Warning:< / strong > The CMS interface may be missing translations in certain locales.
2010-10-13 02:45:50 +02:00
< / p >
2016-01-06 00:34:58 +01:00
2010-10-04 06:24:33 +02:00
< div class = "field" >
< label for = "locale" > Default language:< / label >
< span class = "middleColumn" >
< select name = "locale" id = "locale" >
2010-10-13 02:45:50 +02:00
< ?php
$selectedLocale = isset($_POST['locale']) ? $_POST['locale'] : $defaultLocale;
2012-05-03 00:00:51 +02:00
foreach($locales as $code => $title) {
2012-04-15 06:29:14 +02:00
$selected = $code == $selectedLocale ? ' selected="selected"' : '';
2012-05-03 00:00:51 +02:00
echo "< option $ selected value = \"$code\" > {$title}< / option > \n";
2010-10-13 02:45:50 +02:00
}
?>
2016-01-06 00:34:58 +01:00
< / select >
2010-10-04 06:24:33 +02:00
< / span >
< / div >
2012-04-11 02:21:56 +02:00
< div class = "clear" > <!-- --> < / div >
2010-10-04 06:24:33 +02:00
< / div >
< / div >
2016-01-06 00:34:58 +01:00
2012-04-11 02:21:56 +02:00
< h3 class = "sectionHeading" > Theme selection < small > Step 4 of 5< / small > < / h3 >
2015-12-22 02:30:20 +01:00
< p class = "helpText" > You can change the theme or < a href = "http://addons.silverstripe.org/add-ons?type=theme" > download< / a > another from the SilverStripe website after installation.< / p >
2012-04-11 02:21:56 +02:00
< ul id = "Themes" >
2012-10-05 06:00:39 +02:00
< li > < input type = "radio" name = "template" value = "simple" id = "Simple" < ? php if ( ! isset ( $ _POST [ ' template ' ] ) | | $ _POST [ ' template ' ] = = ' simple ' ) { ? > checked="checked"<?php }?> >< label for = "Simple" > < a href = "https://github.com/silverstripe-themes/silverstripe-simple" > Simple< / a > - our default theme ready to use, or begin the < a href = "http://doc.silverstripe.org/framework/en/tutorials" target = "_blank" > tutorial< / a > .< / label > < / li >
2012-08-22 03:42:53 +02:00
< li > < input type = "radio" name = "template" value = "tutorial" id = "EmptyTemplate" < ? php if ( isset ( $ _POST [ ' template ' ] ) & & $ _POST [ ' template ' ] = = ' tutorial ' ) { ? > checked="checked"<?php }?> >< label for = "EmptyTemplate" > Empty template< / label > < / li >
2012-04-11 02:21:56 +02:00
< / ul >
< h3 class = "sectionHeading" id = "install" > Confirm Install < small > Step 5 of 5< / small > < / h3 >
2016-01-06 00:34:58 +01:00
2010-10-13 02:57:05 +02:00
<?php if(isset($hasErrorOtherThanDatabase)) { ?>
< p class = "error" >
You aren't currently able to install the software. Please < a href = "#requirements" > see above< / a > for details.< br >
2012-04-15 06:29:14 +02:00
If you are having problems meeting the requirements, see the < a href = "http://doc.silverstripe.org/doku.php?id=server-requirements" > server requirements page< / a > .
2010-10-13 02:57:05 +02:00
< / p >
<?php } else { ?>
< p id = "stats-container" >
< input type = "checkbox" id = "stats" name = "stats" checked = "checked" >
< label for = "stats" > Send information about my webserver to silverstripe.org< br / >
2010-10-13 02:59:55 +02:00
< small > (anonymous version information, used for statistical purposes)< / small >
2010-10-13 02:57:05 +02:00
< / label > < p >
2016-01-06 00:34:58 +01:00
2010-10-13 02:57:05 +02:00
< p >
<?php if($alreadyInstalled) { ?>
< input id = "install_button" type = "submit" disabled = "disabled" class = "action" name = "go" value = "Install SilverStripe" >
<?php } else { ?>
< input id = "install_button" type = "submit" class = "action" name = "go" value = "Install SilverStripe" >
<?php } ?>
2016-01-06 00:34:58 +01:00
2010-10-13 02:57:05 +02:00
< span id = "saving_top" style = "display: none" >
2012-04-15 06:29:14 +02:00
< img src = "<?php echo FRAMEWORK_NAME; ?>/images/network-save.gif" alt = "Saving" >
2010-10-13 02:57:05 +02:00
(this will take a minute or so)
< / span >
< / p >
<?php } ?>
2009-06-18 01:14:40 +02:00
< / form >
< / div >
< / div >
< div class = "clear" > <!-- --> < / div >
< / div >
2016-01-06 00:34:58 +01:00
2009-06-18 01:14:40 +02:00
< div id = "Footer" >
< div class = "footerTop" > <!-- --> < / div >
2012-03-05 02:51:42 +01:00
< p > < a href = "http://silverstripe.org" > SilverStripe Open Source CMS / Framework< / a > | Copyright © <?php echo date('Y'); ?> SilverStripe Limited< / p >
2009-06-18 01:14:40 +02:00
< / div >
< / div >
< / body >
2010-04-14 05:33:12 +02:00
< / html >