version 1.1, 2012/02/21 23:47:58
|
version 1.1.1.3, 2013/07/22 01:31:55
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2013 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 30
|
Line 30
|
#include "php_ini.h" |
#include "php_ini.h" |
#include "ext/standard/info.h" |
#include "ext/standard/info.h" |
#include "ext/standard/php_string.h" |
#include "ext/standard/php_string.h" |
|
#include "php_mysqli.h" |
#include "php_mysqli_structs.h" |
#include "php_mysqli_structs.h" |
#include "mysqli_priv.h" |
#include "mysqli_priv.h" |
#include "zend_exceptions.h" |
#include "zend_exceptions.h" |
|
#include "zend_interfaces.h" |
|
|
ZEND_DECLARE_MODULE_GLOBALS(mysqli) |
ZEND_DECLARE_MODULE_GLOBALS(mysqli) |
static PHP_GINIT_FUNCTION(mysqli); |
static PHP_GINIT_FUNCTION(mysqli); |
Line 160 void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC)
|
Line 162 void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC)
|
{ |
{ |
if (stmt->stmt) { |
if (stmt->stmt) { |
if (mysqli_stmt_close(stmt->stmt, TRUE)) { |
if (mysqli_stmt_close(stmt->stmt, TRUE)) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occured while closing statement"); | php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occurred while closing statement"); |
return; |
return; |
} |
} |
} |
} |
Line 313 static int mysqli_write_na(mysqli_object *obj, zval *n
|
Line 315 static int mysqli_write_na(mysqli_object *obj, zval *n
|
|
|
|
|
/* {{{ mysqli_read_property */ |
/* {{{ mysqli_read_property */ |
zval *mysqli_read_property(zval *object, zval *member, int type TSRMLS_DC) | zval *mysqli_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) |
{ |
{ |
zval tmp_member; |
zval tmp_member; |
zval *retval; |
zval *retval; |
Line 345 zval *mysqli_read_property(zval *object, zval *member,
|
Line 347 zval *mysqli_read_property(zval *object, zval *member,
|
} |
} |
} else { |
} else { |
zend_object_handlers * std_hnd = zend_get_std_object_handlers(); |
zend_object_handlers * std_hnd = zend_get_std_object_handlers(); |
retval = std_hnd->read_property(object, member, type TSRMLS_CC); | retval = std_hnd->read_property(object, member, type, key TSRMLS_CC); |
} |
} |
|
|
if (member == &tmp_member) { |
if (member == &tmp_member) { |
Line 356 zval *mysqli_read_property(zval *object, zval *member,
|
Line 358 zval *mysqli_read_property(zval *object, zval *member,
|
/* }}} */ |
/* }}} */ |
|
|
/* {{{ mysqli_write_property */ |
/* {{{ mysqli_write_property */ |
void mysqli_write_property(zval *object, zval *member, zval *value TSRMLS_DC) | void mysqli_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) |
{ |
{ |
zval tmp_member; |
zval tmp_member; |
mysqli_object *obj; |
mysqli_object *obj; |
Line 384 void mysqli_write_property(zval *object, zval *member,
|
Line 386 void mysqli_write_property(zval *object, zval *member,
|
} |
} |
} else { |
} else { |
zend_object_handlers * std_hnd = zend_get_std_object_handlers(); |
zend_object_handlers * std_hnd = zend_get_std_object_handlers(); |
std_hnd->write_property(object, member, value TSRMLS_CC); | std_hnd->write_property(object, member, value, key TSRMLS_CC); |
} |
} |
|
|
if (member == &tmp_member) { |
if (member == &tmp_member) { |
Line 405 void mysqli_add_property(HashTable *h, const char *pna
|
Line 407 void mysqli_add_property(HashTable *h, const char *pna
|
} |
} |
/* }}} */ |
/* }}} */ |
|
|
static int mysqli_object_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */ | static int mysqli_object_has_property(zval *object, zval *member, int has_set_exists, const zend_literal *key TSRMLS_DC) /* {{{ */ |
{ |
{ |
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); |
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); |
mysqli_prop_handler p; |
mysqli_prop_handler p; |
Line 417 static int mysqli_object_has_property(zval *object, zv
|
Line 419 static int mysqli_object_has_property(zval *object, zv
|
ret = 1; |
ret = 1; |
break; |
break; |
case 1: { |
case 1: { |
zval *value = mysqli_read_property(object, member, BP_VAR_IS TSRMLS_CC); | zval *value = mysqli_read_property(object, member, BP_VAR_IS, key TSRMLS_CC); |
if (value != EG(uninitialized_zval_ptr)) { |
if (value != EG(uninitialized_zval_ptr)) { |
convert_to_boolean(value); |
convert_to_boolean(value); |
ret = Z_BVAL_P(value)? 1:0; |
ret = Z_BVAL_P(value)? 1:0; |
Line 428 static int mysqli_object_has_property(zval *object, zv
|
Line 430 static int mysqli_object_has_property(zval *object, zv
|
break; |
break; |
} |
} |
case 0:{ |
case 0:{ |
zval *value = mysqli_read_property(object, member, BP_VAR_IS TSRMLS_CC); | zval *value = mysqli_read_property(object, member, BP_VAR_IS, key TSRMLS_CC); |
if (value != EG(uninitialized_zval_ptr)) { |
if (value != EG(uninitialized_zval_ptr)) { |
ret = Z_TYPE_P(value) != IS_NULL? 1:0; |
ret = Z_TYPE_P(value) != IS_NULL? 1:0; |
/* refcount is 0 */ |
/* refcount is 0 */ |
Line 442 static int mysqli_object_has_property(zval *object, zv
|
Line 444 static int mysqli_object_has_property(zval *object, zv
|
} |
} |
} else { |
} else { |
zend_object_handlers * std_hnd = zend_get_std_object_handlers(); |
zend_object_handlers * std_hnd = zend_get_std_object_handlers(); |
ret = std_hnd->has_property(object, member, has_set_exists TSRMLS_CC); | ret = std_hnd->has_property(object, member, has_set_exists, key TSRMLS_CC); |
} |
} |
return ret; |
return ret; |
} /* }}} */ |
} /* }}} */ |
Line 465 HashTable * mysqli_object_get_debug_info(zval *object,
|
Line 467 HashTable * mysqli_object_get_debug_info(zval *object,
|
zval *value; |
zval *value; |
INIT_ZVAL(member); |
INIT_ZVAL(member); |
ZVAL_STRINGL(&member, entry->name, entry->name_len, 0); |
ZVAL_STRINGL(&member, entry->name, entry->name_len, 0); |
value = mysqli_read_property(object, &member, BP_VAR_IS TSRMLS_CC); | value = mysqli_read_property(object, &member, BP_VAR_IS, 0 TSRMLS_CC); |
if (value != EG(uninitialized_zval_ptr)) { |
if (value != EG(uninitialized_zval_ptr)) { |
Z_ADDREF_P(value); |
Z_ADDREF_P(value); |
zend_hash_add(retval, entry->name, entry->name_len + 1, &value, sizeof(zval *), NULL); |
zend_hash_add(retval, entry->name, entry->name_len + 1, &value, sizeof(zval *), NULL); |
Line 484 PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_ne
|
Line 486 PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_ne
|
{ |
{ |
zend_object_value retval; |
zend_object_value retval; |
mysqli_object *intern; |
mysqli_object *intern; |
zval *tmp; |
|
zend_class_entry *mysqli_base_class; |
zend_class_entry *mysqli_base_class; |
zend_objects_free_object_storage_t free_storage; |
zend_objects_free_object_storage_t free_storage; |
|
|
Line 502 PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_ne
|
Line 503 PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_ne
|
(void **) &intern->prop_handler); |
(void **) &intern->prop_handler); |
|
|
zend_object_std_init(&intern->zo, class_type TSRMLS_CC); |
zend_object_std_init(&intern->zo, class_type TSRMLS_CC); |
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, | object_properties_init(&intern->zo, class_type); |
(void *) &tmp, sizeof(zval *)); | |
|
|
/* link object */ |
/* link object */ |
if (instanceof_function(class_type, mysqli_link_class_entry TSRMLS_CC)) { |
if (instanceof_function(class_type, mysqli_link_class_entry TSRMLS_CC)) { |
Line 527 PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_ne
|
Line 527 PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_ne
|
} |
} |
/* }}} */ |
/* }}} */ |
|
|
|
#ifdef MYSQLI_USE_MYSQLND |
|
#include "ext/mysqlnd/mysqlnd_reverse_api.h" |
|
static MYSQLND *mysqli_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC) |
|
{ |
|
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJCE_P(zv) == mysqli_link_class_entry) { |
|
MY_MYSQL * mysql; |
|
MYSQLI_RESOURCE * my_res; |
|
mysqli_object * intern = (mysqli_object *)zend_object_store_get_object(zv TSRMLS_CC); |
|
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) { |
|
/* We know that we have a mysqli object, so this failure should be emitted */ |
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name); |
|
return NULL; |
|
} |
|
mysql = (MY_MYSQL *)(my_res->ptr); |
|
return mysql ? mysql->mysql : NULL; |
|
} |
|
return NULL; |
|
} |
|
|
|
static MYSQLND_REVERSE_API mysqli_reverse_api = { |
|
&mysqli_module_entry, |
|
mysqli_convert_zv_to_mysqlnd |
|
}; |
|
#endif |
|
|
/* {{{ PHP_INI_BEGIN |
/* {{{ PHP_INI_BEGIN |
*/ |
*/ |
PHP_INI_BEGIN() |
PHP_INI_BEGIN() |
Line 646 PHP_MINIT_FUNCTION(mysqli)
|
Line 670 PHP_MINIT_FUNCTION(mysqli)
|
zend_hash_init(&mysqli_result_properties, 0, NULL, NULL, 1); |
zend_hash_init(&mysqli_result_properties, 0, NULL, NULL, 1); |
MYSQLI_ADD_PROPERTIES(&mysqli_result_properties, mysqli_result_property_entries); |
MYSQLI_ADD_PROPERTIES(&mysqli_result_properties, mysqli_result_property_entries); |
MYSQLI_ADD_PROPERTIES_INFO(ce, mysqli_result_property_info_entries); |
MYSQLI_ADD_PROPERTIES_INFO(ce, mysqli_result_property_info_entries); |
|
mysqli_result_class_entry->get_iterator = php_mysqli_result_get_iterator; |
|
mysqli_result_class_entry->iterator_funcs.funcs = &php_mysqli_result_iterator_funcs; |
|
zend_class_implements(mysqli_result_class_entry TSRMLS_CC, 1, zend_ce_traversable); |
zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_result_properties, sizeof(mysqli_result_properties), NULL); |
zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_result_properties, sizeof(mysqli_result_properties), NULL); |
|
|
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_stmt", mysqli_stmt_class_entry, mysqli_stmt_methods); |
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_stmt", mysqli_stmt_class_entry, mysqli_stmt_methods); |
Line 783 PHP_MINIT_FUNCTION(mysqli)
|
Line 810 PHP_MINIT_FUNCTION(mysqli)
|
#ifdef MYSQLI_USE_MYSQLND |
#ifdef MYSQLI_USE_MYSQLND |
REGISTER_LONG_CONSTANT("MYSQLI_DEBUG_TRACE_ENABLED", MYSQLND_DBG_ENABLED, CONST_CS | CONST_PERSISTENT); |
REGISTER_LONG_CONSTANT("MYSQLI_DEBUG_TRACE_ENABLED", MYSQLND_DBG_ENABLED, CONST_CS | CONST_PERSISTENT); |
#else |
#else |
#ifndef DBUG_OFF | #ifdef DBUG_ON |
REGISTER_LONG_CONSTANT("MYSQLI_DEBUG_TRACE_ENABLED", 0, CONST_CS | CONST_PERSISTENT); | |
#else | |
REGISTER_LONG_CONSTANT("MYSQLI_DEBUG_TRACE_ENABLED", 1, CONST_CS | CONST_PERSISTENT); |
REGISTER_LONG_CONSTANT("MYSQLI_DEBUG_TRACE_ENABLED", 1, CONST_CS | CONST_PERSISTENT); |
|
#else |
|
REGISTER_LONG_CONSTANT("MYSQLI_DEBUG_TRACE_ENABLED", 0, CONST_CS | CONST_PERSISTENT); |
#endif |
#endif |
#endif |
#endif |
|
|
Line 811 PHP_MINIT_FUNCTION(mysqli)
|
Line 838 PHP_MINIT_FUNCTION(mysqli)
|
REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_BACKUP_LOG", REFRESH_BACKUP_LOG, CONST_CS | CONST_PERSISTENT); |
REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_BACKUP_LOG", REFRESH_BACKUP_LOG, CONST_CS | CONST_PERSISTENT); |
#endif |
#endif |
|
|
|
#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND) |
|
REGISTER_LONG_CONSTANT("MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS", MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, CONST_CS | CONST_PERSISTENT); |
|
#endif |
|
|
|
#ifdef MYSQLI_USE_MYSQLND |
|
mysqlnd_reverse_api_register_api(&mysqli_reverse_api TSRMLS_CC); |
|
#endif |
|
|
return SUCCESS; |
return SUCCESS; |
} |
} |
/* }}} */ |
/* }}} */ |
Line 1083 PHP_FUNCTION(mysqli_result_construct)
|
Line 1118 PHP_FUNCTION(mysqli_result_construct)
|
} |
} |
/* }}} */ |
/* }}} */ |
|
|
/* {{{ php_mysqli_fetch_into_hash | |
| /* {{{ php_mysqli_fetch_into_hash_aux |
*/ |
*/ |
void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags, int into_object) | void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, long fetchtype TSRMLS_DC) |
{ |
{ |
MYSQL_RES *result; |
|
zval *mysql_result; |
|
long fetchtype; |
|
zval *ctor_params = NULL; |
|
zend_class_entry *ce = NULL; |
|
#if !defined(MYSQLI_USE_MYSQLND) |
#if !defined(MYSQLI_USE_MYSQLND) |
|
MYSQL_ROW row; |
unsigned int i; |
unsigned int i; |
MYSQL_FIELD *fields; |
MYSQL_FIELD *fields; |
MYSQL_ROW row; |
|
unsigned long *field_len; |
unsigned long *field_len; |
zend_bool magic_quotes_warning_sent = FALSE; | |
#endif | |
| |
if (into_object) { | |
char *class_name; | |
int class_name_len; | |
| |
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|sz", &mysql_result, mysqli_result_class_entry, &class_name, &class_name_len, &ctor_params) == FAILURE) { | |
return; | |
} | |
if (ZEND_NUM_ARGS() < (getThis() ? 1 : 2)) { | |
ce = zend_standard_class_def; | |
} else { | |
ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); | |
} | |
if (!ce) { | |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name); | |
return; | |
} | |
fetchtype = MYSQLI_ASSOC; | |
} else { | |
if (override_flags) { | |
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { | |
return; | |
} | |
fetchtype = override_flags; | |
} else { | |
fetchtype = MYSQLI_BOTH; | |
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) { | |
return; | |
} | |
} | |
} | |
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); | |
| |
if (fetchtype < MYSQLI_ASSOC || fetchtype > MYSQLI_BOTH) { | |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH"); | |
RETURN_FALSE; | |
} | |
| |
#if !defined(MYSQLI_USE_MYSQLND) | |
if (!(row = mysql_fetch_row(result))) { |
if (!(row = mysql_fetch_row(result))) { |
RETURN_NULL(); |
RETURN_NULL(); |
} |
} |
Line 1179 void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARA
|
Line 1170 void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARA
|
#endif |
#endif |
{ |
{ |
|
|
|
#if PHP_API_VERSION < 20100412 |
/* check if we need magic quotes */ |
/* check if we need magic quotes */ |
if (PG(magic_quotes_runtime)) { |
if (PG(magic_quotes_runtime)) { |
if (magic_quotes_warning_sent == FALSE) { |
|
magic_quotes_warning_sent = TRUE; |
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "magic_quotes_runtime are deprecated since PHP 5.3"); |
|
} |
|
Z_TYPE_P(res) = IS_STRING; |
Z_TYPE_P(res) = IS_STRING; |
Z_STRVAL_P(res) = php_addslashes(row[i], field_len[i], &Z_STRLEN_P(res), 0 TSRMLS_CC); |
Z_STRVAL_P(res) = php_addslashes(row[i], field_len[i], &Z_STRLEN_P(res), 0 TSRMLS_CC); |
} else { |
} else { |
|
#endif |
ZVAL_STRINGL(res, row[i], field_len[i], 1); |
ZVAL_STRINGL(res, row[i], field_len[i], 1); |
|
#if PHP_API_VERSION < 20100412 |
} |
} |
|
#endif |
} |
} |
|
|
if (fetchtype & MYSQLI_NUM) { |
if (fetchtype & MYSQLI_NUM) { |
Line 1211 void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARA
|
Line 1202 void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARA
|
} |
} |
} |
} |
#else |
#else |
if (PG(magic_quotes_runtime)) { | mysqlnd_fetch_into(result, ((fetchtype & MYSQLI_NUM)? MYSQLND_FETCH_NUM:0) | ((fetchtype & MYSQLI_ASSOC)? MYSQLND_FETCH_ASSOC:0), return_value, MYSQLND_MYSQLI); |
HashPosition pos_values; | #endif |
zval **entry_values; | } |
zval new_return_value; | /* }}} */ |
char * string_key; | |
uint string_key_len; | |
ulong num_key; | |
|
|
mysqlnd_fetch_into(result, ((fetchtype & MYSQLI_NUM)? MYSQLND_FETCH_NUM:0) | ((fetchtype & MYSQLI_ASSOC)? MYSQLND_FETCH_ASSOC:0), &new_return_value, MYSQLND_MYSQLI); | |
if (Z_TYPE(new_return_value) == IS_ARRAY) { | /* {{{ php_mysqli_fetch_into_hash |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "magic_quotes_runtime are deprecated since PHP 5.3"); | */ |
array_init(return_value); | void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags, int into_object) |
zend_hash_internal_pointer_reset_ex(Z_ARRVAL(new_return_value), &pos_values); | { |
while (zend_hash_get_current_data_ex(Z_ARRVAL(new_return_value), (void **)&entry_values, &pos_values) == SUCCESS) { | MYSQL_RES *result; |
if (Z_TYPE_PP(entry_values) == IS_STRING) { | zval *mysql_result; |
int new_str_len; | long fetchtype; |
char * new_str = php_addslashes(Z_STRVAL_PP(entry_values), Z_STRLEN_PP(entry_values), &new_str_len, 0 TSRMLS_CC); | zval *ctor_params = NULL; |
switch (zend_hash_get_current_key_ex(Z_ARRVAL(new_return_value), &string_key, &string_key_len, &num_key, 0, &pos_values)) { | zend_class_entry *ce = NULL; |
case HASH_KEY_IS_LONG: | |
add_index_stringl(return_value, num_key, new_str, new_str_len, 0); | if (into_object) { |
break; | char *class_name; |
case HASH_KEY_IS_STRING: | int class_name_len; |
add_assoc_stringl_ex(return_value, string_key, string_key_len, new_str, new_str_len, 0); | |
break; | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|sz", &mysql_result, mysqli_result_class_entry, &class_name, &class_name_len, &ctor_params) == FAILURE) { |
} | return; |
} else { | } |
zval_add_ref(entry_values); | if (ZEND_NUM_ARGS() < (getThis() ? 1 : 2)) { |
switch (zend_hash_get_current_key_ex(Z_ARRVAL(new_return_value), &string_key, &string_key_len, &num_key, 0, &pos_values)) { | ce = zend_standard_class_def; |
case HASH_KEY_IS_LONG: | |
add_index_zval(return_value, num_key, *entry_values); | |
break; | |
case HASH_KEY_IS_STRING: | |
add_assoc_zval_ex(return_value, string_key, string_key_len, *entry_values); | |
break; | |
} | |
} | |
zend_hash_move_forward_ex(Z_ARRVAL(new_return_value), &pos_values); | |
} | |
} else { |
} else { |
RETVAL_NULL(); | ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); |
} |
} |
zval_dtor(&new_return_value); | if (!ce) { |
| php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name); |
| return; |
| } |
| fetchtype = MYSQLI_ASSOC; |
} else { |
} else { |
mysqlnd_fetch_into(result, ((fetchtype & MYSQLI_NUM)? MYSQLND_FETCH_NUM:0) | ((fetchtype & MYSQLI_ASSOC)? MYSQLND_FETCH_ASSOC:0), return_value, MYSQLND_MYSQLI); | if (override_flags) { |
| if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { |
| return; |
| } |
| fetchtype = override_flags; |
| } else { |
| fetchtype = MYSQLI_BOTH; |
| if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) { |
| return; |
| } |
| } |
} |
} |
|
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); |
|
|
#endif | if (fetchtype < MYSQLI_ASSOC || fetchtype > MYSQLI_BOTH) { |
| php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH"); |
| RETURN_FALSE; |
| } |
|
|
if (into_object && Z_TYPE_P(return_value) != IS_NULL) { | php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype TSRMLS_CC); |
| |
| if (into_object && Z_TYPE_P(return_value) == IS_ARRAY) { |
zval dataset = *return_value; |
zval dataset = *return_value; |
zend_fcall_info fci; |
zend_fcall_info fci; |
zend_fcall_info_cache fcc; |
zend_fcall_info_cache fcc; |