Skip to content

Deprecate oci8.old_oci_close_semantics #7258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion ext/oci8/oci8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/connect_scope_try2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/connect_scope_try4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/connect_scope_try6.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/drcp_conn_close1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/drcp_pconn_close1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/drcp_scope1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/drcp_scope3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/drcp_scope5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/ini_1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ext/oci8/tests/old_oci_close.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down