OSDN Git Service

Update install process according to Cacher's work. Now the auto-detecting function...
authorsakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Thu, 13 Jan 2011 15:03:27 +0000 (15:03 +0000)
committersakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Thu, 13 Jan 2011 15:03:27 +0000 (15:03 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@1087 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/install/index.php
utf8/install/install_lang_japanese.php
utf8/nucleus/language/english-utf8.php
utf8/nucleus/language/english.php
utf8/nucleus/language/japanese-euc.php
utf8/nucleus/language/japanese-utf8.php
utf8/nucleus/libs/sql/mysql.php
utf8/nucleus/libs/sql/pdo.php

index 4352010..16df611 100755 (executable)
@@ -1,7 +1,7 @@
 <?php\r
 /*\r
  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2010 The Nucleus Group\r
+ * Copyright (C) 2002-2011 The Nucleus Group\r
  *\r
  * This program is free software; you can redistribute it and/or\r
  * modify it under the terms of the GNU General Public License\r
  * those tables.\r
  *\r
  * Below is a friendly way of letting users on non-php systems know that Nucleus won't run there.\r
- * ?><div style="font-size: xx-large;">If you see this text in your browser when you open <i>install.php</i>, your web server is not able to run PHP-scripts, and therefor Nucleus will not be able to run there. </div><div style="display: none"><?php\r
+ * ?><div style="font-size: xx-large;">If you see this text in your browser when you open <i>/install/</i>, your web server is not able to run PHP-scripts, and therefor Nucleus will not be able to run there. </div><div style="display: none"><?php\r
  */\r
 \r
 /**\r
  * @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2010 The Nucleus Group\r
+ * @copyright Copyright (C) 2002-2011 The Nucleus Group\r
  * @version $Id$\r
- * $NucleusJP: install.php,v 1.7 2007/02/04 06:28:44 kimitake Exp $\r
+ * $NucleusJP: index.php,v 1.7 2007/02/04 06:28:44 kimitake Exp $\r
  */\r
 \r
 /*\r
-       This part of the install.php code allows for customization of the install process.\r
+       This part of the index.php code allows for customization of the install process.\r
        When distributing plugins or skins together with a Nucleus installation, the\r
        configuration below will instruct to install them\r
 \r
@@ -173,20 +173,20 @@ function showInstallForm() {
        } elseif (phpversion() < '5') {\r
                echo ' <span class="warning" style="display:block">' . _TEXT2_WARN3 . '</span>';\r
        }\r
-       \r
-       echo "</li>\n";\r
-       /*\r
+?>\r
+\r
+                       </li>\r
+                       <li>MySQL:\r
+\r
+<?php\r
        // note: this piece of code is taken from phpMyAdmin\r
-       echo "<li>MySQL\n";\r
        $conn   = sql_connect_args('localhost','','');\r
-       $result = @sql_query('SELECT VERSION() AS version', $conn);\r
-       \r
+       $result = @at_sql_query('SELECT VERSION() AS version', $conn);\r
        if ($result != FALSE && sql_num_rows($result) > 0) {\r
                $row   = sql_fetch_array($result);\r
                $match = explode('.', $row['version']);\r
        } else {\r
-               $result = @sql_query('SHOW VARIABLES LIKE \'version\'', $conn);\r
-\r
+               $result = @at_sql_query('SHOW VARIABLES LIKE \'version\'', $conn);\r
                if ($result != FALSE && @sql_num_rows($result) > 0) {\r
                        $row   = sql_fetch_row($result);\r
                        $match = explode('.', $row[1]);\r
@@ -202,22 +202,27 @@ function showInstallForm() {
                        }\r
                }\r
        }\r
+\r
        sql_disconnect($conn);\r
        $mysqlVersion = implode($match, '.');\r
        $minVersion   = '3.23';\r
+\r
        if ($mysqlVersion == '0.0.0') {\r
                echo _NOTIFICATION1;\r
        }\r
        else {\r
                echo $mysqlVersion;\r
        }\r
+\r
        if ($mysqlVersion < $minVersion) {\r
                echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN2, $minVersion) . '</span>';\r
        }\r
-       echo "</li>\n";\r
-       */\r
-       echo "</ul>\n";\r
+?>\r
 \r
+                       </li>\r
+               </ul>\r
+\r
+<?php\r
        // tell people how they can have their config file filled out automatically\r
        if (@file_exists('../config.php') && @!is_writable('../config.php')) {\r
 ?>\r
@@ -591,12 +596,13 @@ function doInstall() {
 // <add for garble measure>\r
        // 2-2. set DEFAULT CHARSET and COLLATE\r
        $mySqlVer = implode('.', array_map('intval', explode('.', sql_get_server_info($MYSQL_CONN))));\r
-       if ($mySqlVer >= '5.0.7' && phpversion() >= '5.2.3') {\r
+//     if ($mySqlVer >= '5.0.7' && phpversion() >= '5.2.3') {//}\r
+       if ($mySqlVer >= '5.0.7' && function_exists('mysql_set_charset')) {\r
                mysql_set_charset($charset);\r
        } elseif ($mySqlVer >= '4.1.0') {\r
-               sql_query("SET NAMES " . $charset);\r
+               sql_query("SET CHARACTER SET " . $charset);\r
        }\r
-       $collation = ($charset == 'utf8') ? 'utf8_unicode_ci' : 'ujis_japanese_ci';\r
+       $collation = ($charset == 'utf8') ? 'utf8_general_ci' : 'ujis_japanese_ci';\r
 // </add for garble measure>*/\r
 \r
        // 3. try to create database (if needed)\r
@@ -695,7 +701,7 @@ function doInstall() {
        }\r
 \r
        // 5a make first post\r
-       if ($charset == 'ujis') {\r
+       if (strtoupper(_CHARSET) != 'UTF-8') {\r
                $itm_title = mb_convert_encoding(_1ST_POST_TITLE, _CHARSET, 'UTF-8');\r
                $itm_body  = mb_convert_encoding(_1ST_POST, _CHARSET, 'UTF-8');\r
                $itm_more  = mb_convert_encoding(_1ST_POST2, _CHARSET, 'UTF-8');\r
@@ -752,7 +758,7 @@ function doInstall() {
        sql_query($query,$MYSQL_CONN) or _doError(_ERROR20 . ': ' . sql_error($MYSQL_CONN) );\r
 \r
        // 8-2. update category settings\r
-       if ($charset == 'ujis') {\r
+       if (strtoupper(_CHARSET) != 'UTF-8') {\r
                $cat_name = mb_convert_encoding(_GENERALCAT_NAME, _CHARSET, 'UTF-8');\r
                $cat_desc = mb_convert_encoding(_GENERALCAT_DESC, _CHARSET, 'UTF-8');\r
        } else {\r
index 8cd5646..a6b11e5 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 /*\r
  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2010 The Nucleus Group\r
+ * Copyright (C) 2002-2011 The Nucleus Group\r
  *\r
  * This program is free software; you can redistribute it and/or\r
  * modify it under the terms of the GNU General Public License\r
@@ -12,7 +12,7 @@
 \r
 /**\r
  * @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2010 The Nucleus Group\r
+ * @copyright Copyright (C) 2002-2011 The Nucleus Group\r
  * @version $Id$\r
  */\r
 define('_HEADER1_2',                   'キャラクタセット');\r
@@ -145,8 +145,8 @@ define('_HEADER10',                         'インストールファイルの削除');
 define('_TEXT15',                              '<p>ウェブサーバから /install/ ディレクトリを削除してください:</p>');\r
 define('_TEXT15_L1',                   '<b>install/install.sql</b>:テーブルの構造を内包するファイル');\r
 define('_TEXT15_L2',                   '<b>install/index.php</b>:このファイル');\r
-\r
-define('_TEXT15_L3',                   '<b>install_lang_japanese.php</b>:インストーラの言語ファイル');\r
+//define('_TEXT15_L3',                 '<b>install_lang_japanese.php</b>:インストーラの言語ファイル');\r
+define('_TEXT15_L3',                   '<b>install/install_lang_japanese.php</b>:インストーラの言語ファイル');\r
 define('_TEXT16',                      '<p>もしこのディレクトリを削除していなければ、管理領域を開くことができません。</p>');\r
 \r
 define('_HEADER11',                            'ウェブサイトの確認');\r
@@ -161,8 +161,8 @@ define('_BUTTON1',                          'インストールを実行する');
 // General category\r
 define('_GENERALCAT_NAME',             '総合');\r
 define('_GENERALCAT_DESC',             '投稿した記事に合うカテゴリが無い時にこのカテゴリを使用すると良いでしょう');\r
-\r
-define('_1ST_POST_TITLE',              'Nucleus CMS バージョン3.51へようこそ');\r
+//define('_1ST_POST_TITLE',            'Nucleus CMS バージョン3.51へようこそ');\r
+define('_1ST_POST_TITLE',              'Nucleus CMS バージョン3.62へようこそ');\r
 define('_1ST_POST',                            'ウェブサイトの作成を補助する積み木がここにあります。それは心躍るブログになるかもしれませんし、見る人を和ませる家族のサイトになるかもしれませんし、実り多い趣味のサイトになるかもしれません。あるいは現在のあなたには想像がつかないものになることだってあるでしょう。<br />\r
 <br />用途が思いつきませんでしたか? それならここへ来て正解です。なぜならあなた同様私たちにもわからないのですから。');\r
 define('_1ST_POST2',                   'これはサイトにおける最初のエントリーです。スタートを切りやすいように、リンクと情報を入れておきました。<br />\r
index 48a9020..54d7e38 100644 (file)
@@ -206,9 +206,9 @@ define('_ITEM_ADDEDITTEMPLATE_HOUR',                                'Hour');
 define('_ITEM_ADDEDITTEMPLATE_MINUTE',                         'Minute');
 
 // Errors
-define('_ERRORS_INSTALLSQL',                                           'install.sql should be deleted');
+define('_ERRORS_INSTALLSQL',                                           'install/install.sql should be deleted');
 define('_ERRORS_INSTALLDIR',                                           'install directory should be deleted');  // <add by shizuki />
-define('_ERRORS_INSTALLPHP',                                           'install.php should be deleted');
+define('_ERRORS_INSTALLPHP',                                           'install/index.php should be deleted');
 define('_ERRORS_UPGRADESDIR',                                          'nucleus/upgrades directory should be deleted');
 define('_ERRORS_CONVERTDIR',                                           'nucleus/convert directory should be deleted');
 define('_ERRORS_CONFIGPHP',                                                    'config.php should be non-writable (chmod to 444)');
index 1b59ef8..28e4476 100755 (executable)
@@ -212,9 +212,9 @@ define('_ITEM_ADDEDITTEMPLATE_HOUR',                                'Hour');
 define('_ITEM_ADDEDITTEMPLATE_MINUTE',                         'Minute');
 
 // Errors
-define('_ERRORS_INSTALLSQL',                                           'install.sql should be deleted');
+define('_ERRORS_INSTALLSQL',                                           'install/install.sql should be deleted');
 define('_ERRORS_INSTALLDIR',                                           'install directory should be deleted');  // <add by shizuki />
-define('_ERRORS_INSTALLPHP',                                           'install.php should be deleted');
+define('_ERRORS_INSTALLPHP',                                           'install/index.php should be deleted');
 define('_ERRORS_UPGRADESDIR',                                          'nucleus/upgrades directory should be deleted');
 define('_ERRORS_CONVERTDIR',                                           'nucleus/convert directory should be deleted');
 define('_ERRORS_CONFIGPHP',                                                    'config.php should be non-writable (chmod to 444)');
index dfad4c3..87e947d 100644 (file)
@@ -208,9 +208,9 @@ define('_ITEM_ADDEDITTEMPLATE_HOUR',                                '
 define('_ITEM_ADDEDITTEMPLATE_MINUTE',                         'ʬ');
 
 // Errors
-define('_ERRORS_INSTALLSQL',                                           '\8e¢install.sql\8e£¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤');
+define('_ERRORS_INSTALLSQL',                                           '\8e¢install/install.sql\8e£¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤');
 define('_ERRORS_INSTALLDIR',                                           '\8e¢install\8e£¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤');  // <add by shizuki />
-define('_ERRORS_INSTALLPHP',                                           '\8e¢install.php\8e£¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤');
+define('_ERRORS_INSTALLPHP',                                           '\8e¢install/index.php\8e£¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤');
 define('_ERRORS_UPGRADESDIR',                                          '\8e¢nucleus/upgrades\8e£¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤');
 define('_ERRORS_CONVERTDIR',                                           '\8e¢nucleus/convert\8e£¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤');
 define('_ERRORS_CONFIGPHP',                                                    '\8e¢config.php\8e£¥Õ¥¡¥¤¥ë¤òÆɤ߼è¤êÀìÍÑ(\8e¢chmod 444\8e£Åù)¤Ë¤·¤Æ¤¯¤À¤µ¤¤');
index f1e75b6..21f5fee 100755 (executable)
@@ -214,9 +214,9 @@ define('_ITEM_ADDEDITTEMPLATE_HOUR',                                '時');
 define('_ITEM_ADDEDITTEMPLATE_MINUTE',                         '分');
 
 // Errors
-define('_ERRORS_INSTALLSQL',                                           '「install.sql」ファイルを削除してください');
+define('_ERRORS_INSTALLSQL',                                           '「install/install.sql」ファイルを削除してください');
 define('_ERRORS_INSTALLDIR',                                           '「install」ディレクトリを削除してください');  // <add by shizuki />
-define('_ERRORS_INSTALLPHP',                                           '「install.php」ファイルを削除してください');
+define('_ERRORS_INSTALLPHP',                                           '「install/index.php」ファイルを削除してください');
 define('_ERRORS_UPGRADESDIR',                                          '「nucleus/upgrades」ディレクトリを削除してください');
 define('_ERRORS_CONVERTDIR',                                           '「nucleus/convert」ディレクトリを削除してください');
 define('_ERRORS_CONFIGPHP',                                                    '「config.php」ファイルを読み取り専用(「chmod 444」等)にしてください');
index a9fdc4c..f41b601 100755 (executable)
@@ -2,7 +2,7 @@
 
 /*
  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
- * Copyright (C) 2002-2010 The Nucleus Group
+ * Copyright (C) 2002-2011 The Nucleus Group
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -12,7 +12,7 @@
  */
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
- * @copyright Copyright (C) 2002-2010 The Nucleus Group
+ * @copyright Copyright (C) 2002-2011 The Nucleus Group
  * @version $Id$
  */
  
@@ -68,7 +68,7 @@ if (function_exists('mysql_query') && !function_exists('sql_fetch_assoc'))
                $fetchDat = sql_fetch_assoc($resource);
                $charset  = $fetchDat['Value'];
                $mySqlVer = implode('.', array_map('intval', explode('.', sql_get_server_info($MYSQL_CONN))));
-               if ($mySqlVer >= '5.0.7' && phpversion() >= '5.2.3') {
+               if ($mySqlVer >= '5.0.7' && function_exists('mysql_set_charset')) {
                        mysql_set_charset($charset);
                } elseif ($mySqlVer >= '4.1.0') {
                        sql_query("SET CHARACTER SET " . $charset);
@@ -335,6 +335,15 @@ if (function_exists('mysql_query') && !function_exists('sql_fetch_assoc'))
 
 *******************************************************************/
 
-
+       /**
+         * for JP installer only
+         */
+       function at_sql_query($query, $conn = false) {
+               global $SQLCount,$MYSQL_CONN;
+               if (!$conn) $conn = $MYSQL_CONN;
+               $SQLCount++;
+               $res = mysql_query($query,$conn);
+               return $res;
+       }
 }
 ?>
\ No newline at end of file
index 69e3ca9..8d47de2 100755 (executable)
@@ -2,7 +2,7 @@
 
 /*
  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
- * Copyright (C) 2002-2010 The Nucleus Group
+ * Copyright (C) 2002-2011 The Nucleus Group
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -12,7 +12,7 @@
  */
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
- * @copyright Copyright (C) 2002-2010 The Nucleus Group
+ * @copyright Copyright (C) 2002-2011 The Nucleus Group
  * @version $Id$
  */
  
@@ -581,6 +581,20 @@ if (!function_exists('sql_fetch_assoc'))
 
 *******************************************************************/
 
-
+       /**
+         * for JP installer only
+         */
+       function at_sql_query($query,$dbh=NULL) {
+               global $SQLCount,$SQL_DBH;
+               $SQLCount++;
+               if (is_null($dbh)) $res = $SQL_DBH->query($query);
+               else $res = $dbh->query($query);
+/*             if ($res->errorCode() != '00000') {
+                       $errors = $res->errorInfo();
+                       print("SQL error with query $query: " . $errors[0].'-'.$errors[1].' '.$errors[2] . '<p />');
+               }
+*/
+               return $res;
+       }
 }
 ?>
\ No newline at end of file