version 1.1.1.1, 2012/02/21 23:47:53
|
version 1.1.1.2, 2012/05/29 12:34:36
|
Line 29
|
Line 29
|
#include "php_com_dotnet_internal.h" |
#include "php_com_dotnet_internal.h" |
#include "Zend/zend_exceptions.h" |
#include "Zend/zend_exceptions.h" |
|
|
static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC) | static zval *com_property_read(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) |
{ |
{ |
zval *return_value; |
zval *return_value; |
php_com_dotnet_object *obj; |
php_com_dotnet_object *obj; |
Line 64 static zval *com_property_read(zval *object, zval *mem
|
Line 64 static zval *com_property_read(zval *object, zval *mem
|
return return_value; |
return return_value; |
} |
} |
|
|
static void com_property_write(zval *object, zval *member, zval *value TSRMLS_DC) | static void com_property_write(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) |
{ |
{ |
php_com_dotnet_object *obj; |
php_com_dotnet_object *obj; |
VARIANT v; |
VARIANT v; |
Line 196 static zval *com_object_get(zval *property TSRMLS_DC)
|
Line 196 static zval *com_object_get(zval *property TSRMLS_DC)
|
} |
} |
#endif |
#endif |
|
|
static int com_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC) | static int com_property_exists(zval *object, zval *member, int check_empty, const zend_literal *key TSRMLS_DC) |
{ |
{ |
DISPID dispid; |
DISPID dispid; |
php_com_dotnet_object *obj; |
php_com_dotnet_object *obj; |
Line 222 static int com_dimension_exists(zval *object, zval *me
|
Line 222 static int com_dimension_exists(zval *object, zval *me
|
return 0; |
return 0; |
} |
} |
|
|
static void com_property_delete(zval *object, zval *member TSRMLS_DC) | static void com_property_delete(zval *object, zval *member, const zend_literal *key TSRMLS_DC) |
{ |
{ |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); |
} |
} |
Line 246 static void function_dtor(void *pDest)
|
Line 246 static void function_dtor(void *pDest)
|
{ |
{ |
zend_internal_function *f = (zend_internal_function*)pDest; |
zend_internal_function *f = (zend_internal_function*)pDest; |
|
|
efree(f->function_name); | efree((char*)f->function_name); |
if (f->arg_info) { |
if (f->arg_info) { |
efree(f->arg_info); |
efree(f->arg_info); |
} |
} |
Line 259 static PHP_FUNCTION(com_method_handler)
|
Line 259 static PHP_FUNCTION(com_method_handler)
|
INTERNAL_FUNCTION_PARAM_PASSTHRU); |
INTERNAL_FUNCTION_PARAM_PASSTHRU); |
} |
} |
|
|
static union _zend_function *com_method_get(zval **object_ptr, char *name, int len TSRMLS_DC) | static union _zend_function *com_method_get(zval **object_ptr, char *name, int len, const zend_literal *key TSRMLS_DC) |
{ |
{ |
zend_internal_function f, *fptr = NULL; |
zend_internal_function f, *fptr = NULL; |
php_com_dotnet_object *obj; |
php_com_dotnet_object *obj; |
Line 283 static union _zend_function *com_method_get(zval **obj
|
Line 283 static union _zend_function *com_method_get(zval **obj
|
f.num_args = 0; |
f.num_args = 0; |
f.arg_info = NULL; |
f.arg_info = NULL; |
f.scope = obj->ce; |
f.scope = obj->ce; |
f.fn_flags = 0; | f.fn_flags = ZEND_ACC_CALL_VIA_HANDLER; |
f.function_name = estrndup(name, len); |
f.function_name = estrndup(name, len); |
f.handler = PHP_FN(com_method_handler); |
f.handler = PHP_FN(com_method_handler); |
|
|
Line 364 static union _zend_function *com_method_get(zval **obj
|
Line 364 static union _zend_function *com_method_get(zval **obj
|
return NULL; |
return NULL; |
} |
} |
|
|
static int com_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) | static int com_call_method(const char *method, INTERNAL_FUNCTION_PARAMETERS) |
{ |
{ |
zval ***args = NULL; |
zval ***args = NULL; |
php_com_dotnet_object *obj; |
php_com_dotnet_object *obj; |
Line 387 static int com_call_method(char *method, INTERNAL_FUNC
|
Line 387 static int com_call_method(char *method, INTERNAL_FUNC
|
|
|
VariantInit(&v); |
VariantInit(&v); |
|
|
if (SUCCESS == php_com_do_invoke_byref(obj, method, -1, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { | if (SUCCESS == php_com_do_invoke_byref(obj, (char*)method, -1, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { |
php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); |
php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); |
ret = SUCCESS; |
ret = SUCCESS; |
VariantClear(&v); |
VariantClear(&v); |
Line 409 static union _zend_function *com_constructor_get(zval
|
Line 409 static union _zend_function *com_constructor_get(zval
|
|
|
#define POPULATE_CTOR(f, fn) \ |
#define POPULATE_CTOR(f, fn) \ |
f.type = ZEND_INTERNAL_FUNCTION; \ |
f.type = ZEND_INTERNAL_FUNCTION; \ |
f.function_name = obj->ce->name; \ | f.function_name = (char *) obj->ce->name; \ |
f.scope = obj->ce; \ |
f.scope = obj->ce; \ |
f.arg_info = NULL; \ |
f.arg_info = NULL; \ |
f.num_args = 0; \ |
f.num_args = 0; \ |
Line 442 static zend_class_entry *com_class_entry_get(const zva
|
Line 442 static zend_class_entry *com_class_entry_get(const zva
|
return obj->ce; |
return obj->ce; |
} |
} |
|
|
static int com_class_name_get(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) | static int com_class_name_get(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) |
{ |
{ |
php_com_dotnet_object *obj; |
php_com_dotnet_object *obj; |
obj = CDNO_FETCH(object); |
obj = CDNO_FETCH(object); |
Line 580 zend_object_handlers php_com_object_handlers = {
|
Line 580 zend_object_handlers php_com_object_handlers = {
|
com_class_name_get, |
com_class_name_get, |
com_objects_compare, |
com_objects_compare, |
com_object_cast, |
com_object_cast, |
com_object_count | com_object_count, |
| NULL, /* get_debug_info */ |
| NULL, /* get_closure */ |
| NULL, /* get_gc */ |
}; |
}; |
|
|
void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC) |
void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC) |