diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 9bc2e876c9c02..b0ddce339054a 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -127,6 +127,18 @@ ZEND_GET_MODULE(oci8) #include "oci8_arginfo.h" +static PHP_INI_MH(OnUpdateOldCloseSemantics) +{ + bool *p = (bool *) ZEND_INI_GET_ADDR(); + *p = zend_ini_parse_bool(new_value); + + if (p) { + zend_error(E_DEPRECATED, "Directive oci8.old_oci_close_semantics is deprecated"); + } + + return SUCCESS; +} + /* {{{ extension definition structures */ zend_module_entry oci8_module_entry = { @@ -155,7 +167,7 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("oci8.privileged_connect", "0", PHP_INI_SYSTEM, OnUpdateBool, privileged_connect, zend_oci_globals, oci_globals) STD_PHP_INI_ENTRY( "oci8.statement_cache_size", "20", PHP_INI_SYSTEM, OnUpdateLong, statement_cache_size, zend_oci_globals, oci_globals) STD_PHP_INI_ENTRY( "oci8.default_prefetch", "100", PHP_INI_SYSTEM, OnUpdateLong, default_prefetch, zend_oci_globals, oci_globals) - STD_PHP_INI_BOOLEAN("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateBool, old_oci_close_semantics,zend_oci_globals, oci_globals) + STD_PHP_INI_BOOLEAN("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateOldCloseSemantics, old_oci_close_semantics,zend_oci_globals, oci_globals) #if (OCI_MAJOR_VERSION >= 11) STD_PHP_INI_ENTRY( "oci8.connection_class", "", PHP_INI_ALL, OnUpdateString, connection_class, zend_oci_globals, oci_globals) #endif diff --git a/ext/oci8/tests/connect_scope_try2.phpt b/ext/oci8/tests/connect_scope_try2.phpt index c35b048ade3e0..8c9d27bd5932b 100644 --- a/ext/oci8/tests/connect_scope_try2.phpt +++ b/ext/oci8/tests/connect_scope_try2.phpt @@ -76,6 +76,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated Test 1 Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s resource(%d) of type (oci8 connection) diff --git a/ext/oci8/tests/connect_scope_try4.phpt b/ext/oci8/tests/connect_scope_try4.phpt index b4838462afb33..812f8437fb927 100644 --- a/ext/oci8/tests/connect_scope_try4.phpt +++ b/ext/oci8/tests/connect_scope_try4.phpt @@ -76,6 +76,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated Test 1 Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s resource(%d) of type (oci8 connection) diff --git a/ext/oci8/tests/connect_scope_try6.phpt b/ext/oci8/tests/connect_scope_try6.phpt index 5cbd037d0a10e..48fa6b2f63a7c 100644 --- a/ext/oci8/tests/connect_scope_try6.phpt +++ b/ext/oci8/tests/connect_scope_try6.phpt @@ -76,6 +76,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated Test 1 Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s resource(%d) of type (oci8 persistent connection) diff --git a/ext/oci8/tests/drcp_conn_close1.phpt b/ext/oci8/tests/drcp_conn_close1.phpt index 409fe958c4b56..49861ea446ead 100644 --- a/ext/oci8/tests/drcp_conn_close1.phpt +++ b/ext/oci8/tests/drcp_conn_close1.phpt @@ -38,6 +38,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated This is with a OCI_CONNECT resource(%d) of type (oci8 connection) resource(%d) of type (oci8 connection) diff --git a/ext/oci8/tests/drcp_pconn_close1.phpt b/ext/oci8/tests/drcp_pconn_close1.phpt index 84b7dfb7ab7ca..aa64c1d2b4ab4 100644 --- a/ext/oci8/tests/drcp_pconn_close1.phpt +++ b/ext/oci8/tests/drcp_pconn_close1.phpt @@ -37,6 +37,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated This is with a OCI_PCONNECT resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 persistent connection) diff --git a/ext/oci8/tests/drcp_scope1.phpt b/ext/oci8/tests/drcp_scope1.phpt index 7b88d2ba1f54d..72a718405a8ac 100644 --- a/ext/oci8/tests/drcp_scope1.phpt +++ b/ext/oci8/tests/drcp_scope1.phpt @@ -77,6 +77,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated This is with a OCI_NEW_CONNECT resource(%d) of type (oci8 connection) Update done-- DEPT value has been set to NEWDEPT diff --git a/ext/oci8/tests/drcp_scope3.phpt b/ext/oci8/tests/drcp_scope3.phpt index 7728301c3b7df..ef13a230228e1 100644 --- a/ext/oci8/tests/drcp_scope3.phpt +++ b/ext/oci8/tests/drcp_scope3.phpt @@ -51,6 +51,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated This is with a OCI_PCONNECT resource(%d) of type (oci8 persistent connection) Update done-- DEPT value has been set to NEWDEPT diff --git a/ext/oci8/tests/drcp_scope5.phpt b/ext/oci8/tests/drcp_scope5.phpt index d167642d13f33..1d71878b84de5 100644 --- a/ext/oci8/tests/drcp_scope5.phpt +++ b/ext/oci8/tests/drcp_scope5.phpt @@ -55,6 +55,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated This is with a OCI_PCONNECT resource(%d) of type (oci8 persistent connection) Update done-- DEPT value has been set to NEWDEPT diff --git a/ext/oci8/tests/ini_1.phpt b/ext/oci8/tests/ini_1.phpt index 00a2b2bbd76ec..3bc2c539be225 100644 --- a/ext/oci8/tests/ini_1.phpt +++ b/ext/oci8/tests/ini_1.phpt @@ -55,6 +55,7 @@ echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') ?> --EXPECT-- +Directive oci8.old_oci_close_semantics is deprecated Test 1 - check initialization oci8.privileged_connect = 1 oci8.max_persistent = 111 diff --git a/ext/oci8/tests/old_oci_close.phpt b/ext/oci8/tests/old_oci_close.phpt index b965467be7e3a..ee1d87bdc2b06 100644 --- a/ext/oci8/tests/old_oci_close.phpt +++ b/ext/oci8/tests/old_oci_close.phpt @@ -17,6 +17,7 @@ echo "Done\n"; ?> --EXPECTF-- +Directive oci8.old_oci_close_semantics is deprecated resource(%d) of type (oci8 connection) NULL resource(%d) of type (oci8 statement)