Re: Re: Function Cache
| From: | Sascha Schumann | Date: | Sun, 10 Dec 2000 17:44:14 +0000 |
| Subject: | Re: Re: Function Cache | ||
| References: | 1 | Groups: | php.dev php.pear |
| Request: | Send a blank email to php-dev+get-40753@lists.php.net to get a copy of this message | ||
On Sun, 10 Dec 2000, Kristian Koehntopp wrote:
> Stig S. Bakken wrote:
> > For objects, I think the best thing would be to create a function that
> > returns a proxy object. Then you can write code like this:
> >
> > $obj = new myclass(42);
> > $cached = new caching_proxy_object($obj);
>
> Hmm, is there a way to write a generic proxy class that can
> stand in for any class? I mean, if you call
>
> $cached->dosomething()
>
> how do you spare yourself to implement a dosomething() method in
> the proxy object?
That might need to be written in C. You can create an
"overloaded class entry" which defines custom handlers for
calling functions and accessing properties. See
ext/standard/incomplete_class.c for an example.
- Sascha