2007-10-10 18:17:38 +08:00
|
|
|
--TEST--
|
|
|
|
mysqli_options() - MYSQLI_OPT_LOCAL_INFILE and open_basedir
|
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
require_once('skipif.inc');
|
|
|
|
require_once('skipifemb.inc');
|
|
|
|
require_once('skipifconnectfailure.inc');
|
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2015-11-16 16:58:19 +08:00
|
|
|
require_once('connect.inc');
|
|
|
|
ini_set("open_basedir", __DIR__);
|
|
|
|
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
|
|
|
printf("[001] Cannot connect, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
2007-10-10 18:17:38 +08:00
|
|
|
|
2015-11-16 16:58:19 +08:00
|
|
|
if ($IS_MYSQLND) {
|
|
|
|
if (true !== mysqli_options($link, MYSQLI_OPT_LOCAL_INFILE, 1))
|
|
|
|
printf("[002] Can not set MYSQLI_OPT_LOCAL_INFILE although open_basedir is set!\n");
|
|
|
|
|
|
|
|
} else {
|
2007-10-10 18:17:38 +08:00
|
|
|
if (false !== mysqli_options($link, MYSQLI_OPT_LOCAL_INFILE, 1))
|
|
|
|
printf("[002] Can set MYSQLI_OPT_LOCAL_INFILE although open_basedir is set!\n");
|
|
|
|
|
2015-11-16 16:58:19 +08:00
|
|
|
}
|
|
|
|
mysqli_close($link);
|
|
|
|
print "done!";
|
2007-10-10 18:17:38 +08:00
|
|
|
?>
|
2018-02-19 16:59:41 +08:00
|
|
|
--EXPECT--
|
2007-10-10 18:17:38 +08:00
|
|
|
done!
|