]> granicus.if.org Git - php/commitdiff
Global s/ini_get('unicode.semantics')/version check/ . Early PHP 6 times are gone...
authorUlf Wendel <uw@php.net>
Fri, 3 Jul 2009 08:42:25 +0000 (08:42 +0000)
committerUlf Wendel <uw@php.net>
Fri, 3 Jul 2009 08:42:25 +0000 (08:42 +0000)
13 files changed:
ext/mysql/tests/mysql_client_encoding.phpt
ext/mysql/tests/mysql_db_name.phpt
ext/mysql/tests/mysql_db_query.phpt
ext/mysql/tests/mysql_error.phpt
ext/mysql/tests/mysql_field_flags.phpt
ext/mysql/tests/mysql_get_client_info.phpt
ext/mysql/tests/mysql_get_host_info.phpt
ext/mysql/tests/mysql_get_server_info.phpt
ext/mysql/tests/mysql_info.phpt
ext/mysql/tests/mysql_list_dbs.phpt
ext/mysql/tests/mysql_list_processes.phpt
ext/mysql/tests/mysql_set_charset.phpt
ext/mysql/tests/mysql_stat.phpt

index 399b1e8704c7fd421d31fb6164604e5bad487b91..8aa67a03ac0b0f1ce120f35976a625d1c1dacefa 100644 (file)
@@ -50,7 +50,7 @@ if ($link_enc !== $tmp['charset']) {
        }
 }
 
-if (ini_get('unicode.semantics') && function_exists('is_unicode')) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && function_exists('is_unicode')) {
 // unicode mode
        if (!is_unicode($default_link_enc) || !is_unicode($link_enc)) {
                printf("[010] No unicode returned!\n");
index b1a03ed2cd57cd4b6e2736095ed4f7cdb7ad513e..be4f604d9c8707c6d79b640e34b186b86a69f17c 100644 (file)
@@ -34,7 +34,7 @@ if (false !== ($tmp = mysql_db_name($res, $num + 1)))
        printf("[006] Expecting boolean/false, got %s/%s. [%d] %s\n",
                gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));
 
-$unicode = (boolean)ini_get('unicode.semantics');
+$unicode = (boolean)(version_compare(PHP_VERSION, '5.9.9', '>') == 1);
 for ($i = 0; $i < $num; $i++) {
        if ('' === ($dbname = mysql_db_name($res, $i)))
                printf("[%03d] Got empty database name! [%d] %s\n",
index a3fc8c5608a9334d95a45f1933e2ee2851a2496d..bb837dd6c01dc4eb1a0666ace934469c5a63f577 100644 (file)
@@ -32,7 +32,7 @@ $row = mysql_fetch_assoc($res);
 if (1 != $row['id'])
        printf("[005] Expecting record 1/a, got record %s/%s\n", $row['id'], $row['label']);
 
-if (ini_get('unicode.semantics') && !is_unicode($row['label'])) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($row['label'])) {
        printf("[006] No unicode returned! [%d] %s\n", mysql_errno($link), mysql_error($link));
        var_inspect($row);
 }
@@ -47,7 +47,7 @@ $row = mysql_fetch_assoc($res);
 if (1 != $row['id'])
        printf("[008] Expecting record 1/a, got record %s/%s\n", $row['id'], $row['label']);
 
-if (ini_get('unicode.semantics') && !is_unicode($row['label'])) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($row['label'])) {
        printf("[009] No unicode returned! [%d] %s\n", mysql_errno(), mysql_error());
        var_inspect($row);
 }
index b92a646e88ff376145db8aa219b33053ca579357..aae4480174f73bf1341ce7a35e7cd07d754e6436 100644 (file)
@@ -39,7 +39,7 @@ $tmp = mysql_error($link);
 if (!is_string($tmp) || !preg_match("/Table '\w*\.test' doesn't exist/su", $tmp))
        printf("[006] Expecting string/[Table... doesn't exit], got %s/%s. [%d] %s\n", gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));
 
-if (ini_get('unicode.semantics') && !is_unicode($tmp)) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($tmp)) {
        printf("[007] Expecting Unicode error message!\n");
        var_inspect($tmp);
 }
index d655595f7d38a71908603ba7c38c14faf42c00de..75872182ff1210ae7c2ecaf9a7e83bec8aba3474 100644 (file)
@@ -32,7 +32,7 @@ if (false !== ($tmp = mysql_field_flags($res, -1)))
 if (!is_string($tmp = mysql_field_flags($res, 0)) || empty($tmp))
        printf("[006] Expecting non empty string, got %s/%s\n", gettype($tmp), $tmp);
 
-if (ini_get('unicode.semantics') && !is_unicode($tmp)) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($tmp)) {
        printf("[007] Check the unicode support!\n");
        var_inspect($tmp);
 }
index 2f8c62c916e4bfdd619883edad5f0a2094bd81f6..95de0ad5edceae6901874d6b988762771aadbbe9 100644 (file)
@@ -8,7 +8,7 @@ include "connect.inc";
 if (!is_string($info = mysql_get_client_info()) || ('' === $info))
        printf("[001] Expecting string/any_non_empty, got %s/%s\n", gettype($info), $info);
 
