Re: Hiding a resource in a separate ZVAL
| From: | Ángel González | Date: | Tue, 25 Oct 2011 19:15:24 +0000 |
| Subject: | Re: Hiding a resource in a separate ZVAL | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-8771@lists.php.net to get a copy of this message | ||
Pieter de Zwart wrote:
> Hey everyone,
>
> I am looking for some help. I am trying to implement persistent connections for the php-amqp
> project. I am taking a very OOP approach to this API, so I have an AMQPConnection object that has
> some necessary stored information, as well as a few methods. In order to maintain the structure, I
> would like to add another method, pconnect(), to the class. This would mean hiding the persistent
> resource behind the AMQPConnection object zval, and calling all the right dtors at all the right
> times.
>
> Is this crazy? Can someone give me some pointers, or maybe suggest another extension that has
> done something similar? I am heading down the path already using a much modified version of
> http://devzone.zend.com/node/view/id/1024 and referencing her book,
> but obviously there is no tutorial for this. At least none that I can find =)
>
> Thanks,
> Pieter
I suppose you could see how other extensions implement it? (eg. for
mysql_pconnect)