georg           Fri Jun  3 04:49:01 2005 EDT

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/mysqli php_mysqli.h mysqli_nonapi.c mysqli_fe.c 
  Log:
  added new function mysqli_get_charset
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1904&r2=1.1905&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1904 php-src/NEWS:1.1905
--- php-src/NEWS:1.1904 Sun May 29 12:51:24 2005
+++ php-src/NEWS        Fri Jun  3 04:48:58 2005
@@ -57,6 +57,13 @@
   . pg_result_error_field() - highly detailed error information, 
     most importantly the SQLSTATE error code.
   . pg_set_error_verbosity() - set verbosity of errors.
+- Improved extension mysqli (Georg)
+  . added constructor for mysqli_stmt and mysqli_result classes
+  . added new function mysqli_get_charset
+  . added new class mysqli_driver
+  . added new class mysqli_warning
+  . added new class mysqli_execption 
+  . added new class mysqli_sql_exception
 - Added optional fifth parameter "count" to preg_replace_callback() and
   preg_replace() to count the number of replacements made. FR #32275. (Andrey)
 - Added optional third parameter "charlist" to str_word_count() which
@@ -65,10 +72,7 @@
 - Added pg_field_type_oid() PostgreSQL function. (mauroi at digbang dot com)
 - Added zend_declare_property_...() and zend_update_property_...()
   API functions for bool, double and binary safe strings. (Hartmut)
-- Added new classes in mysqli: mysqli_driver, mysqli_warning, mysqli_exception,
-  and mysqli_sql_exception. (Georg)
 - Added possibility to access INI variables from within .ini file. (Andrei)
-- Added constructors for mysqli_stmt and mysqli_result classes. (Georg)
 - Added variable $_SERVER['REQUEST_TIME'] containing request start time. (Ilia)
 - Added optional float parameter to gettimeofday(). (Ilia)
 - Added apache_reset_timeout() Apache1 function. (Rasmus)
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.48&r2=1.49&ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.48 
php-src/ext/mysqli/php_mysqli.h:1.49
--- php-src/ext/mysqli/php_mysqli.h:1.48        Sat May 21 04:46:45 2005
+++ php-src/ext/mysqli/php_mysqli.h     Fri Jun  3 04:49:00 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: php_mysqli.h,v 1.48 2005/05/21 08:46:45 georg Exp $ 
+  $Id: php_mysqli.h,v 1.49 2005/06/03 08:49:00 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -95,6 +95,32 @@
        void    *userdata;
 } mysqli_local_infile;
 
+typedef struct {
+  uint                         number;
+  uint                         primary_number;
+  uint                         binary_number;
+  uint                         state;
+  const char           *csname;
+  const char           *name;
+  const char           *comment;
+  const char           *tailoring;
+  unsigned char                *ctype;
+  unsigned char                *to_lower;
+  unsigned char                *to_upper;
+  unsigned char                *sort_order;
+  unsigned short       *contractions;
+  unsigned short       **sort_order_big;
+  unsigned short       *tab_to_uni;
+  void                         *tab_from_uni;
+  unsigned char                *state_map;
+  unsigned char                *ident_map;
+  uint                         strxfrm_multiply;
+  uint                         mbminlen;
+  uint                         mbmaxlen;
+  unsigned short       min_sort_char;
+  unsigned short       max_sort_char; /* For LIKE optimization */
+} CHARSET_INFO;
+
 #define phpext_mysqli_ptr &mysqli_module_entry
 
 #ifdef PHP_WIN32
@@ -326,6 +352,7 @@
 PHP_FUNCTION(mysqli_field_seek);
 PHP_FUNCTION(mysqli_field_tell);
 PHP_FUNCTION(mysqli_free_result);
+PHP_FUNCTION(mysqli_get_charset);
 PHP_FUNCTION(mysqli_get_client_info);
 PHP_FUNCTION(mysqli_get_client_version);
 PHP_FUNCTION(mysqli_get_host_info);
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.45&r2=1.46&ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.45 
php-src/ext/mysqli/mysqli_nonapi.c:1.46
--- php-src/ext/mysqli/mysqli_nonapi.c:1.45     Fri May 13 09:56:04 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Fri Jun  3 04:49:01 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_nonapi.c,v 1.45 2005/05/13 13:56:04 georg Exp $ 
+  $Id: mysqli_nonapi.c,v 1.46 2005/06/03 08:49:01 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -274,6 +274,31 @@
 /* }}} */
 #endif
 
+/* {{{ object mysqli_get_charset(object link) 
+   returns a character set object */
+PHP_FUNCTION(mysqli_get_charset)
+{
+       MY_MYSQL                                *mysql;
+       zval                                    *mysql_link;
+       CHARSET_INFO                    *cs;
+
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+               return;
+       }
+       MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link");
+
+       object_init(return_value);
+
+       cs = (CHARSET_INFO *)mysql->mysql->charset;
+
+       add_property_string(return_value, "charset", (cs->name) ? (char 
*)cs->csname : "", 1);
+       add_property_string(return_value, "collation",(cs->name) ? (char 
*)cs->name : "", 1);
+       add_property_string(return_value, "comment", (cs->comment) ? (char 
*)cs->comment : "", 1);
+       add_property_long(return_value, "min_length", cs->mbminlen);
+       add_property_long(return_value, "max_length", cs->mbmaxlen);
+}
+/* }}} */
+
 /*
  * Local variables:
  * tab-width: 4
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_fe.c?r1=1.44&r2=1.45&ty=u
Index: php-src/ext/mysqli/mysqli_fe.c
diff -u php-src/ext/mysqli/mysqli_fe.c:1.44 php-src/ext/mysqli/mysqli_fe.c:1.45
--- php-src/ext/mysqli/mysqli_fe.c:1.44 Fri May 13 09:11:40 2005
+++ php-src/ext/mysqli/mysqli_fe.c      Fri Jun  3 04:49:01 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_fe.c,v 1.44 2005/05/13 13:11:40 georg Exp $ 
+  $Id: mysqli_fe.c,v 1.45 2005/06/03 08:49:01 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -85,6 +85,7 @@
        PHP_FE(mysqli_field_seek,                                               
        NULL)
        PHP_FE(mysqli_field_tell,                                               
        NULL)
        PHP_FE(mysqli_free_result,                                              
        NULL)
+       PHP_FE(mysqli_get_charset,                                              
        NULL)
        PHP_FE(mysqli_get_client_info,                                          
NULL)
        PHP_FE(mysqli_get_client_version,                                       
NULL)
        PHP_FE(mysqli_get_host_info,                                            
NULL)
@@ -191,6 +192,7 @@
        PHP_FALIAS(dump_debug_info,mysqli_dump_debug_info,NULL)
        
PHP_FALIAS(enable_reads_from_master,mysqli_enable_reads_from_master,NULL)
        PHP_FALIAS(enable_rpl_parse,mysqli_enable_rpl_parse,NULL)
+       PHP_FALIAS(get_charset,mysqli_get_charset,NULL)
        PHP_FALIAS(get_client_info,mysqli_get_client_info,NULL)
        PHP_FALIAS(get_server_info,mysqli_get_server_info,NULL)
        PHP_FALIAS(get_warnings, mysqli_warning_construct,      NULL)

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

Reply via email to