2 questions: getter/setter use and streams use
| From: | Rob Richards | Date: | Sat, 12 Apr 2003 09:33:56 +0000 |
| Subject: | 2 questions: getter/setter use and streams use | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-873@lists.php.net to get a copy of this message | ||
I am looking to use getter/setter functionality within classes in an
extension. After going through the object_handler piece, it looks like the
only way to implement it is by using a single function which then must
handle performing the appropriate function based on the property that was
passed in. The only examples I could see using this functionality were
extensions which were working against external objects (such as the ones in
the rpc extensions). Is this the only way to do this or are there any other
calls that can be used (similar to the add_property_x calls but which would
allow you to specify a function for the get/set)?
If so, is it possible to use a hash table for each class which would have
the property and a function so that when the property name is passed in to
the _get/_set handler it can look up the property and then call the
appropriate function?
Now that being said how can a private hash be setup on a class basis and how
is the memory destruction to be handled for a private hash?
Last question concerns streams. How stable are streams at this point? Its
been a while since I had seen talk about streams other than when they were
first being introduced. We are possibly looking to implement some
functionality using streams (not a priority in the extension at this point),
but want to know wether it is something to consider or not.
Thanks,
Rob Richards