Skip to content

Commit e120d52

Browse files
authored
Deprecate oci8.old_oci_close_semantics (#7258)
1 parent 6632874 commit e120d52

11 files changed

+23
-1
lines changed

ext/oci8/oci8.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,18 @@ ZEND_GET_MODULE(oci8)
127127

128128
#include "oci8_arginfo.h"
129129

130+
static PHP_INI_MH(OnUpdateOldCloseSemantics)
131+
{
132+
bool *p = (bool *) ZEND_INI_GET_ADDR();
133+
*p = zend_ini_parse_bool(new_value);
134+
135+
if (p) {
136+
zend_error(E_DEPRECATED, "Directive oci8.old_oci_close_semantics is deprecated");
137+
}
138+
139+
return SUCCESS;
140+
}
141+
130142
/* {{{ extension definition structures */
131143

132144
zend_module_entry oci8_module_entry = {
@@ -155,7 +167,7 @@ PHP_INI_BEGIN()
155167
STD_PHP_INI_BOOLEAN("oci8.privileged_connect", "0", PHP_INI_SYSTEM, OnUpdateBool, privileged_connect, zend_oci_globals, oci_globals)
156168
STD_PHP_INI_ENTRY( "oci8.statement_cache_size", "20", PHP_INI_SYSTEM, OnUpdateLong, statement_cache_size, zend_oci_globals, oci_globals)
157169
STD_PHP_INI_ENTRY( "oci8.default_prefetch", "100", PHP_INI_SYSTEM, OnUpdateLong, default_prefetch, zend_oci_globals, oci_globals)
158-
STD_PHP_INI_BOOLEAN("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateBool, old_oci_close_semantics,zend_oci_globals, oci_globals)
170+
STD_PHP_INI_BOOLEAN("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateOldCloseSemantics, old_oci_close_semantics,zend_oci_globals, oci_globals)
159171
#if (OCI_MAJOR_VERSION >= 11)
160172
STD_PHP_INI_ENTRY( "oci8.connection_class", "", PHP_INI_ALL, OnUpdateString, connection_class, zend_oci_globals, oci_globals)
161173
#endif

ext/oci8/tests/connect_scope_try2.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ echo "Done\n";
7676

7777
?>
7878
--EXPECTF--
79+
Directive oci8.old_oci_close_semantics is deprecated
7980
Test 1
8081
Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s
8182
resource(%d) of type (oci8 connection)

ext/oci8/tests/connect_scope_try4.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ echo "Done\n";
7676

7777
?>
7878
--EXPECTF--
79+
Directive oci8.old_oci_close_semantics is deprecated
7980
Test 1
8081
Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s
8182
resource(%d) of type (oci8 connection)

ext/oci8/tests/connect_scope_try6.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ echo "Done\n";
7676

7777
?>
7878
--EXPECTF--
79+
Directive oci8.old_oci_close_semantics is deprecated
7980
Test 1
8081
Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s
8182
resource(%d) of type (oci8 persistent connection)

ext/oci8/tests/drcp_conn_close1.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ echo "Done\n";
3838

3939
?>
4040
--EXPECTF--
41+
Directive oci8.old_oci_close_semantics is deprecated
4142
This is with a OCI_CONNECT
4243
resource(%d) of type (oci8 connection)
4344
resource(%d) of type (oci8 connection)

ext/oci8/tests/drcp_pconn_close1.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ echo "Done\n";
3737

3838
?>
3939
--EXPECTF--
40+
Directive oci8.old_oci_close_semantics is deprecated
4041
This is with a OCI_PCONNECT
4142
resource(%d) of type (oci8 persistent connection)
4243
resource(%d) of type (oci8 persistent connection)

ext/oci8/tests/drcp_scope1.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ echo "Done\n";
7777

7878
?>
7979
--EXPECTF--
80+
Directive oci8.old_oci_close_semantics is deprecated
8081
This is with a OCI_NEW_CONNECT
8182
resource(%d) of type (oci8 connection)
8283
Update done-- DEPT value has been set to NEWDEPT

ext/oci8/tests/drcp_scope3.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ echo "Done\n";
5151

5252
?>
5353
--EXPECTF--
54+
Directive oci8.old_oci_close_semantics is deprecated
5455
This is with a OCI_PCONNECT
5556
resource(%d) of type (oci8 persistent connection)
5657
Update done-- DEPT value has been set to NEWDEPT

ext/oci8/tests/drcp_scope5.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ echo "Done\n";
5555

5656
?>
5757
--EXPECTF--
58+
Directive oci8.old_oci_close_semantics is deprecated
5859
This is with a OCI_PCONNECT
5960
resource(%d) of type (oci8 persistent connection)
6061
Update done-- DEPT value has been set to NEWDEPT

ext/oci8/tests/ini_1.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics')
5555

5656
?>
5757
--EXPECT--
58+
Directive oci8.old_oci_close_semantics is deprecated
5859
Test 1 - check initialization
5960
oci8.privileged_connect = 1
6061
oci8.max_persistent = 111

ext/oci8/tests/old_oci_close.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ echo "Done\n";
1717

1818
?>
1919
--EXPECTF--
20+
Directive oci8.old_oci_close_semantics is deprecated
2021
resource(%d) of type (oci8 connection)
2122
NULL
2223
resource(%d) of type (oci8 statement)

0 commit comments

Comments
 (0)