From: Andrew Dolgov Date: Mon, 2 Feb 2009 13:16:37 +0000 (+0300) Subject: move mysql_convert_unicode to utils/ X-Git-Tag: 1.3.1~137^2~1 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=64f7adb3b0e68ed7e0aaf6f57e2d4fb85fd2a365;p=tt-rss.git move mysql_convert_unicode to utils/ --- diff --git a/mysql_convert_unicode.php b/mysql_convert_unicode.php deleted file mode 100644 index 6d43c234..00000000 --- a/mysql_convert_unicode.php +++ /dev/null @@ -1,106 +0,0 @@ - - - - -MySQL Charset Converter - - - - - - - - - - - -

- - - - "; - - } else if (!$op) { - - print_warning(__("Please backup your database before proceeding.")); - - print "

" . __("This script will convert your Tiny Tiny RSS database to UTF-8. - Depending on current database charset you may experience data corruption (lost accent characters, etc.). - After update, you'll have to set MYSQL_CHARSET option in config.php to 'utf8'.") . "

"; - - print "
- - -
"; - - } else if ($op == "do") { - - print "

".__("Converting database...")."

"; - - db_query($link, "BEGIN"); - db_query($link, "SET FOREIGN_KEY_CHECKS=0"); - - $result = db_query($link, "SHOW TABLES LIKE 'ttrss%'"); - - while ($line = db_fetch_assoc($result)) { - $vals = array_values($line); - $table = $vals[0]; - - $query = "ALTER TABLE $table CONVERT TO - CHARACTER SET 'utf8'"; - - print "

$query

"; - - db_query($link, $query); - } - - db_query($link, "SET FOREIGN_KEY_CHECKS=1"); - db_query($link, "COMMIT"); - - print "
- -
"; - - } - -?> - - - - diff --git a/utils/mysql_convert_unicode.php b/utils/mysql_convert_unicode.php new file mode 100644 index 00000000..6d43c234 --- /dev/null +++ b/utils/mysql_convert_unicode.php @@ -0,0 +1,106 @@ + + + + +MySQL Charset Converter + + + + + + + + + + + +

+ + + + "; + + } else if (!$op) { + + print_warning(__("Please backup your database before proceeding.")); + + print "

" . __("This script will convert your Tiny Tiny RSS database to UTF-8. + Depending on current database charset you may experience data corruption (lost accent characters, etc.). + After update, you'll have to set MYSQL_CHARSET option in config.php to 'utf8'.") . "

"; + + print "
+ + +
"; + + } else if ($op == "do") { + + print "

".__("Converting database...")."

"; + + db_query($link, "BEGIN"); + db_query($link, "SET FOREIGN_KEY_CHECKS=0"); + + $result = db_query($link, "SHOW TABLES LIKE 'ttrss%'"); + + while ($line = db_fetch_assoc($result)) { + $vals = array_values($line); + $table = $vals[0]; + + $query = "ALTER TABLE $table CONVERT TO + CHARACTER SET 'utf8'"; + + print "

$query

"; + + db_query($link, $query); + } + + db_query($link, "SET FOREIGN_KEY_CHECKS=1"); + db_query($link, "COMMIT"); + + print "
+ +
"; + + } + +?> + + + +