Re: Function Cache
| From: | Sebastian Bergmann | Date: | Sun, 10 Dec 2000 14:58:40 +0000 |
| Subject: | Re: Function Cache | ||
| References: | 1 2 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-627@lists.php.net to get a copy of this message | ||
"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);
>
> ...from this point, $cached can be used exactly like $obj (all variable
> and method accesses go through the proxy object). A storage model
> similar to ext/session could be adapted, at the very least you should
> have "user" (maybe more constructor parameters with callback function
> names).
Interesting idea. So, I'm going to remove the functionality to cache
method calls from my current implementation and use it just for caching
functions.
Should we create a new top level folder "Cache"?
> For functions, I don't have any ideas that would be as elegant (for the
> programmer) as this.
Thanks,
Sebastian
--
<? print implode( "", array_reverse( preg_split( "//", "dlrow laer
" .
"eht ot emoclew" ) ) ); /* visit http://www.sebastian-bergmann.de/ */ ?>