From: Tianfang Yang Date: Mon, 14 Aug 2017 03:44:24 +0000 (-0400) Subject: Sync OCI8 on PHP 7.x branches X-Git-Tag: php-7.0.23RC1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5552247432bd71b68fc22260dd4ef109074b717;p=php Sync OCI8 on PHP 7.x branches --- diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index a7055e4d65..9e0ea69120 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | + | Authors: Stig Sæther Bakken | | Thies C. Arntzen | | | | Collection support by Andy Sautins | diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index b0a8104827..5da3084520 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | + | Authors: Stig Sæther Bakken | | Thies C. Arntzen | | | | Collection support by Andy Sautins | @@ -56,13 +56,21 @@ PHP_FUNCTION(oci_register_taf_callback) } if (callback) { +#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2) + if (!zend_is_callable(callback, 0, 0)) { + callback_name = zend_get_callable_name(callback); + php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name)); + zend_string_release(callback_name); + RETURN_FALSE; + } +#else if (!zend_is_callable(callback, 0, &callback_name)) { php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name)); zend_string_release(callback_name); RETURN_FALSE; } - zend_string_release(callback_name); +#endif } PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index d8755d1cfa..5e3107edfc 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | + | Authors: Stig Sæther Bakken | | Thies C. Arntzen | | | | Collection support by Andy Sautins | diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 470d8d0d94..7639340c12 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | + | Authors: Stig Sæther Bakken | | Thies C. Arntzen | | | | Collection support by Andy Sautins | diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index c236f6c19f..e70e2fe09c 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | + | Authors: Stig Sæther Bakken | | Thies C. Arntzen | | | | Collection support by Andy Sautins | diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index 5e74bb0096..97ccbd5776 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | + | Authors: Stig Sæther Bakken | | Thies C. Arntzen | | | | Collection support by Andy Sautins | diff --git a/ext/oci8/tests/bug72524.phpt b/ext/oci8/tests/bug72524.phpt index dde99b000c..45ce8c7d5b 100644 --- a/ext/oci8/tests/bug72524.phpt +++ b/ext/oci8/tests/bug72524.phpt @@ -1,96 +1,96 @@ ---TEST-- -Bug #72524 (Binding null values triggers ORA-24816 error) ---SKIPIF-- - true, 'timesten' => true); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -?> ---FILE-- - - -===DONE=== - ---EXPECTF-- -Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default -bool(true) -Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default -bool(true) -Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default -bool(true) -Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default - -Warning: oci_execute(): ORA-24816: %s in %s on line %d -bool(false) -Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default - -Warning: oci_execute(): ORA-24816: %s in %s on line %d -bool(false) -===DONE=== +--TEST-- +Bug #72524 (Binding null values triggers ORA-24816 error) +--SKIPIF-- + true, 'timesten' => true); // test runs on these DBs +require(dirname(__FILE__).'/skipif.inc'); +?> +--FILE-- + + +===DONE=== + +--EXPECTF-- +Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default +bool(true) +Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default +bool(true) +Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default +bool(true) +Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default + +Warning: oci_execute(): ORA-24816: %s in %s on line %d +bool(false) +Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default + +Warning: oci_execute(): ORA-24816: %s in %s on line %d +bool(false) +===DONE=== diff --git a/ext/oci8/tests/coll_019.phpt b/ext/oci8/tests/coll_019.phpt index 371c802ede..e0c896dce1 100644 --- a/ext/oci8/tests/coll_019.phpt +++ b/ext/oci8/tests/coll_019.phpt @@ -13,7 +13,7 @@ require(dirname(__FILE__).'/skipif.inc'); require dirname(__FILE__)."/connect.inc"; -$ora_sql = "DROP TYPE ".$type_name;; +$ora_sql = "DROP TYPE ".$type_name; $statement = oci_parse($c,$ora_sql); @oci_execute($statement); diff --git a/ext/oci8/tests/lob_040.phpt b/ext/oci8/tests/lob_040.phpt index 0a29dc1b9e..0d60054b22 100644 --- a/ext/oci8/tests/lob_040.phpt +++ b/ext/oci8/tests/lob_040.phpt @@ -29,9 +29,9 @@ for ($i = 0; $i < NUMLOBS; $i++) { } for ($i = 0; $i < NUMLOBS; $i++) { - echo "Row $i Size: " . $row[$i][0]->size() . "\n";; + echo "Row $i Size: " . $row[$i][0]->size() . "\n"; echo "Pos 1: " . $row[$i][0]->tell() . "\n"; - echo "Data: " . $row[$i][0]->read(5) . "\n";; + echo "Data: " . $row[$i][0]->read(5) . "\n"; echo "Pos 2: " . $row[$i][0]->tell() . "\n"; echo "Data: " . $row[$i][0]->read(12) . "\n"; } diff --git a/ext/oci8/tests/xmltype_02.phpt b/ext/oci8/tests/xmltype_02.phpt index 28e9401baf..9a17f5db18 100644 --- a/ext/oci8/tests/xmltype_02.phpt +++ b/ext/oci8/tests/xmltype_02.phpt @@ -69,7 +69,7 @@ var_dump($row); echo "Test 2 Manipulate the data using SimpleXML\n"; -$sx = simplexml_load_string((binary)$row[0]->load()); +$sx = simplexml_load_string($row[0]->load()); $row[0]->free(); var_dump($sx); @@ -178,4 +178,4 @@ string(%d) " %sVClearance>10 " -===DONE=== \ No newline at end of file +===DONE===