OSDN Git Service

MERGE: リビジョン1787。Adminクラスのいくつかのメソッドのコード整理。
[nucleus-jp/nucleus-next.git] / nucleus / libs / sql / pdo.php
index b9e82cc..56c351c 100644 (file)
@@ -57,7 +57,7 @@ if (!function_exists('sql_fetch_assoc'))
                                $portnum = '';\r
                        }\r
                        else {\r
-                               list($host,$port) = i18n::explode(":",$mysql_host);\r
+                               list($host,$port) = preg_split("#:#", $mysql_host);\r
                                if (isset($port)) {\r
                                        $portnum = $port;\r
                                        $port = ';port='.trim($port);\r
@@ -151,7 +151,7 @@ if (!function_exists('sql_fetch_assoc'))
                                $portnum = ''; \r
                        }\r
                        else {\r
-                               list($host,$port) = i18n::explode(":",$MYSQL_HOST);\r
+                               list($host,$port) = preg_split("#:#", $MYSQL_HOST);\r
                                if (isset($port)) {\r
                                        $portnum = $port;\r
                                        $port = ';port='.trim($port);\r
@@ -245,10 +245,26 @@ if (!function_exists('sql_fetch_assoc'))
                else $dbh = NULL;\r
        }\r
        \r
-       function sql_close(&$dbh=NULL) {\r
+       /**\r
+        * sql_close()\r
+        * use sql_disconnect() instead of this\r
+        * \r
+        * @deprecated\r
+        * @param       resource        $conn   resource of mySQL connection\r
+        * @return      void\r
+        */\r
+       function sql_close(&$dbh=NULL)\r
+       {\r
                global $SQL_DBH;\r
-               if (is_null($dbh)) $SQL_DBH = NULL;\r
-               else $dbh = NULL;\r
+               if ( is_null($dbh) )\r
+               {\r
+                       $SQL_DBH = NULL;\r
+               }\r
+               else\r
+               {\r
+                       $dbh = NULL;\r
+               }\r
+               return;\r
        }\r
        \r
        /**\r
@@ -300,7 +316,7 @@ if (!function_exists('sql_fetch_assoc'))
                if (is_null($dbh)) { \r
                        try {\r
                                $SQL_DBH = NULL;\r
-                               list($host,$port) = i18n::explode(":",$MYSQL_HOST);\r
+                               list($host,$port) = preg_split("#:#", $MYSQL_HOST);\r
                                if (isset($port)) {\r
                                        $portnum = $port;\r
                                        $port = ';port='.trim($port);\r