get_properties VS ce.default_properties
| From: | Piotr Pokora | Date: | Mon, 19 Feb 2007 12:08:01 +0000 |
| Subject: | get_properties VS ce.default_properties | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-4564@lists.php.net to get a copy of this message | ||
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.
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.
backtrace is useless here:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215612384 (LWP 18388)]
0x00000048 in ?? ()
(gdb) bt
#0 0x00000048 in ?? ()
(gdb) bt full
#0 0x00000048 in ?? ()
No symbol table info available.
I think segfault is related to zend_objects_store_put , but I have no idea if ce->create_object
is inherited
by derived class or no.
Piotras