MP_Cache: Simple flexible Partial Caching |
[eluser]Jelmer[/eluser]
That's a good point. I must admit I never really program out the notices, but I don't think this is the complete. It requires you to set the second part of the get() function always when you don't expire your cache if you don't want notice errors, and I prefer it not to require. Wouldn't the following be a better and even logically better solution? I think the statement $cache['mp_cache_expires_time'] > 0 should be isset($cache['mp_cache_expires_time']). Which would make it the full line: Code: if ($use_expires && isset($this->contents['mp_cache_expires_time']) && $this->contents['mp_cache_expires_time'] < time()) A sidenote: I've written the second version which I haven't posted yet because it hasn't been fully tested. You can find it at http://mpsimple.mijnpraktijk.com/mp_cache.htm. EDIT: You were right though, putting the $use_expires variable first was also logically better. |
Welcome Guest, Not a member yet? Register Sign In |