Skip to content

Commit 5756063

Browse files
committed
ext/pgsql: pgsql.allow_persistent, no need to use such large type for boolean state.
also ext/odbc, simplifying odd comparison with non persistent connections.
1 parent 1fc85a3 commit 5756063

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ext/odbc/php_odbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
22192219
}
22202220
}
22212221

2222-
if (ODBCG(allow_persistent) <= 0) {
2222+
if (!ODBCG(allow_persistent)) {
22232223
persistent = 0;
22242224
}
22252225

ext/pgsql/pgsql.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ PHP_INI_BEGIN()
406406
STD_PHP_INI_BOOLEAN( "pgsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_persistent, zend_pgsql_globals, pgsql_globals)
407407
STD_PHP_INI_ENTRY_EX("pgsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_pgsql_globals, pgsql_globals, display_link_numbers)
408408
STD_PHP_INI_ENTRY_EX("pgsql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_pgsql_globals, pgsql_globals, display_link_numbers)
409-
STD_PHP_INI_BOOLEAN( "pgsql.auto_reset_persistent", "0", PHP_INI_SYSTEM, OnUpdateBool, auto_reset_persistent, zend_pgsql_globals, pgsql_globals)
409+
STD_PHP_INI_BOOLEAN( "pgsql.auto_reset_persistent", "0", PHP_INI_SYSTEM, OnUpdateLong, auto_reset_persistent, zend_pgsql_globals, pgsql_globals)
410410
STD_PHP_INI_BOOLEAN( "pgsql.ignore_notice", "0", PHP_INI_ALL, OnUpdateBool, ignore_notices, zend_pgsql_globals, pgsql_globals)
411411
STD_PHP_INI_BOOLEAN( "pgsql.log_notice", "0", PHP_INI_ALL, OnUpdateBool, log_notices, zend_pgsql_globals, pgsql_globals)
412412
PHP_INI_END()

ext/pgsql/php_pgsql.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static const php_stream_ops php_stream_pgsql_fd_ops = {
184184
ZEND_BEGIN_MODULE_GLOBALS(pgsql)
185185
zend_long num_links,num_persistent;
186186
zend_long max_links,max_persistent;
187-
zend_long allow_persistent;
187+
bool allow_persistent;
188188
zend_long auto_reset_persistent;
189189
int ignore_notices,log_notices;
190190
zend_object *default_link; /* default link when connection is omitted */

0 commit comments

Comments
 (0)