Ticket #657 (fixed enhancement)
Simpler cache accessor
- Created: 2012-04-11 11:18:09
- Reported by: Franz
- Assigned to: Franz
- Milestone: 2.0-alpha1
- Component: caching
- Priority: normal
There's quite a lot of boilerplate code required for everything that's cached.
Since we require PHP 5.3, we can provide lambda functions to the Cache retrieval function that will only be executed if the requested item does not exist.
Like so:
$value = \fluxbb\cache\Cache::remember('key', function() {
return 'something to be cached';
});
For reference, I shamelessly stole this code from the Laravel PHP framework:
http://laravel.com/docs/cache/usage#get
History
Franz 2012-04-11 12:01:56

Implemented (not sure why the commit does not show up).
Now for actually making use of this in the v2.0 core...
Franz 2012-04-11 14:25:59

It should also get the commits on the library repos (just look at some other tickets or the timeline).
Well, I'll investigate...