Clean up ext/com_dotnet/com_handlers.c
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.2k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 96
Mô tả
Description
There are 4 TODO items in the code. Putting this here to get this on the radar to either fix or wontfix (in the case of wontfix the todos should be removed from the codebase). The file isn't very large so a copy/paste of the relevant code is below. The only other file that seems to make reference to com_handlers.c is com_variant.c
Side note: The entire handling of PHP variant / COM types seems very clunky to me. But I've not dealt with Windows COM in years so maybe it is the way it is.
static int com_property_exists(zend_object *object, zend_string *member, int check_empty, void **cache_slot)
{
DISPID dispid;
php_com_dotnet_object *obj;
obj = (php_com_dotnet_object*) object;
if (V_VT(&obj->v) == VT_DISPATCH) {
if (SUCCEEDED(php_com_get_id_of_name(obj, member, &dispid))) {
/* TODO: distinguish between property and method! */
return 1;
}
} else {
/* TODO: check for safearray */
}
return 0;
}
static int com_dimension_exists(zend_object *object, zval *member, int check_empty)
{
/* TODO Add support */
zend_throw_error(NULL, "Cannot check dimension on a COM object");
return 0;
}
static void com_property_delete(zend_object *object, zend_string *member, void **cache_slot)
{
zend_throw_error(NULL, "Cannot delete properties from a COM object");
}
static void com_dimension_delete(zend_object *object, zval *offset)
{
zend_throw_error(NULL, "Cannot delete dimension from a COM object");
}
static HashTable *com_properties_get(zend_object *object)
{
/* TODO: use type-info to get all the names and values ?
* DANGER: if we do that, there is a strong possibility for
* infinite recursion when the hash is displayed via var_dump().
* Perhaps it is best to leave it un-implemented.
*/
return (HashTable *) &zend_empty_array;
}
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với bốn TODO trong ext/com_dotnet/com_handlers.c và đọc các tham chiếu liên quan trong com_variant.c. Xác định đối với từng mục xem mục đó nên được triển khai hay đánh dấu là wontfix, sau đó xóa các TODO đã được giải quyết và xác minh rằng hành vi của COM handler vẫn nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- c
- Lĩnh vực
- operating-systems
- Loại issue
- Tái cấu trúc
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 30/100