diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-10 07:14:38 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-10 07:14:38 +0000 |
commit | dfcd869f3748132755de63db9e7eabb6dee41af1 (patch) | |
tree | be3dd469962b3b40a7b0462492a44e6586e12e5f /lib/class/update.class.php | |
parent | 9393b2afdf8e6222f06aec019f872c02c0a2c19f (diff) | |
download | ampache-dfcd869f3748132755de63db9e7eabb6dee41af1.tar.gz ampache-dfcd869f3748132755de63db9e7eabb6dee41af1.tar.bz2 ampache-dfcd869f3748132755de63db9e7eabb6dee41af1.zip |
tweaks the db updates and adds a few more charset translations to the db charset reset function
Diffstat (limited to 'lib/class/update.class.php')
-rw-r--r-- | lib/class/update.class.php | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 1a96b978..23fac871 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -269,10 +269,11 @@ class Update { $version[] = array('version' => '340016','description'=>$update_string); - $update_string = '- Attempt to correct the charset of all columns in the database.<br />'; + $update_string = '- Fix Tables for new Democratic Play methodology.<br />'; $version[] = array('version' => '340017','description'=>$update_string); + return $version; } // populate_version @@ -1206,9 +1207,36 @@ class Update { $sql = "TRUNCATE `democratic`"; $db_results = Dba::query($sql); + + self::set_version('db_version','340017'); + + } // update_340017 + + /** + * update_340018 + * This attempts to correct the charset on your database, it does some checking + * to make sure that if we do this it will actually will work. We will fail this update + * if it would cause problems + */ + public static function update_340018() { // MySQL translte real charset names into fancy smancy MySQL land names switch (strtoupper(Config::get('site_charset'))) { + case 'CP1250': + case 'WINDOWS-1250': + case 'WINDOWS-1252': + $target_charset = 'cp1250'; + $target_collation = 'cp1250_general_ci'; + break; + case 'ISO-8859': + case 'ISO-8859-2': + $target_charset = 'latin2'; + $target_collation = 'latin2_general_ci'; + break; + case 'ISO-8859-1': + $target_charset = 'latin1'; + $target_charset = 'latin1_general_ci'; + break; case 'EUC-KR': $target_charset = 'euckr'; $target_collation = 'euckr_korean_ci'; @@ -1265,9 +1293,9 @@ class Update { } // end tables - self::set_version('db_version','340017'); + //self::set_version('db_version','340018'); - } // update_340017 + } // update_340018 } // end update class ?> |