[development] RFC: info hook standardization

John Wilkins drupal.user at albin.net
Mon May 19 16:46:35 UTC 2008


HOOK_theme() fits the criteria you outlined, except for one item: "It  
takes no parameters." HOOK_theme() actually has 4 parameters that are  
essential for theme developers. Of course, HOOK_theme() is a special  
case since themes (and not just modules) can call that hook. (And,  
btw, themes can't call the corresponding HOOK_theme_registry_alter().)

There might be other info hooks that could make use of parameters.  
Anybody know?

  - John

John Wilkins | Albin.Net | nickname: JohnAlbin



On May 18, 2008, at 10:15 PM, Larry Garfield wrote:
> An info hook would be defined as follows:
>
> - It has a name of the form hook_$singularNoun_info().
> - It takes no parameters.
> - It returns a nested associative array of arbitrary complexity
> (case-specific).
> - it has a corresponding _alter hook (vis, hook_ 
> $singularNoun_info_alter()).
> - It is structured in such a way that its results can and are cached  
> (either
> in the cache table or a dedicated table, depending on the use case).
> - That cache is permanent, so under normal operation the hook never  
> needs to
> be called again.
> - The new registry system knows to never pre-load the file in which  
> an info
> hook resides, or rather to never flag a file included for an info  
> hook for
> pre-caching.  (We don't want to inadvertently flush the cache and then
> trigger a rebuild of those hooks on a node view page, because then  
> we end up
> loading thousands of unnecessary lines.)




More information about the development mailing list