diff options
author | Matteo Beccati <mbeccati@php.net> | 2016-12-15 09:32:04 +0100 |
---|---|---|
committer | Matteo Beccati <mbeccati@php.net> | 2016-12-15 09:32:04 +0100 |
commit | 72fb941bd47aeaa8fd4100aacc945e5372984ac2 (patch) | |
tree | 5327a5d4f1c562175a6ad5d9086cec462b39e281 /ext/pdo_mysql | |
parent | 382ec5cf9e890bdceba5888a6f81de4f2da3c67f (diff) | |
parent | 7c696fa886c51d556c5d15419df5a04e179b4534 (diff) | |
download | php-git-72fb941bd47aeaa8fd4100aacc945e5372984ac2.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
Skip tests when secure_file_priv dir not writable
Add missing UPGRADING entry. Manual is updated before 7.0 release.
Diffstat (limited to 'ext/pdo_mysql')
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt | 11 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt | 13 |
2 files changed, 23 insertions, 1 deletions
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt index ebf22ef61b..38b49b6efa 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt @@ -16,6 +16,17 @@ if (count($tmp) < 2) if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1')) die("skip Test cannot be run against remote database server"); +$stmt = $db->query("SHOW VARIABLES LIKE 'secure_file_priv'"); +if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) { + if (!is_writable($row['value'])) + die("skip secure_file_priv directory not writable: {$row['value']}"); + + $filename = $row['value'] . DIRECTORY_SEPARATOR . "pdo_mysql_exec_load_data.csv"; + + if (file_exists($filename) && !is_writable($filename)) + die("skip {$filename} not writable"); +} + ?> --FILE-- <?php diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt index 37d9cbdb77..9b07ac2479 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt @@ -16,6 +16,17 @@ if (count($tmp) < 2) if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1')) die("skip Test cannot be run against remote database server"); +$stmt = $db->query("SHOW VARIABLES LIKE 'secure_file_priv'"); +if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) { + if (!is_writable($row['value'])) + die("skip secure_file_priv directory not writable: {$row['value']}"); + + $filename = $row['value'] . DIRECTORY_SEPARATOR . "pdo_mysql_exec_load_data.csv"; + + if (file_exists($filename) && !is_writable($filename)) + die("skip {$filename} not writable"); +} + ?> --FILE-- <?php @@ -115,4 +126,4 @@ Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: %s in %s on li 1 => %d, 2 => %s, ) -done!
\ No newline at end of file +done! |