OSDN Git Service

Insert buffer control for taking away needless error output in installing script...
authorsakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Mon, 21 Mar 2011 00:40:05 +0000 (00:40 +0000)
committersakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Mon, 21 Mar 2011 00:40:05 +0000 (00:40 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@1160 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/install/index.php
utf8/nucleus/libs/sql/mysql.php
utf8/nucleus/libs/sql/pdo.php

index 761a3cc..758adf5 100755 (executable)
@@ -169,14 +169,18 @@ function showInstallForm() {
                        </li>\r
                        <li>MySQL:\r
 <?php\r
+       // Turn on output buffer\r
+       // Needed to repress the output of the sql function that are\r
+       // not part of php (in this case the @ operator doesn't work) \r
+       ob_start();\r
        // note: this piece of code is taken from phpMyAdmin\r
        $conn   = sql_connect_args('localhost','','');\r
-       $result = @at_sql_query('SELECT VERSION() AS version', $conn);\r
+       $result = @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 = @at_sql_query('SHOW VARIABLES LIKE \'version\'', $conn);\r
+               $result = @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
@@ -192,8 +196,9 @@ function showInstallForm() {
                        }\r
                }\r
        }\r
-\r
-       sql_disconnect($conn);\r
+       @sql_disconnect($conn);\r
+       //End and clean output buffer\r
+       ob_end_clean();\r
        $mysqlVersion = implode($match, '.');\r
        $minVersion   = '3.23';\r
 \r
index 95bc087..b1f81b2 100755 (executable)
@@ -343,16 +343,4 @@ if (function_exists('mysql_query') && !function_exists('sql_fetch_assoc'))
 # mysql_ tablename (deprecated)
 
 *******************************************************************/
-
-       /**
-         * 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
+}
\ No newline at end of file
index 300acfb..c2f3677 100755 (executable)
@@ -589,21 +589,4 @@ if (!function_exists('sql_fetch_assoc'))
 # mysql_ tablename (deprecated)
 
 *******************************************************************/
-
-       /**
-         * 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
+}
\ No newline at end of file