mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- ZE2 fixes
This commit is contained in:
parent
9a3d4e736c
commit
a5afd0e9d0
7 changed files with 21 additions and 29 deletions
|
@ -76,9 +76,9 @@ int get_module_identifier(char * module_name) {
|
|||
|
||||
int split_dbx_handle_object(zval ** dbx_object, zval *** pdbx_handle, zval *** pdbx_module, zval *** pdbx_database) {
|
||||
convert_to_object_ex(dbx_object);
|
||||
if (zend_hash_find((*dbx_object)->value.obj.properties, "handle", 7, (void **) pdbx_handle)==FAILURE
|
||||
|| zend_hash_find((*dbx_object)->value.obj.properties, "module", 7, (void **) pdbx_module)==FAILURE
|
||||
|| zend_hash_find((*dbx_object)->value.obj.properties, "database", 9, (void **) pdbx_database)==FAILURE) {
|
||||
if (zend_hash_find(Z_OBJPROP_PP(dbx_object), "handle", 7, (void **) pdbx_handle)==FAILURE
|
||||
|| zend_hash_find(Z_OBJPROP_PP(dbx_object), "module", 7, (void **) pdbx_module)==FAILURE
|
||||
|| zend_hash_find(Z_OBJPROP_PP(dbx_object), "database", 9, (void **) pdbx_database)==FAILURE) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
|
@ -284,9 +284,9 @@ ZEND_FUNCTION(dbx_connect)
|
|||
RETURN_LONG(0);
|
||||
}
|
||||
|
||||
zend_hash_update(return_value->value.obj.properties, "handle", 7, (void *)&(rv_dbx_handle), sizeof(zval *), NULL);
|
||||
zend_hash_update(return_value->value.obj.properties, "module", 7, (void *)&(dbx_module), sizeof(zval *), NULL);
|
||||
zend_hash_update(return_value->value.obj.properties, "database", 9, (void *)&(db_name), sizeof(zval *), NULL);
|
||||
zend_hash_update(Z_OBJPROP_P(return_value), "handle", 7, (void *)&(rv_dbx_handle), sizeof(zval *), NULL);
|
||||
zend_hash_update(Z_OBJPROP_P(return_value), "module", 7, (void *)&(dbx_module), sizeof(zval *), NULL);
|
||||
zend_hash_update(Z_OBJPROP_P(return_value), "database", 9, (void *)&(db_name), sizeof(zval *), NULL);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -387,7 +387,7 @@ ZEND_FUNCTION(dbx_query)
|
|||
RETURN_LONG(0);
|
||||
}
|
||||
/* add result_handle property to return_value */
|
||||
zend_hash_update(return_value->value.obj.properties, "handle", 7, (void *)&(rv_result_handle), sizeof(zval *), NULL);
|
||||
zend_hash_update(Z_OBJPROP_P(return_value), "handle", 7, (void *)&(rv_result_handle), sizeof(zval *), NULL);
|
||||
/* init info property as array and add to return_value as a property */
|
||||
if (info_flags & DBX_RESULT_INFO) {
|
||||
MAKE_STD_ZVAL(info);
|
||||
|
@ -396,7 +396,7 @@ ZEND_FUNCTION(dbx_query)
|
|||
FREE_ZVAL(info);
|
||||
RETURN_LONG(0);
|
||||
}
|
||||
zend_hash_update(return_value->value.obj.properties, "info", 5, (void *)&(info), sizeof(zval *), NULL);
|
||||
zend_hash_update(Z_OBJPROP_P(return_value), "info", 5, (void *)&(info), sizeof(zval *), NULL);
|
||||
}
|
||||
/* init data property as array and add to return_value as a property */
|
||||
MAKE_STD_ZVAL(data);
|
||||
|
@ -405,7 +405,7 @@ ZEND_FUNCTION(dbx_query)
|
|||
FREE_ZVAL(data);
|
||||
RETURN_LONG(0);
|
||||
}
|
||||
zend_hash_update(return_value->value.obj.properties, "data", 5, (void *)&(data), sizeof(zval *), NULL);
|
||||
zend_hash_update(Z_OBJPROP_P(return_value), "data", 5, (void *)&(data), sizeof(zval *), NULL);
|
||||
/* get columncount and add to returnvalue as property */
|
||||
MAKE_STD_ZVAL(rv_column_count);
|
||||
ZVAL_LONG(rv_column_count, 0);
|
||||
|
@ -415,7 +415,7 @@ ZEND_FUNCTION(dbx_query)
|
|||
FREE_ZVAL(rv_column_count);
|
||||
RETURN_LONG(0);
|
||||
}
|
||||
zend_hash_update(return_value->value.obj.properties, "cols", 5, (void *)&(rv_column_count), sizeof(zval *), NULL);
|
||||
zend_hash_update(Z_OBJPROP_P(return_value), "cols", 5, (void *)&(rv_column_count), sizeof(zval *), NULL);
|
||||
/* fill the info array with columnnames and types (indexed and assoc) */
|
||||
if (info_flags & DBX_RESULT_INFO) {
|
||||
zval * info_row_name;
|
||||
|
@ -645,7 +645,7 @@ ZEND_FUNCTION(dbx_sort)
|
|||
RETURN_LONG(0);
|
||||
}
|
||||
|
||||
if (zend_hash_find((*arguments[0])->value.obj.properties, "data", 5, (void **) &zval_data)==FAILURE
|
||||
if (zend_hash_find(Z_OBJPROP_PP(arguments[0]), "data", 5, (void **) &zval_data)==FAILURE
|
||||
|| (*zval_data)->type != IS_ARRAY) {
|
||||
zend_error(E_WARNING, "Wrong argument type for sort");
|
||||
RETURN_LONG(0);
|
||||
|
@ -653,9 +653,8 @@ ZEND_FUNCTION(dbx_sort)
|
|||
|
||||
arguments[0] = zval_data;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "usort", &returned_zval, number_of_arguments, arguments);
|
||||
zval_dtor(returned_zval);
|
||||
FREE_ZVAL(returned_zval);
|
||||
|
||||
zval_ptr_dtor(&returned_zval);
|
||||
|
||||
RETURN_LONG(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_propert
|
|||
*object_handle = *return_value;
|
||||
pval_copy_constructor(object_handle);
|
||||
INIT_PZVAL(object_handle);
|
||||
zend_hash_index_update(object->value.obj.properties, 0, &object_handle, sizeof(pval *), NULL);
|
||||
zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL);
|
||||
pval_destructor(&function_name->element);
|
||||
} else {
|
||||
php_COM_call_function_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, property_reference);
|
||||
|
|
|
@ -2382,11 +2382,8 @@ PHP_FUNCTION(fbsql_fetch_assoc)
|
|||
PHP_FUNCTION(fbsql_fetch_object)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC);
|
||||
if (return_value->type==IS_ARRAY)
|
||||
{
|
||||
return_value->type=IS_OBJECT;
|
||||
return_value->value.obj.properties = return_value->value.ht;
|
||||
return_value->value.obj.ce = &zend_standard_class_def;
|
||||
if (return_value->type==IS_ARRAY) {
|
||||
object_and_properties_init(return_value, &zend_standard_class_def, return_value->value.ht);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
|
|
@ -117,7 +117,7 @@ static void *SWFgetProperty(zval *id, char *name, int namelen, int proptype TSRM
|
|||
|
||||
if(id)
|
||||
{
|
||||
if(zend_hash_find(id->value.obj.properties, name, namelen+1, (void **)&tmp) == FAILURE)
|
||||
if(zend_hash_find(Z_OBJPROP_P(id), name, namelen+1, (void **)&tmp) == FAILURE)
|
||||
{
|
||||
php_error(E_WARNING, "unable to find property %s", name);
|
||||
return NULL;
|
||||
|
|
|
@ -176,10 +176,8 @@ static int qdom_find_children( zval **children, struct qdom_node *orig_node TSRM
|
|||
struct qdom_attribute *attr = qdom_do_node_attributes( node );
|
||||
if ( qdom_find_attributes( &a_children, attr TSRMLS_CC) > 0 )
|
||||
{
|
||||
zend_hash_update(child->value.obj.properties,
|
||||
"attributes", sizeof("attributes"),
|
||||
(void *) &a_children, sizeof(zval *),
|
||||
NULL);
|
||||
zend_hash_update(Z_OBJPROP_P(child), "attributes", sizeof("attributes"),
|
||||
(void *) &a_children, sizeof(zval *), NULL);
|
||||
}
|
||||
qdom_do_attributes_free( attr );
|
||||
/* add_property_long(child, "attributes", num_attrs ); */
|
||||
|
|
|
@ -177,7 +177,7 @@ void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_propert
|
|||
*object_handle = *return_value;
|
||||
pval_copy_constructor(object_handle);
|
||||
INIT_PZVAL(object_handle);
|
||||
zend_hash_index_update(object->value.obj.properties, 0, &object_handle, sizeof(pval *), NULL);
|
||||
zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL);
|
||||
pval_destructor(&function_name->element);
|
||||
} else {
|
||||
php_COM_call_function_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, property_reference);
|
||||
|
|
|
@ -1384,9 +1384,7 @@ PHP_FUNCTION(sybase_fetch_object)
|
|||
{
|
||||
php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
if (return_value->type==IS_ARRAY) {
|
||||
return_value->type=IS_OBJECT;
|
||||
return_value->value.obj.properties = return_value->value.ht;
|
||||
return_value->value.obj.ce = &zend_standard_class_def;
|
||||
object_and_properties_init(return_value, &zend_standard_class_def, return_value->value.ht);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue