uw Mon Jul 23 12:04:19 2007 UTC Modified files: /php-src/ext/mysqli/tests 001.phpt 002.phpt 009.phpt 020.phpt 023.phpt 024.phpt 025.phpt 045.phpt 048.phpt 060.phpt 065.phpt 067.phpt connect.inc skipif.inc skipifemb.inc skipifnotemb.inc table.inc Log: Primarily whitespace/CS - synching with mysqlnd SVN repository
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/001.phpt?r1=1.8&r2=1.9&diff_format=u Index: php-src/ext/mysqli/tests/001.phpt diff -u php-src/ext/mysqli/tests/001.phpt:1.8 php-src/ext/mysqli/tests/001.phpt:1.9 --- php-src/ext/mysqli/tests/001.phpt:1.8 Thu Jul 12 20:28:25 2007 +++ php-src/ext/mysqli/tests/001.phpt Mon Jul 23 12:04:19 2007 @@ -34,13 +34,13 @@ /* temporary addition for Kent's setup, Win32 box */ for ($i = 0; $i < 10; $i++) { - if (!$link = mysqli_init()) - printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error()); + if (!$link = mysqli_init()) + printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error()); - if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) - printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error()); + if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) + printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error()); - mysqli_close($link); + mysqli_close($link); } /*** test mysqli_real_connect compressed ***/ http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/002.phpt?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/mysqli/tests/002.phpt diff -u php-src/ext/mysqli/tests/002.phpt:1.7 php-src/ext/mysqli/tests/002.phpt:1.8 --- php-src/ext/mysqli/tests/002.phpt:1.7 Thu Jul 12 20:31:18 2007 +++ php-src/ext/mysqli/tests/002.phpt Mon Jul 23 12:04:19 2007 @@ -1,35 +1,35 @@ --TEST-- -mysqli bind_result 1 +mysqli bind_result 1 --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) - printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null")) printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, - col3 int, col4 bigint, - col5 float, col6 double, - col7 date, col8 time, - col9 varbinary(10), - col10 varchar(50), - col11 char(20)) ENGINE=" . $engine); + col3 int, col4 bigint, + col5 float, col6 double, + col7 date, col8 time, + col9 varbinary(10), + col10 varchar(50), + col11 char(20)) ENGINE=" . $engine); if (!$rc) printf("[003] Cannot create table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - + $rc = mysqli_query($link, "INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)"); if (!$rc) printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); + mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); mysqli_execute($stmt); mysqli_fetch($stmt); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/009.phpt?r1=1.9&r2=1.10&diff_format=u Index: php-src/ext/mysqli/tests/009.phpt diff -u php-src/ext/mysqli/tests/009.phpt:1.9 php-src/ext/mysqli/tests/009.phpt:1.10 --- php-src/ext/mysqli/tests/009.phpt:1.9 Thu Jul 12 20:38:26 2007 +++ php-src/ext/mysqli/tests/009.phpt Mon Jul 23 12:04:19 2007 @@ -27,17 +27,18 @@ c4 bigint unsigned, c5 bigint unsigned, c6 bigint unsigned, - c7 bigint unsigned) ENGINE=" . $engine); + c7 bigint unsigned, + c8 bigint unsigned) ENGINE=" . $engine); if (!$rc) printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - $rc = mysqli_query($link, "INSERT INTO test_bind_fetch (c2,c3,c4,c5,c6,c7) ". - "VALUES (-23,4.0,33333333333333,0,-333333333333,99.9)"); + $rc = mysqli_query($link, "INSERT INTO test_bind_fetch (c2,c3,c4,c5,c6,c7,c8) ". + "VALUES (-23,4.0,33333333333333,0,-333333333333,99.9,1234)"); if (!$rc) printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); + mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8); mysqli_execute($stmt); $rc = mysqli_fetch($stmt); @@ -47,7 +48,8 @@ $c6 = 0; } } - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); + $c8 = 4567;// change this to test how mysqli/mysqlnd handles is_ref changing + $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8); var_dump($test); @@ -75,7 +77,7 @@ ?> --EXPECTF-- -array(7) { +array(8) { [0]=> int(5) [1]=> @@ -90,12 +92,14 @@ int(0) [6]=> int(100) + [7]=> + int(4567) } 20123456 3123456789 done! --UEXPECTF-- -array(7) { +array(8) { [0]=> int(5) [1]=> @@ -110,7 +114,9 @@ int(0) [6]=> int(100) + [7]=> + int(4567) } 20123456 3123456789 -done! \ No newline at end of file +done! http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/020.phpt?r1=1.9&r2=1.10&diff_format=u Index: php-src/ext/mysqli/tests/020.phpt diff -u php-src/ext/mysqli/tests/020.phpt:1.9 php-src/ext/mysqli/tests/020.phpt:1.10 --- php-src/ext/mysqli/tests/020.phpt:1.9 Thu Jul 12 20:49:29 2007 +++ php-src/ext/mysqli/tests/020.phpt Mon Jul 23 12:04:19 2007 @@ -18,11 +18,11 @@ mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"); mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time, - c3 timestamp(14), - c4 year, - c5 datetime, - c6 timestamp(4), - c7 timestamp(6))"); + c3 timestamp(14), + c4 year, + c5 datetime, + c6 timestamp(4), + c7 timestamp(6))"); $stmt = mysqli_prepare($link, "INSERT INTO test_bind_result VALUES (?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/023.phpt?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/mysqli/tests/023.phpt diff -u php-src/ext/mysqli/tests/023.phpt:1.7 php-src/ext/mysqli/tests/023.phpt:1.8 --- php-src/ext/mysqli/tests/023.phpt:1.7 Thu Jul 12 20:49:29 2007 +++ php-src/ext/mysqli/tests/023.phpt Mon Jul 23 12:04:19 2007 @@ -14,12 +14,12 @@ mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned, - c2 int unsigned, - c3 int, - c4 int, - c5 int, - c6 int unsigned, - c7 int)"); + c2 int unsigned, + c3 int, + c4 int, + c5 int, + c6 int unsigned, + c7 int)"); $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/024.phpt?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/mysqli/tests/024.phpt diff -u php-src/ext/mysqli/tests/024.phpt:1.7 php-src/ext/mysqli/tests/024.phpt:1.8 --- php-src/ext/mysqli/tests/024.phpt:1.7 Thu Jul 12 20:49:29 2007 +++ php-src/ext/mysqli/tests/024.phpt Mon Jul 23 12:04:19 2007 @@ -14,12 +14,12 @@ mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); + c2 smallint unsigned, + c3 smallint, + c4 smallint, + c5 smallint, + c6 smallint unsigned, + c7 smallint)"); $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/025.phpt?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/mysqli/tests/025.phpt diff -u php-src/ext/mysqli/tests/025.phpt:1.7 php-src/ext/mysqli/tests/025.phpt:1.8 --- php-src/ext/mysqli/tests/025.phpt:1.7 Thu Jul 12 20:49:29 2007 +++ php-src/ext/mysqli/tests/025.phpt Mon Jul 23 12:04:19 2007 @@ -14,12 +14,12 @@ mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint, - c2 tinyint unsigned, - c3 tinyint not NULL, - c4 tinyint, - c5 tinyint, - c6 tinyint unsigned, - c7 tinyint)"); + c2 tinyint unsigned, + c3 tinyint not NULL, + c4 tinyint, + c5 tinyint, + c6 tinyint unsigned, + c7 tinyint)"); $stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES(?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/045.phpt?r1=1.9&r2=1.10&diff_format=u Index: php-src/ext/mysqli/tests/045.phpt diff -u php-src/ext/mysqli/tests/045.phpt:1.9 php-src/ext/mysqli/tests/045.phpt:1.10 --- php-src/ext/mysqli/tests/045.phpt:1.9 Thu Jul 12 20:55:12 2007 +++ php-src/ext/mysqli/tests/045.phpt Mon Jul 23 12:04:19 2007 @@ -31,6 +31,11 @@ mysqli_bind_result($stmt, $c1, $c2); mysqli_fetch($stmt); mysqli_stmt_close($stmt); + if (ini_get("unicode.semantics") && mysqli_get_server_version($link) < 50000) { + /* variables are binary */ + settype($c1, "unicode"); + settype($c2, "unicode"); + } $test = array ($c1,$c2); var_dump($test); @@ -53,4 +58,4 @@ [1]=> unicode(%d) "%s" } -done! \ No newline at end of file +done! http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/048.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/mysqli/tests/048.phpt diff -u php-src/ext/mysqli/tests/048.phpt:1.6 php-src/ext/mysqli/tests/048.phpt:1.7 --- php-src/ext/mysqli/tests/048.phpt:1.6 Thu Jul 12 20:55:12 2007 +++ php-src/ext/mysqli/tests/048.phpt Mon Jul 23 12:04:19 2007 @@ -12,13 +12,13 @@ $mysql->select_db($db); $mysql->query("DROP TABLE IF EXISTS test_fetch_null"); - $mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, - col3 int, col4 bigint, - col5 float, col6 double, - col7 date, col8 time, - col9 varbinary(10), - col10 varchar(50), - col11 char(20))"); + $mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, + col3 int, col4 bigint, + col5 float, col6 double, + col7 date, col8 time, + col9 varbinary(10), + col10 varchar(50), + col11 char(20))"); $mysql->query("INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)"); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/060.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/mysqli/tests/060.phpt diff -u php-src/ext/mysqli/tests/060.phpt:1.6 php-src/ext/mysqli/tests/060.phpt:1.7 --- php-src/ext/mysqli/tests/060.phpt:1.6 Thu Jul 12 21:02:21 2007 +++ php-src/ext/mysqli/tests/060.phpt Mon Jul 23 12:04:19 2007 @@ -20,12 +20,12 @@ mysqli_query($link,"DROP TABLE IF EXISTS test_fetch"); mysqli_query($link,"CREATE TABLE test_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); + c2 smallint unsigned, + c3 smallint, + c4 smallint, + c5 smallint, + c6 smallint unsigned, + c7 smallint)"); mysqli_query($link, "INSERT INTO test_fetch VALUES ( -23, 35999, NULL, -500, -9999999, -0, 0)"); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/065.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/mysqli/tests/065.phpt diff -u php-src/ext/mysqli/tests/065.phpt:1.6 php-src/ext/mysqli/tests/065.phpt:1.7 --- php-src/ext/mysqli/tests/065.phpt:1.6 Thu Jul 12 21:02:21 2007 +++ php-src/ext/mysqli/tests/065.phpt Mon Jul 23 12:04:19 2007 @@ -1,8 +1,8 @@ --TEST-- -set character set +set character set --SKIPIF-- -<?php -require_once('skipif.inc'); +<?php +require_once('skipif.inc'); if (!function_exists('mysqli_set_charset')) { die('skip mysqli_set_charset() not available'); } @@ -15,10 +15,10 @@ include "connect.inc"; if (!$mysql = new mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); - + printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + if (!mysqli_query($mysql, "SET sql_mode=''")) - printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql)); + printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql)); $esc_str = chr(0xbf) . chr(0x5c); $len = $charset = array(); @@ -27,27 +27,27 @@ if ($mysql->set_charset("latin1")) { /* 5C should be escaped */ if (3 !== ($tmp = strlen($mysql->real_escape_string($esc_str)))) - printf("[003] Expecting 3/int got %s/%s\n", gettype($tmp), $tmp); - + printf("[003] Expecting 3/int got %s/%s\n", gettype($tmp), $tmp); + if ('latin1' !== ($tmp = $mysql->client_encoding())) - printf("[004] Expecting latin1/string got %s/%s\n", gettype($tmp), $tmp); + printf("[004] Expecting latin1/string got %s/%s\n", gettype($tmp), $tmp); } if ($res = $mysql->query("SHOW CHARACTER SET LIKE 'gbk'")) { - $res->free_result(); - if ($mysql->set_charset("gbk")) { - /* nothing should be escaped, it's a valid gbk character */ - - if (2 !== ($tmp = strlen($mysql->real_escape_string($esc_str)))) - printf("[005] Expecting 2/int got %s/%s\n", gettype($tmp), $tmp); - - if ('gbk' !== ($tmp = $mysql->client_encoding())) - printf("[005] Expecting gbk/string got %s/%s\n", gettype($tmp), $tmp);; - } + $res->free_result(); + if ($mysql->set_charset("gbk")) { + /* nothing should be escaped, it's a valid gbk character */ + + if (2 !== ($tmp = strlen($mysql->real_escape_string($esc_str)))) + printf("[005] Expecting 2/int got %s/%s\n", gettype($tmp), $tmp); + + if ('gbk' !== ($tmp = $mysql->client_encoding())) + printf("[005] Expecting gbk/string got %s/%s\n", gettype($tmp), $tmp);; + } } $mysql->close(); - - print "done!"; + + print "done!"; ?> --EXPECT-- done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/067.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/mysqli/tests/067.phpt diff -u php-src/ext/mysqli/tests/067.phpt:1.2 php-src/ext/mysqli/tests/067.phpt:1.3 --- php-src/ext/mysqli/tests/067.phpt:1.2 Thu Jul 12 21:02:21 2007 +++ php-src/ext/mysqli/tests/067.phpt Mon Jul 23 12:04:19 2007 @@ -10,9 +10,9 @@ /* skip cursor test for versions < 50004 */ if ((!$IS_MYSQLND && mysqli_get_client_version() < 50009) || - (mysqli_get_server_version($link) < 50009)) { - die(sprintf("skip Client library doesn't support cursors (%s/%s)", - mysqli_get_client_version(), mysqli_get_server_version($link)); + (mysqli_get_server_version($link) < 50009)) { + die(sprintf("skip Client library doesn't support cursors (%s/%s)", + mysqli_get_client_version(), mysqli_get_server_version($link)); } mysqli_close($link); ?> @@ -21,8 +21,8 @@ function open_cursor($mysql, $query) { if (!is_object($stmt = $mysql->prepare($query))) { - printf("[001] Cannot create statement object for '%s', [%d] %s\n", - $query, $mysql->errno, $mysql->error); + printf("[001] Cannot create statement object for '%s', [%d] %s\n", + $query, $mysql->errno, $mysql->error); } $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY); @@ -30,11 +30,16 @@ } include "connect.inc"; - $a = array(); - - /*** test mysqli_connect 127.0.0.1 ***/ $mysql = new mysqli($host, $user, $passwd, $db, $port, $socket); + if ((!$IS_MYSQLND && mysqli_get_client_version() < 50009) || + (mysqli_get_server_version($mysql) < 50009)) { + /* we really want to skip it... */ + die(var_dump(63)); + } + + $a = array(); + for ($i=0;$i < 3; $i++) { $mysql->query("DROP TABLE IF EXISTS cursor$i"); $mysql->query("CREATE TABLE cursor$i (a int not null) ENGINE=" . $engine); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/connect.inc?r1=1.9&r2=1.10&diff_format=u Index: php-src/ext/mysqli/tests/connect.inc diff -u php-src/ext/mysqli/tests/connect.inc:1.9 php-src/ext/mysqli/tests/connect.inc:1.10 --- php-src/ext/mysqli/tests/connect.inc:1.9 Thu Jul 12 20:04:17 2007 +++ php-src/ext/mysqli/tests/connect.inc Mon Jul 23 12:04:19 2007 @@ -1,11 +1,11 @@ <?php - /* - Default values are "localhost", "root", - database "phptest" and empty password. - Change the MYSQL_TEST environment values - if you want to use another configuration - */ - + /* + Default values are "localhost", "root", + database "phptest" and empty password. + Change the MYSQL_TEST environment values + if you want to use another configuration + */ + $driver = new mysqli_driver; $host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "localhost"; @@ -15,40 +15,40 @@ $db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "phptest"; $engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM"; $socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null; - + /* Development setting: test experimal features and/or feature requests that never worked before? */ - $TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ? - ((1 == getenv("MYSQL_TEST_EXPERIMENTAL")) ? true : false) : - false; + $TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ? + ((1 == getenv("MYSQL_TEST_EXPERIMENTAL")) ? true : false) : + false; $IS_MYSQLND = stristr(mysqli_get_client_info(), "mysqlnd"); if (!$IS_MYSQLND) { - $MYSQLND_VERSION = NULL; + $MYSQLND_VERSION = NULL; } else { - if (preg_match('@Revision:\s+(\d+)[EMAIL PROTECTED]', mysqli_get_client_info(), $matches)) { - $MYSQLND_VERSION = (int)$matches[1]; - } else { - $MYSQLND_VERSION = -1; - } + if (preg_match('@Revision:\s+(\d+)[EMAIL PROTECTED]', mysqli_get_client_info(), $matches)) { + $MYSQLND_VERSION = (int)$matches[1]; + } else { + $MYSQLND_VERSION = -1; + } } - if (!function_exists('sys_get_temp_dir')) { - function sys_get_temp_dir() { - - if (!empty($_ENV['TMP'])) - return realpath( $_ENV['TMP'] ); - if (!empty($_ENV['TMPDIR'])) - return realpath( $_ENV['TMPDIR'] ); - if (!empty($_ENV['TEMP'])) - return realpath( $_ENV['TEMP'] ); - - $temp_file = tempnam(md5(uniqid(rand(), TRUE)), ''); - if ($temp_file) { - $temp_dir = realpath(dirname($temp_file)); - unlink($temp_file); - return $temp_dir; - } - return FALSE; - } - } + if (!function_exists('sys_get_temp_dir')) { + function sys_get_temp_dir() { + + if (!empty($_ENV['TMP'])) + return realpath( $_ENV['TMP'] ); + if (!empty($_ENV['TMPDIR'])) + return realpath( $_ENV['TMPDIR'] ); + if (!empty($_ENV['TEMP'])) + return realpath( $_ENV['TEMP'] ); + + $temp_file = tempnam(md5(uniqid(rand(), TRUE)), ''); + if ($temp_file) { + $temp_dir = realpath(dirname($temp_file)); + unlink($temp_file); + return $temp_dir; + } + return FALSE; + } + } ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/skipif.inc?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/mysqli/tests/skipif.inc diff -u php-src/ext/mysqli/tests/skipif.inc:1.7 php-src/ext/mysqli/tests/skipif.inc:1.8 --- php-src/ext/mysqli/tests/skipif.inc:1.7 Thu Jul 12 20:07:05 2007 +++ php-src/ext/mysqli/tests/skipif.inc Mon Jul 23 12:04:19 2007 @@ -2,4 +2,4 @@ if (!extension_loaded('mysqli')){ die('skip mysqli extension not available'); } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/skipifemb.inc?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/mysqli/tests/skipifemb.inc diff -u php-src/ext/mysqli/tests/skipifemb.inc:1.1 php-src/ext/mysqli/tests/skipifemb.inc:1.2 --- php-src/ext/mysqli/tests/skipifemb.inc:1.1 Fri Jan 7 14:59:59 2005 +++ php-src/ext/mysqli/tests/skipifemb.inc Mon Jul 23 12:04:19 2007 @@ -1,5 +1,5 @@ <?php - $driver = new mysqli_driver(); - if ($driver->embedded) - die("skip test doesn't run with embedded server"); -?> + $driver = new mysqli_driver(); + if ($driver->embedded) + die("skip test doesn't run with embedded server"); +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/skipifnotemb.inc?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/mysqli/tests/skipifnotemb.inc diff -u php-src/ext/mysqli/tests/skipifnotemb.inc:1.1 php-src/ext/mysqli/tests/skipifnotemb.inc:1.2 --- php-src/ext/mysqli/tests/skipifnotemb.inc:1.1 Tue Jul 11 23:41:40 2006 +++ php-src/ext/mysqli/tests/skipifnotemb.inc Mon Jul 23 12:04:19 2007 @@ -1,5 +1,5 @@ <?php - $driver = new mysqli_driver(); - if (!$driver->embedded) - die("skip test for with embedded server only"); -?> + $driver = new mysqli_driver(); + if (!$driver->embedded) + die("skip test for with embedded server only"); +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/table.inc?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/mysqli/tests/table.inc diff -u php-src/ext/mysqli/tests/table.inc:1.1 php-src/ext/mysqli/tests/table.inc:1.2 --- php-src/ext/mysqli/tests/table.inc:1.1 Thu Jul 12 20:10:23 2007 +++ php-src/ext/mysqli/tests/table.inc Mon Jul 23 12:04:19 2007 @@ -2,22 +2,22 @@ require_once('connect.inc'); if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); - exit(1); -} - + printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", + $host, $user, $db, $port, $socket); + exit(1); +} + if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) { - printf("Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - exit(1); -} - + printf("Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + exit(1); +} + if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine)) { - printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - exit(1); + printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + exit(1); } if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e"), (6, "f")')) { - printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link)); } ?> \ No newline at end of file
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php