Permalink
Browse files

fix(install): Set default timezone on installation

Timezone is set to UTC for the duration of the installation before settings.php is created
Settings.php now contains date_default_timezone_set() with the selected timezone

Fixes #8845
  • Loading branch information...
beck24 committed Dec 25, 2015
1 parent a7d7612 commit 7d5a2b05d15956c70bd325e246fd0af89f305023
@@ -14,6 +14,8 @@
* @subpackage Configuration
*/
date_default_timezone_set('{{timezone}}');
global $CONFIG;
if (!isset($CONFIG)) {
$CONFIG = new \stdClass;
@@ -356,6 +356,12 @@ protected function database($submissionVars) {
'value' => 'elgg_',
'required' => TRUE,
),
'timezone' => array(
'type' => 'dropdown',
'value' => 'UTC',
'options' => \DateTimeZone::listIdentifiers(),
'required' => TRUE
)
);
if ($this->checkSettingsFile()) {
View
@@ -1,4 +1,7 @@
<?php
date_default_timezone_set('UTC');
$autoload_path = __DIR__ . '/vendor/autoload.php';
$autoload_available = include_once($autoload_path);
if (!$autoload_available) {
@@ -43,6 +43,9 @@
'email' => 'admin@travis.elgg.org',
'username' => 'admin',
'password' => 'fancypassword',
// timezone
'timezone' => 'UTC'
);
// install and create the .htaccess file
View
@@ -59,12 +59,14 @@
'install:database:label:dbname' => 'Database Name',
'install:database:label:dbhost' => 'Database Host',
'install:database:label:dbprefix' => 'Database Table Prefix',
'install:database:label:timezone' => "Timezone",
'install:database:help:dbuser' => 'User that has full privileges to the MySQL database that you created for Elgg',
'install:database:help:dbpassword' => 'Password for the above database user account',
'install:database:help:dbname' => 'Name of the Elgg database',
'install:database:help:dbhost' => 'Hostname of the MySQL server (usually localhost)',
'install:database:help:dbprefix' => "The prefix given to all of Elgg's tables (usually elgg_)",
'install:database:help:timezone' => "The default timezone in which the site will operate",
'install:settings:instructions' => 'We need some information about the site as we configure Elgg. If you haven\'t <a href="http://learn.elgg.org/en/1.x/intro/install.html#create-a-data-folder" target="_blank">created a data directory</a> for Elgg, you need to do so now.',

0 comments on commit 7d5a2b0

Please sign in to comment.