johannes                Thu Jan 22 20:57:33 2009 UTC

  Modified files:              
    /php-src/ext/mysqlnd        mysqlnd_enum_n_def.h mysqlnd_libmysql_compat.h 
    /php-src/ext/mysqli mysqli.c mysqli_api.c mysqli_fe.c 
                        php_mysqli_structs.h 
  Log:
  - Export mysql_refresh to mysqli (mysqli_refresh(), $mysqli->refresh())
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_enum_n_def.h?r1=1.12&r2=1.13&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_enum_n_def.h
diff -u php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.12 
php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.13
--- php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.12       Wed Dec 31 11:12:33 2008
+++ php-src/ext/mysqlnd/mysqlnd_enum_n_def.h    Thu Jan 22 20:57:31 2009
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_enum_n_def.h,v 1.12 2008/12/31 11:12:33 sebastian Exp $ */
+/* $Id: mysqlnd_enum_n_def.h,v 1.13 2009/01/22 20:57:31 johannes Exp $ */
 #ifndef MYSQLND_ENUM_N_DEF_H
 #define MYSQLND_ENUM_N_DEF_H
 
@@ -431,6 +431,15 @@
 
 #define MYSQLND_DEFAULT_PREFETCH_ROWS (ulong) 1
 
+#define MYSQLND_REFRESH_GRANT      1   /* Refresh grant tables */
+#define MYSQLND_REFRESH_LOG        2   /* Start on new log file */
+#define MYSQLND_REFRESH_TABLES     4   /* close all tables */
+#define MYSQLND_REFRESH_HOSTS     8    /* Flush host cache */
+#define MYSQLND_REFRESH_STATUS     16  /* Flush status variables */
+#define MYSQLND_REFRESH_THREADS    32  /* Flush thread cache */
+#define MYSQLND_REFRESH_SLAVE      64  /* Reset master info and restart slave 
*/
+#define MYSQLND_REFRESH_MASTER     128 /* Remove all bin logs in the index */
+#define MYSQLND_REFRESH_BACKUP_LOG 0x200000L
 
 #endif /* MYSQLND_ENUM_N_DEF_H */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h?r1=1.9&r2=1.10&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h
diff -u php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h:1.9 
php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h:1.10
--- php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h:1.9   Wed Dec 31 11:12:33 2008
+++ php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h       Thu Jan 22 20:57:31 2009
@@ -73,6 +73,7 @@
 #define mysql_ping(r)                                  mysqlnd_ping((r))
 #define mysql_real_escape_string(r,a,b,c) mysqlnd_real_escape_string((r), (a), 
(b), (c))
 #define mysql_real_query(r,a,b)                        mysqlnd_query((r), (a), 
(b))
+#define mysql_refresh(conn, options)   mysqlnd_refresh((conn), (options))
 #define mysql_rollback(r)                              mysqlnd_rollback((r))
 #define mysql_select_db(r,a)                   mysqlnd_select_db((r), (a) 
,strlen((a)))
 #define mysql_set_server_option(r,o)   mysqlnd_set_server_option((r), (o))
@@ -118,4 +119,14 @@
 #define mysql_warning_count(r)                 mysqlnd_warning_count((r))
 #define mysql_eof(r)                                   (((r)->unbuf && 
(r)->unbuf->eof_reached) || (r)->stored_data)
 
+#define REFRESH_GRANT      MYSQLND_REFRESH_GRANT
+#define REFRESH_LOG        MYSQLND_REFRESH_LOG
+#define REFRESH_TABLES     MYSQLND_REFRESH_TABLES
+#define REFRESH_HOSTS      MYSQLND_REFRESH_HOSTS
+#define REFRESH_STATUS     MYSQLND_REFRESH_STATUS
+#define REFRESH_THREADS    MYSQLND_REFRESH_THREADS
+#define REFRESH_SLAVE      MYSQLND_REFRESH_SLAVE
+#define REFRESH_MASTER     MYSQLND_REFRESH_MASTER
+#define REFRESH_BACKUP_LOG MYSQLND_REFRESH_BACKUP_LOG
+
 #endif /* MYSQLND_LIBMYSQL_COMPAT_H */
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.142&r2=1.143&diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.142 php-src/ext/mysqli/mysqli.c:1.143
--- php-src/ext/mysqli/mysqli.c:1.142   Mon Jan 12 12:54:17 2009
+++ php-src/ext/mysqli/mysqli.c Thu Jan 22 20:57:32 2009
@@ -17,7 +17,7 @@
   |          Ulf Wendel <u...@php.net>                                     |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli.c,v 1.142 2009/01/12 12:54:17 johannes Exp $ 
