summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 86f7bad8f2..4d37c0c651 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -2133,6 +2133,22 @@ PHP_FUNCTION(mysqli_stat)
}
/* }}} */
+
+/* {{{ proto bool mysqli_refresh(object link, long options)
+ Flush tables or caches, or reset replication server information */
+PHP_FUNCTION(mysqli_refresh)
+{
+ MY_MYSQL *mysql;
+ zval *mysql_link = NULL;
+ long options;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &options) == FAILURE) {
+ return;
+ }
+ MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_INITIALIZED);
+ RETURN_BOOL(!mysql_refresh(mysql->mysql, options));
+}
+/* }}} */
/* {{{ proto int mysqli_stmt_attr_set(object stmt, long attr, long mode) U
*/