[drupal-devel] Cache sid

Julian Bond julian_bond at voidstar.com
Wed Mar 2 07:36:13 UTC 2005


Moshe Weitzman <weitzman at tejasa.com> Tue, 1 Mar 2005 14:23:09
>Julian Bond wrote:
>> If the cache is turned on drupal_page_header() calls
>> bootstrap_invoke_all('init');
>>  which calls
>>     module_load($module);
>>     module_invoke($module, $op);
>>  So module functions can be called before common.inc is loaded, but
>>only  if cache is turned on and it's a guest user coming in.
>
>In this case, modules are not even loaded so surely they can't be
>called. The fact that one could call module_invoke() does not imply
>that all modules are available.

Look at
function bootstrap_invoke_all($op) {
  foreach (module_list(FALSE, TRUE) as $module) {
    module_load($module);
    module_invoke($module, $op);
  }
}

Sure looks to me like all modules get loaded in this scenario. And
bootstrap_invoke_all('init') in drupal_page_header() is going to call
every modules init function if it exists.

>The current best practice for injecting content into <HEAD> tag is to
>use hook_menu(!$may_cache). using init is a bad idea.

Ah. http://drupaldocs.org/api/4.5/function/hook_init
Perhaps something should be added to this to say don't use common.inc
functions either.

-- 
Julian Bond Email&MSM: julian.bond at voidstar.com
Webmaster:                 http://www.ecademy.com/
Personal WebLog:          http://www.voidstar.com/
M: +44 (0)77 5907 2173      T: +44 (0)192 0412 433
S: callto://julian.bond/



More information about the drupal-devel mailing list