Clean up ext/com_dotnet/com_handlers.c
オープン
まだ誰も着手していません。
Extension: com_dotnet
Feature
OS: Windows
Status: Needs Triage
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.1k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
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;
}
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ext/com_dotnet/com_handlers.c にある4つの TODO から始め、com_variant.c の関連する参照を読みます。各項目について実装するべきか wontfix としてマークするべきかを判断し、その後、解決済みの TODO を削除して、COM ハンドラーの動作に一貫性が保たれていることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c
- 領域
- operating-systems
- issue の種類
- リファクタリング
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100