Skip to content

Commit a6fa097

Browse files
committed
No more need to cater to pre-PHP-5.3 or PHP-6 versions
1 parent 0d568b9 commit a6fa097

File tree

5 files changed

+8
-43
lines changed

5 files changed

+8
-43
lines changed

ext/mysqli/tests/connect.inc

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,6 @@
2727
false;
2828

2929
$IS_MYSQLND = stristr(mysqli_get_client_info(), "mysqlnd");
30-
if (!$IS_MYSQLND) {
31-
$MYSQLND_VERSION = NULL;
32-
} else {
33-
/*
34-
The formatting of the version reported by mysqli_get_client_info()
35-
has changed significantly in the past. To get tests working properly
36-
with PHP 5.3.0 and up, we set everything that looks like prior to
37-
PHP 5.3.0 to version 5.0.4 = 5 * 10000 + 0 * 100 + 4 = 50004.
38-
PHP 5.3.0 reports mysqlnd 5.0.5 dev (= 5 * 10000 + 0 * 100 + 5 = 50005.
39-
*/
40-
if (preg_match('@Revision:\s+(\d+)\s*\$@ism', mysqli_get_client_info(), $matches)) {
41-
/* something prior to PHP 5.3.0 */
42-
$MYSQLND_VERSION = 50004;
43-
} else if (preg_match('@^mysqlnd (\d+)\.(\d+)\.(\d+).*@ism', mysqli_get_client_info(), $matches)) {
44-
/* formatting schema used by PHP 5.3.0 */
45-
$MYSQLND_VERSION = (int)$matches[1] * 10000 + (int)$matches[2] * 100 + (int)$matches[3];
46-
} else if (preg_match('@^mysqlnd/PHP 6.0.0-dev@ism', mysqli_get_client_info(), $matches)) {
47-
/*
48-
PHP 6.0 at the time of the first PHP 5.3.0 release.
49-
HEAD and 5.3 have been in sync when 5.3.0 was released.
50-
It is at least 5.0.5-dev.
51-
*/
52-
$MYSQLND_VERSION = 50005;
53-
} else {
54-
/* unknown */
55-
$MYSQLND_VERSION = -1;
56-
}
57-
58-
}
5930

6031
if (!function_exists('sys_get_temp_dir')) {
6132
function sys_get_temp_dir() {

ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ require_once('skipifemb.inc');
77
require_once('connect.inc');
88

99
/*
10-
Let's not deal with cross-version issues in the EXPECTF/UEXPECTF.
10+
Let's not deal with cross-version issues in the EXPECTF section.
1111
Most of the things which we test are covered by mysqli_class_*_interface.phpt.
1212
Those tests go into the details and are aimed to be a development tool, no more.
1313
*/
1414
if (!$IS_MYSQLND)
15-
die("skip Test has been written for the latest version of mysqlnd only");
16-
if ($MYSQLND_VERSION < 50004)
17-
die("skip Test requires mysqlnd Revision 5.0.4 or newer");
15+
die("skip Test has been written for mysqlnd only");
1816

1917
?>
2018
--FILE--

ext/mysqli/tests/mysqli_class_mysqli_result_reflection.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ require_once('skipifconnectfailure.inc');
88
require_once('connect.inc');
99

1010
/*
11-
Let's not deal with cross-version issues in the EXPECTF/UEXPECTF.
11+
Let's not deal with cross-version issues in the EXPECTF section.
1212
Most of the things which we test are covered by mysqli_class_*_interface.phpt.
1313
Those tests go into the details and are aimed to be a development tool, no more.
1414
*/
1515
if (!$IS_MYSQLND)
16-
die("skip Test has been written for the latest version of mysqlnd only");
17-
if ($MYSQLND_VERSION < 50004)
18-
die("skip Test requires mysqlnd Revision 5.0.4 or newer");
16+
die("skip Test has been written for mysqlnd only");
1917
?>
2018
--FILE--
2119
<?php

ext/mysqli/tests/mysqli_class_mysqli_warning_reflection.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ require_once('skipifemb.inc');
77
require_once('connect.inc');
88

99
/*
10-
Let's not deal with cross-version issues in the EXPECTF/UEXPECTF.
10+
Let's not deal with cross-version issues in the EXPECTF section.
1111
Most of the things which we test are covered by mysqli_class_*_interface.phpt.
1212
Those tests go into the details and are aimed to be a development tool, no more.
1313
*/
1414
if (!$IS_MYSQLND)
15-
die("skip Test has been written for the latest version of mysqlnd only");
16-
if ($MYSQLND_VERSION < 50004)
17-
die("skip Test requires mysqlnd Revision 5.0.4 or newer");
15+
die("skip Test has been written for mysqlnd only");
1816
?>
1917
--FILE--
2018
<?php

ext/mysqli/tests/mysqli_debug_ini.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ if (defined('MYSQLI_DEBUG_TRACE_ENABLED') && !MYSQLI_DEBUG_TRACE_ENABLED)
1616
die("skip: debug functionality not enabled");
1717

1818
require_once('connect.inc');
19-
if (!$IS_MYSQLND || ($MYSQLND_VERSION < 50004))
20-
die("skip needs mysqlnd version/revision 5.0.4");
19+
if (!$IS_MYSQLND)
20+
die("skip needs mysqlnd");
2121

2222
if (!$fp = @fopen('/tmp/mysqli_debug_phpt.trace', 'w'))
2323
die("skip PHP cannot create a file in /tmp/mysqli_debug_phpt");

0 commit comments

Comments
 (0)