OSDN Git Service

# FIXED: atom.phpとxml-rss2.phpで_CHARSETをチェックして文字コード変換(Nicleus3.41 へアップグレード後 xml-rss2...
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / install.php
index 4aef1e5..19b5eb5 100755 (executable)
@@ -175,6 +175,7 @@ function showInstallForm() {
                        $match = explode('.', $row[1]);\r
                } else {\r
                        $output = shell_exec('mysql -V');\r
+                       $output = (function_exists('shell_exec')) ? @shell_exec('mysql -V') : '0.0.0';\r
                        preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);\r
                        $match = explode('.', $version[0]);\r
 \r
@@ -575,7 +576,7 @@ function doInstall() {
        $mySqlVer = implode('.', array_map('intval', explode('.', mysql_get_server_info($MYSQL_CONN))));\r
        if ($mySqlVer >= '5.0.7' && phpversion() >= '5.2.3') {\r
                mysql_set_charset($charset);\r
-       } else {\r
+       } elseif ($mySqlVer >= '4.1.0') {\r
                mysql_query("SET NAMES " . $charset);\r
        }\r
        $collation = ($charset == 'utf8') ? 'utf8_unicode_ci' : 'ujis_japanese_ci';\r
@@ -584,14 +585,15 @@ function doInstall() {
        // 3. try to create database (if needed)\r
        if ($mysql_create == 1) {\r
                $sql = 'CREATE DATABASE '\r
-                        .     $mysql_database\r
+                        .     $mysql_database;\r
 // <add for garble measure>\r
-                        . ' DEFAULT CHARACTER SET '\r
-                        .     $charset\r
-                        . ' COLLATE '\r
-                        .     $collation\r
+       if ($mySqlVer >= '4.1.0') {\r
+               $sql .= ' DEFAULT CHARACTER SET '\r
+                         .     $charset\r
+                         . ' COLLATE '\r
+                         .     $collation;\r
+       }\r
 // </add for garble measure>*/\r
-                        . '';\r
                mysql_query($sql) or _doError(_ERROR16 . ': ' . mysql_error());\r
        }\r
 \r
@@ -666,7 +668,7 @@ function doInstall() {
                                        $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);\r
                        }\r
 // <add for garble measure>\r
-                       if ($mysql_create != 1 && strpos($query, 'CREATE TABLE') === 0) {\r
+                       if ($mysql_create != 1 && strpos($query, 'CREATE TABLE') === 0 && $mySqlVer >= '4.1.0') {\r
                                $query .= ' DEFAULT CHARACTER SET ' . $charset . ' COLLATE ' . $collation;\r
                        }\r
 // </add for garble measure>*/\r
@@ -924,6 +926,7 @@ function doInstall() {
                <ul>\r
                <li><?php echo _TEXT15_L1; ?></li>\r
                <li><?php echo _TEXT15_L2; ?></li>\r
+               <li><?php echo _TEXT15_L3; ?></li>\r
                </ul>\r
 \r
        <?php echo _TEXT15_EX; ?>\r
@@ -1139,7 +1142,7 @@ function _doError($msg) {
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
 <html xmlns="http://www.w3.org/1999/xhtml">\r
 <head>\r
-       <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />\r
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
        <title><?php echo _TITLE; ?></title>\r
        <style>@import url('nucleus/styles/manual.css');</style>\r
 </head>\r
@@ -1147,7 +1150,7 @@ function _doError($msg) {
        <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
        <h1><?php echo _ERROR27; ?></h1>\r
 \r
-       <p><?php echo _ERROR28; ?>: "<?php echo $msg?>";</p>\r
+       <p><?php echo _ERROR28; ?> "<?php echo $msg; ?>";</p>\r
 \r
        <p><a href="install.php" onclick="history.back();"><?php echo _TEXT17; ?></a></p>\r
 </body>\r
@@ -1162,7 +1165,7 @@ function showErrorMessages($errors) {
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
 <html xmlns="http://www.w3.org/1999/xhtml">\r
 <head>\r
-       <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />\r
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
        <title><?php echo _TITLE; ?></title>\r
        <style>@import url('nucleus/styles/manual.css');</style>\r
 </head>\r