-if (ini_get('unicode.semantics') && !is_unicode($info)) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($info)) {
        printf("[002] Expecting Unicode!\n");
        var_inspect($info);
 }
index 4d60c21e8038fefcef347b8eeb46ff478a2aa3d9..443910c319041d27834a1868d1499e4679de35db 100644 (file)
@@ -25,7 +25,7 @@ if ($def_info !== $info) {
        var_dump($info);
 }
 
-if (ini_get('unicode.semantics') && !is_unicode($info)) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($info)) {
        printf("[005] Expecting Unicode error message!\n");
        var_inspect($info);
 }
index 037adfb44c563a4ccd77cf8e77492f87366aad7f..e806335e29c1178b6aeb6d69caa738088fd3bd67 100644 (file)
@@ -25,7 +25,7 @@ if ($def_info !== $info) {
        var_dump($info);
 }
 
-if (ini_get('unicode.semantics') && !is_unicode($info)) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($info)) {
        printf("[005] Expecting Unicode error message!\n");
        var_inspect($info);
 }
index ea73433f89fddc6341499db12ff1490ef9f3f31d..757c7fac818078d06829a22e1fab2a6afa69f07a 100644 (file)
@@ -46,7 +46,7 @@ if (!$res = mysql_query('UPDATE test SET label = "b" WHERE id >= 100', $link))
 if (!is_string($tmp = mysql_info($link)) || ('' == $tmp))
        printf("[012] Expecting string/any_non_empty, got %s/%s\n", gettype($tmp), $tmp);
 
-if (ini_get('unicode.semantics') && !is_unicode($tmp)) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($tmp)) {
        printf("[013] Expecting Unicode!\n");
        var_inspect($info);
 }
index 57a7efb451dffbe13951d820ce2477b0424f0a74..3e12ce5501cad33e80107b13d0a48716f9f61821 100644 (file)
@@ -27,7 +27,7 @@ if (!$num = mysql_num_rows($res))
        printf("[004] Empty database list? [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 $row = mysql_fetch_array($res, MYSQL_NUM);
-if (ini_get('unicode.semantics') && !is_unicode($row[0])) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($row[0])) {
        printf("[005] Check for unicode support\n");
        var_inspect($row);
 }
index 9cf51db61757867a98dca19125eef6f3b938ca51..b0c71ad1b41d3860a6a46ddb1a501408a4eece51 100644 (file)
@@ -1,8 +1,8 @@
 --TEST--
 mysql_list_processes()
 --SKIPIF--
-<?php 
-require_once('skipif.inc'); 
+<?php
+require_once('skipif.inc');
 require_once('skipifconnectfailure.inc');
 ?>
 --FILE--
@@ -24,7 +24,7 @@ if (!$num = mysql_num_rows($res))
        printf("[003] Empty process list? [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 $row = mysql_fetch_array($res, MYSQL_NUM);
-if (ini_get('unicode.semantics') && !is_unicode($row[0])) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($row[0])) {
        printf("[004] Check for unicode support\n");
        var_inspect($row);
 }
@@ -38,7 +38,7 @@ if (!$num = mysql_num_rows($res))
        printf("[006] Empty process list? [%d] %s\n", mysql_errno(), mysql_error());
 
 $row = mysql_fetch_array($res, MYSQL_NUM);
-if (ini_get('unicode.semantics') && !is_unicode($row[0])) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($row[0])) {
        printf("[007] Check for unicode support\n");
        var_inspect($row);
 }
index 946e8e05fd1d0397fce9b0eaa8713c1cdc72a2ea..953323b49c39d4ff7799c3b3ae19065f32c67be5 100644 (file)
@@ -38,7 +38,7 @@ if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))
 /* unicode mode should throw a warning */
 $tmp = mysql_set_charset('uFt8', $link);
 
-if (ini_get('unicode.semantics'))
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1))
        $expect = false;
 else
        $expect = true;
index bc5be9540d49a7b672e2a91fe7a1e76d08464665..288c53f067f0ddf24983da456cac48ab84fa6f35 100644 (file)
@@ -1,8 +1,8 @@
 --TEST--
 mysql_stat()
 --SKIPIF--
-<?php 
-require_once('skipif.inc'); 
+<?php
+require_once('skipif.inc');
 require_once('skipifconnectfailure.inc');
 ?>
 --FILE--
@@ -25,7 +25,7 @@ if ((!is_string($stat = mysql_stat($link))) || ('' === $stat))
        printf("[003] Expecting non empty string, got %s/'%s', [%d] %s\n",
                gettype($stat), $stat, mysql_errno($link), mysql_error($link));
 
-if (ini_get('unicode.semantics') && !is_unicode($stat)) {
+if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($stat)) {
        printf("[004] Expecting Unicode error message!\n");
        var_inspect($stat);
 }