Hi Folks, Which bootstrap phase has enough environment established that Drupal can now start going through the filesystem looking for *.info files and loading modules? Does this happen in two steps -- core and contrib? Or does this happen much later after the bootstrap phases? I spent some time stepping through bootstrap code yesterday and I was unable to find the meat of the procedure. Lots of calls to drupal_static which is part of loading the internal, in-memory configuration structures, and even a call to read the database "select * from cache_bootstrap where cid = 'system_list';" (Where is this row constructed and written to the database so bootstrapping can read it?) which has the effect of loading much of $data. Thanks for the help, Chris.
.info files aren't processed during bootstrap. They only get processed during certain actions and special pages, such as flushing caches, visiting the modules page, etc. Once it reads the files, it then stores/updates the data in the system table. The actual function that does this is drupal_parse_info_file, located in common.inc and is most commonly called through module_rebuild_cache. On the theme side a very similar process happens in the system_theme_data in system.module. The most common caller for that is from dupal_flush_all_caches(). Jamie Holly http://hollyit.net On 10/11/2013 11:32 AM, Chris Miller wrote:
Hi Folks,
Which bootstrap phase has enough environment established that Drupal can now start going through the filesystem looking for *.info files and loading modules? Does this happen in two steps -- core and contrib? Or does this happen much later after the bootstrap phases?
I spent some time stepping through bootstrap code yesterday and I was unable to find the meat of the procedure. Lots of calls to drupal_static which is part of loading the internal, in-memory configuration structures, and even a call to read the database "select * from cache_bootstrap where cid = 'system_list';" (Where is this row constructed and written to the database so bootstrapping can read it?) which has the effect of loading much of $data.
Thanks for the help,
Chris.
From: "Jamie Holly" <hovercrafter@earthlink.net> To: development@drupal.org Sent: Friday, October 11, 2013 8:44:45 AM Subject: Re: [development] Bootstrap Phases
.info files aren't processed during bootstrap. They only get processed during certain actions and special pages, such as flushing caches, visiting the modules page, etc. Once it reads the files, it then stores/updates the data in the system table. The actual function that does this is drupal_parse_info_file, located in common.inc and is most commonly called through module_rebuild_cache.
On the theme side a very similar process happens in the system_theme_data in system.module. The most common caller for that is from dupal_flush_all_caches().
To paraphrase Judge Chamberlain Haller in "My Cousin Vinny" : That is a lucid, intelligent, well thought-out reply. And exactly what I want to hear. Thanks very much for the help, Chris.
I don't think there's a phase where boostrap goes through the filesystem looking for *.info files and loading modules. I think it looks through the system table and loads modules, and the *.info stuff is cached in the registry or suchlike. The list of modules gets refreshed only when it needs to, which is either when you go to the modules page or use drush to list or enable/disable modules. In particular, it looks like you're looking for _drupal_bootstrap_variables in Drupal 7, which is where module_load_all() is called. -- John Fiala www.jcfiala.net
participants (3)
-
Chris Miller -
Jamie Holly -
John Fiala