-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Feature request #78555 - Add the option to disable dblink cleanup #8697
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,6 +372,22 @@ PHP_FUNCTION(mysqli_debug) | |
} | ||
/* }}} */ | ||
|
||
/* {{{ Turn link cleanup on or off when the object is destroyed */ | ||
PHP_FUNCTION(mysqli_disable_cleanup) | ||
{ | ||
MY_MYSQL *mysql; | ||
zval *mysql_link; | ||
bool enable; | ||
|
||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &mysql_link, mysqli_link_class_entry, &enable) == FAILURE) { | ||
RETURN_THROWS(); | ||
} | ||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); | ||
mysql->disable_cleanup = enable; | ||
RETURN_TRUE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to me that a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would agree. I looked at the mysqli_debug() function which returned a bool and made it similar: https://github.com/php/php-src/blob/master/ext/mysqli/mysqli_api.c#L371 |
||
} | ||
/* }}} */ | ||
|
||
/* {{{ */ | ||
PHP_FUNCTION(mysqli_dump_debug_info) | ||
{ | ||
|
@@ -862,6 +878,7 @@ void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS, bool is_method) | |
RETURN_FALSE; | ||
} | ||
|
||
mysql->disable_cleanup = false; | ||
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); | ||
mysqli_resource->ptr = (void *)mysql; | ||
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED; | ||
|
Uh oh!
There was an error while loading. Please reload this page.