List:Commits« Previous MessageNext Message »
From:uwendel Date:July 4 2007 4:19pm
Subject:PHP mysqlnd svn commit: r636 - trunk/tests/ext/mysql
View as plain text  
Author: uwendel
Date: 2007-07-04 16:19:19 +0200 (Wed, 04 Jul 2007)
New Revision: 636

Modified:
   trunk/tests/ext/mysql/mysql_pconnect.phpt
Log:
Not sure why, but it helps with cross-server/remote-server testing.


Modified: trunk/tests/ext/mysql/mysql_pconnect.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_pconnect.phpt	2007-07-04 13:26:48 UTC (rev 635)
+++ trunk/tests/ext/mysql/mysql_pconnect.phpt	2007-07-04 14:19:19 UTC (rev 636)
@@ -17,7 +17,7 @@
     if (!$link = mysql_pconnect($myhost, $user, $passwd, true))
         printf("[002] Cannot connect to the server using host=%s/%s, user=%s, passwd=***,
dbname=%s, port=%s, socket=%s\n",
             $host, $myhost, $user, $db, $port, $socket);           
-       
+
     mysql_close($link);
 
     if ($link = mysql_pconnect($myhost, $user . 'unknown_really', $passwd . 'non_empty',
true))
@@ -28,14 +28,20 @@
         printf("[004] Expecting boolean/false, got %s/%s\n", gettype($link), $link);
 
     // Run the following tests without an anoynmous MySQL user and use a password for the
test user!   
-    ini_set('mysql.default_socket', $socket);     
-    if (!is_resource($link = mysql_pconnect($host, $user, $passwd, true))) {
-        printf("[005] Usage of mysql.default_socket failed\n") ;
-    } else {
-        mysql_close($link);        
-    }
     
+    
     if (!ini_get('sql.safe_mode')) {
+        
+        if ($socket) {
+            ini_set('mysql.default_socket', $socket);
+            if (!is_resource($link = mysql_pconnect($host, $user, $passwd, true))) {
+                printf("[005] Usage of mysql.default_socket failed\n") ;
+            } else {
+                mysql_close($link);        
+            }
+        } else {
+            ini_set('mysql.default_socket', null);
+        }
     
         ini_set('mysql.default_port', $port);
         if (!is_resource($link = mysql_pconnect($host, $user, $passwd, true))) {

Thread
PHP mysqlnd svn commit: r636 - trunk/tests/ext/mysqluwendel4 Jul