diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 74a1818432b..24d225f268c 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -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; } diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index a0fc2645ac3..e55a87c48b1 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -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; } diff --git a/version.php b/version.php index cb0f59dc1b8..010658313c3 100644 --- a/version.php +++ b/version.php @@ -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