mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
added new function mysqli_get_charset
This commit is contained in:
parent
d3a665248d
commit
d486da963e
10
NEWS
10
NEWS
@ -57,6 +57,13 @@ PHP NEWS
|
||||
. 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 @@ PHP NEWS
|
||||
- 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)
|
||||
|
@ -85,6 +85,7 @@ function_entry mysqli_functions[] = {
|
||||
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 @@ function_entry mysqli_link_methods[] = {
|
||||
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)
|
||||
|
@ -274,6 +274,31 @@ PHP_FUNCTION(mysqli_set_charset)
|
||||
/* }}} */
|
||||
#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
|
||||
|
@ -95,6 +95,32 @@ typedef struct {
|
||||
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_count);
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user