Re: get_properties VS ce.default_properties
| From: | Pierre | Date: | Mon, 19 Feb 2007 13:06:53 +0000 |
| Subject: | Re: get_properties VS ce.default_properties | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-4565@lists.php.net to get a copy of this message | ||
Hi Piotr,
On 2/19/07, Piotr Pokora <piotrek.pokora@gmail.com> wrote:
Hi,
I started to refactor my ZE1 code and now I use ( I think correctly ) ZE2 object handlers.
As you suggested I try to read , understand and follow zip and swish pecl extensions' code.
However I get few issues:
If I follow swish convention I can not get derived class properties returned by get_properties hook.
Adding ( zip's way ) :
zend_hash_copy(int->zo.properties,
&class_type->default_properties,
(copy_ctor_func_t) zval_add_ref,
(void *) &tmp, sizeof(zval *));
seems to solve this problem. But as Antony already explained it's not propper way of doing this.
It is the proper way to do that. Tony was certainly referring to something else.
The only problem I have no idea how to resolve is derived class' constructor which overwrites base class' one. Zip extension doesn't define explicit constructor, and swish extension segfaults when I try to create new Swish instance or derived class' one. The same segfault ( well, segfault at all ) is triggered by derived class' constructor in my code.What do you do in the derived class constructor? (sample script). It may help to reproduce the segfault.
backtrace is useless here:debug mode? --Pierre