+  $Id: mysqli.c,v 1.143 2009/01/22 20:57:32 johannes Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -869,6 +869,18 @@
        REGISTER_LONG_CONSTANT("MYSQLI_SERVER_QUERY_WAS_SLOW", 
SERVER_QUERY_WAS_SLOW, CONST_CS | CONST_PERSISTENT);
 #endif
 
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_GRANT",      REFRESH_GRANT, 
CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_LOG",        REFRESH_LOG, 
CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_TABLES",     REFRESH_TABLES, 
CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_HOSTS",      REFRESH_HOSTS, 
CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_STATUS",     REFRESH_STATUS, 
CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_THREADS",    REFRESH_THREADS, 
CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_SLAVE",      REFRESH_SLAVE, 
CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_MASTER",     REFRESH_MASTER, 
CONST_CS | CONST_PERSISTENT);
+#ifdef REFRESH_BACKUP_LOG
+       REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_BACKUP_LOG", REFRESH_BACKUP_LOG, 
CONST_CS | CONST_PERSISTENT);
+#endif
+
        return SUCCESS;
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.171&r2=1.172&diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.171 
php-src/ext/mysqli/mysqli_api.c:1.172
--- php-src/ext/mysqli/mysqli_api.c:1.171       Fri Jan  9 14:28:31 2009
+++ php-src/ext/mysqli/mysqli_api.c     Thu Jan 22 20:57:32 2009
@@ -17,7 +17,7 @@
   |          Ulf Wendel <u...@php.net>                                     |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_api.c,v 1.171 2009/01/09 14:28:31 johannes Exp $ 
+  $Id: mysqli_api.c,v 1.172 2009/01/22 20:57:32 johannes Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -2133,6 +2133,22 @@
 }
 
 /* }}} */
+
+/* {{{ 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
 */
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_fe.c?r1=1.69&r2=1.70&diff_format=u
Index: php-src/ext/mysqli/mysqli_fe.c
diff -u php-src/ext/mysqli/mysqli_fe.c:1.69 php-src/ext/mysqli/mysqli_fe.c:1.70
--- php-src/ext/mysqli/mysqli_fe.c:1.69 Mon Jan 12 14:01:47 2009
+++ php-src/ext/mysqli/mysqli_fe.c      Thu Jan 22 20:57:32 2009
@@ -17,7 +17,7 @@
   |          Ulf Wendel <u...@php.net>                                     |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_fe.c,v 1.69 2009/01/12 14:01:47 johannes Exp $ 
+  $Id: mysqli_fe.c,v 1.70 2009/01/22 20:57:32 johannes Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -180,6 +180,8 @@
        PHP_FE(mysqli_use_result,                                               
        NULL)
        PHP_FE(mysqli_warning_count,                                            
NULL)
 
+       PHP_FE(mysqli_refresh,                                                  
NULL)
+
        /* Aliases */
        PHP_FALIAS(mysqli_bind_param,           mysqli_stmt_bind_param,         
third_arg_force_by_ref_rest)
        PHP_FALIAS(mysqli_bind_result,          mysqli_stmt_bind_result,        
second_arg_force_by_ref_rest)
@@ -254,6 +256,7 @@
        PHP_FALIAS(store_result,mysqli_store_result,NULL)
        PHP_FALIAS(thread_safe,mysqli_thread_safe,NULL)
        PHP_FALIAS(use_result,mysqli_use_result,NULL)
+       PHP_FALIAS(refresh,mysqli_refresh,NULL)
        {NULL, NULL, NULL}
 };
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/php_mysqli_structs.h?r1=1.19&r2=1.20&diff_format=u
Index: php-src/ext/mysqli/php_mysqli_structs.h
diff -u php-src/ext/mysqli/php_mysqli_structs.h:1.19 
php-src/ext/mysqli/php_mysqli_structs.h:1.20
--- php-src/ext/mysqli/php_mysqli_structs.h:1.19        Wed Dec 31 11:12:33 2008
+++ php-src/ext/mysqli/php_mysqli_structs.h     Thu Jan 22 20:57:32 2009
@@ -15,7 +15,7 @@
   | Author: Georg Richter <ge...@php.net>                                |
   +----------------------------------------------------------------------+
 
-  $Id: php_mysqli_structs.h,v 1.19 2008/12/31 11:12:33 sebastian Exp $ 
+  $Id: php_mysqli_structs.h,v 1.20 2009/01/22 20:57:32 johannes Exp $ 
 */
 
 #ifndef PHP_MYSQLI_STRUCTS_H
@@ -483,6 +483,7 @@
 PHP_FUNCTION(mysqli_sqlstate);
 PHP_FUNCTION(mysqli_ssl_set);
 PHP_FUNCTION(mysqli_stat);
+PHP_FUNCTION(mysqli_refresh);
 PHP_FUNCTION(mysqli_stmt_affected_rows);
 PHP_FUNCTION(mysqli_stmt_close);
 PHP_FUNCTION(mysqli_stmt_data_seek);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to