From 64f7adb3b0e68ed7e0aaf6f57e2d4fb85fd2a365 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 2 Feb 2009 16:16:37 +0300 Subject: move mysql_convert_unicode to utils/ --- mysql_convert_unicode.php | 106 ---------------------------------------- utils/mysql_convert_unicode.php | 106 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 mysql_convert_unicode.php create mode 100644 utils/mysql_convert_unicode.php diff --git a/mysql_convert_unicode.php b/mysql_convert_unicode.php deleted file mode 100644 index 6d43c234c..000000000 --- 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 000000000..6d43c234c --- /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 "
+ +
"; + + } + +?> + + + + -- cgit v1.2.3 From cf7dc81c70cc0b25fa33baf9feb4e36f913de342 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 2 Feb 2009 16:17:17 +0300 Subject: mysql_convert_unicode: fix include paths --- utils/mysql_convert_unicode.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/mysql_convert_unicode.php b/utils/mysql_convert_unicode.php index 6d43c234c..acc1e77af 100644 --- a/utils/mysql_convert_unicode.php +++ b/utils/mysql_convert_unicode.php @@ -1,12 +1,12 @@