Re: [development] RFC: info hook standardization
On Mon, 19 May 2008 14:30:30 -0400, "Darrel O'Pry" <darrel.opry@gmail.com> wrote:
Themes get a special HOOK_theme() that is exactly like the module version, but they do not get a corresponding alter.
That makes more sense. I'm a proponent of ignoring that special case for now since it's doing it's own caching and just implementing a caching version of module_invoke_all....
although I don't think we need to add the logic for caching in module_invoke_all itself since it is a called my many other modules, just extend what we have with a wrapper that implements the caching.
I didn't suggest that the caching happen inside module_invoke_all(), just that if a hook is named hook_foo_info() then there is caching. It probably should not happen inside module_invoke_all() itself. If hook_theme() takes parameters, though, how does it get cached? --Larry Garfield
----- "Larry Garfield" <larry@garfieldtech.com> wrote:
If hook_theme() takes parameters, though, how does it get cached?
You can hash the arguments and function name as the cache key. That's what I do for PressFlow Preempt.
On May 19, 2008, at 12:04 PM, Larry Garfield wrote:
Themes get a special HOOK_theme() that is exactly like the module version, but they do not get a corresponding alter.
If hook_theme() takes parameters, though, how does it get cached?
Each theme has its own theme registry cache. And the params for hook_theme() are mostly used to provide context to the implementation. (i.e. "here's what the theme registry looks like so far. Bar is the active theme. We're asking foo about it because its a base theme for bar. etc.) http://api.drupal.org/api/function/hook_theme/6
participants (3)
-
David Timothy Strauss -
John Wilkins -
Larry Garfield