MDL-49684 timezones: rewrite timezone support

This patch replaces all homegrown timezone
stuff with standard PHP date/time code.

The main change is the introduction of core_date
class that returns normalised user and server
timezones. From now on nobody should be using
$CFG->timezone or $user->timezone directly!

Other new features and fixes:
* admins are prompted for timezone during install
* editing of other users is finally fixed
* timezones are displayed in user profile
* new $this->setTimezone() in phpunit
* time locale is now automatically reset in phpunit
* timezone is now automatically reset in phpunit
* phpunit has Australia/Perth as default timezone
This commit is contained in:
Petr Skoda
2015-04-06 13:53:51 +12:00
parent e19b37101f
commit d6e7a63d9a
60 changed files with 2340 additions and 4619 deletions
+2 -2
View File
@@ -913,7 +913,7 @@ class core_plugin_manager {
'qformat' => array('blackboard', 'learnwise'),
'enrol' => array('authorize'),
'tinymce' => array('dragmath'),
'tool' => array('bloglevelupgrade', 'qeupgradehelper'),
'tool' => array('bloglevelupgrade', 'qeupgradehelper', 'timezoneimport'),
'theme' => array('mymobile', 'afterburner', 'anomaly', 'arialist', 'binarius', 'boxxie', 'brick', 'formal_white',
'formfactor', 'fusion', 'leatherbound', 'magazine', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high',
'splash', 'standard', 'standardold'),
@@ -1143,7 +1143,7 @@ class core_plugin_manager {
'assignmentupgrade', 'availabilityconditions', 'behat', 'capability', 'customlang',
'dbtransfer', 'filetypes', 'generator', 'health', 'innodb', 'installaddon',
'langimport', 'log', 'messageinbound', 'multilangupgrade', 'monitor', 'phpunit', 'profiling',
'replace', 'spamcleaner', 'task', 'timezoneimport',
'replace', 'spamcleaner', 'task',
'unittest', 'uploadcourse', 'uploaduser', 'unsuproles', 'xmldb'
),