summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2009-01-22 20:57:32 +0000
committerJohannes Schlüter <johannes@php.net>2009-01-22 20:57:32 +0000
commitd15503bfcc6dc4550374392013b1e83ad51e243c (patch)
tree7c4f2da0c30f6c28cc6abdac6be0c62692671812 /ext/mysqli/mysqli_api.c
parentd504b65dd848393c3171add770045482c986d844 (diff)
downloadphp-git-d15503bfcc6dc4550374392013b1e83ad51e243c.tar.gz
- Export mysql_refresh to mysqli (mysqli_refresh(), $mysqli->refresh())
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
*/