mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Insert all the distributed timezones upon upgrade
This commit is contained in:
parent
a8021f5641
commit
6927f0e726
@ -1322,6 +1322,18 @@ function main_upgrade($oldversion=0) {
|
||||
table_column('user', 'timezone', 'timezone', 'varchar', '100', '', '99');
|
||||
execute_sql(" ALTER TABLE `{$CFG->prefix}user` DROP `timezonename` ");
|
||||
}
|
||||
|
||||
if ($oldversion < 2005041101) {
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
if (is_readable($CFG->dirroot.'/lib/timezones.txt')) { // Distribution file
|
||||
if ($timezones = get_records_csv($CFG->dirroot.'/lib/timezones.txt', 'timezone')) {
|
||||
$db->debug = false;
|
||||
update_timezone_records($timezones);
|
||||
notify(count($timezones).' timezones installed');
|
||||
$db->debug = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -1039,6 +1039,18 @@ function main_upgrade($oldversion=0) {
|
||||
execute_sql(" ALTER TABLE `{$CFG->prefix}user` DROP `timezonename` ");
|
||||
}
|
||||
|
||||
if ($oldversion < 2005041101) {
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
if (is_readable($CFG->dirroot.'/lib/timezones.txt')) { // Distribution file
|
||||
if ($timezones = get_records_csv($CFG->dirroot.'/lib/timezones.txt', 'timezone')) {
|
||||
$db->debug = false;
|
||||
update_timezone_records($timezones);
|
||||
notify(count($timezones).' timezones installed');
|
||||
$db->debug = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2005040800; // YYYYMMDD = date
|
||||
$version = 2005041101; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.5 UNSTABLE DEVELOPMENT'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user