mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Blame me for not checking in a version that's been cleaned up with
regards to Whitespace/CS...
This commit is contained in:
parent
2135a5b3f6
commit
e8ed078f81
1 changed files with 51 additions and 51 deletions
|
@ -4,59 +4,59 @@ Constants exported by ext/mysql
|
||||||
<?php require_once('skipif.inc'); ?>
|
<?php require_once('skipif.inc'); ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
require("connect.inc");
|
require("connect.inc");
|
||||||
require("table.inc");
|
require("table.inc");
|
||||||
|
|
||||||
$constants = get_defined_constants(true);
|
$constants = get_defined_constants(true);
|
||||||
sort($constants);
|
sort($constants);
|
||||||
|
|
||||||
$expected_constants = array(
|
$expected_constants = array(
|
||||||
'MYSQL_ASSOC' => true,
|
'MYSQL_ASSOC' => true,
|
||||||
'MYSQL_NUM' => true,
|
'MYSQL_NUM' => true,
|
||||||
'MYSQL_BOTH' => true,
|
'MYSQL_BOTH' => true,
|
||||||
'MYSQL_CLIENT_COMPRESS' => true,
|
'MYSQL_CLIENT_COMPRESS' => true,
|
||||||
'MYSQL_CLIENT_INTERACTIVE' => true,
|
'MYSQL_CLIENT_INTERACTIVE' => true,
|
||||||
'MYSQL_CLIENT_IGNORE_SPACE' => true,
|
'MYSQL_CLIENT_IGNORE_SPACE' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
$version = mysql_get_server_info($link);
|
$version = mysql_get_server_info($link);
|
||||||
if (!preg_match('@(\d+)\.(\d+)\.(\d+)@ism', $version, $matches))
|
if (!preg_match('@(\d+)\.(\d+)\.(\d+)@ism', $version, $matches))
|
||||||
printf("[001] Cannot get server version\n");
|
printf("[001] Cannot get server version\n");
|
||||||
$version = ($matches[1] * 100) + ($matches[2] * 10) + $matches[3];
|
$version = ($matches[1] * 100) + ($matches[2] * 10) + $matches[3];
|
||||||
|
|
||||||
if ($version > 400) {
|
if ($version > 400) {
|
||||||
$expected_constants = array_merge($expected_constants, array(
|
$expected_constants = array_merge($expected_constants, array(
|
||||||
"MYSQL_CLIENT_SSL" => true,
|
"MYSQL_CLIENT_SSL" => true,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$unexpected_constants = array();
|
$unexpected_constants = array();
|
||||||
|
|
||||||
foreach ($constants as $group => $consts) {
|
foreach ($constants as $group => $consts) {
|
||||||
foreach ($consts as $name => $value) {
|
foreach ($consts as $name => $value) {
|
||||||
if (stristr($name, 'mysql') && !stristr($name, 'mysqli')) {
|
if (stristr($name, 'mysql') && !stristr($name, 'mysqli')) {
|
||||||
$name = strtoupper($name);
|
$name = strtoupper($name);
|
||||||
if (isset($expected_constants[$name])) {
|
if (isset($expected_constants[$name])) {
|
||||||
unset($expected_constants[$name]);
|
unset($expected_constants[$name]);
|
||||||
} else {
|
} else {
|
||||||
$unexpected_constants[$name] = $name;
|
$unexpected_constants[$name] = $name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($unexpected_constants)) {
|
if (!empty($unexpected_constants)) {
|
||||||
printf("Dumping list of unexpected constants\n");
|
printf("Dumping list of unexpected constants\n");
|
||||||
var_dump($unexpected_constants);
|
var_dump($unexpected_constants);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($expected_constants)) {
|
if (!empty($expected_constants)) {
|
||||||
printf("Dumping list of missing constants\n");
|
printf("Dumping list of missing constants\n");
|
||||||
var_dump($expected_constants);
|
var_dump($expected_constants);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "done!";
|
print "done!";
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
done!
|
done!
|
Loading…
Add table
Add a link
Reference in a new issue