ADDITION/CORRECTION:
For Views in Drupal7, the cache is built up by Ctools and its _ctools_export_get_defaults()
function that is defined in .../ctools/includes/export.inc
. It is called many ways down the line from views_get_all_views()
:
function views_get_all_views($reset = FALSE) {
ctools_include('export');
return ctools_export_crud_load_all('views_view', $reset);
}
where ctools_export_crud_load_all()
eventually calls it. The kicker for grep'ing around to find this is that it uses $function = $module . '_' . $export['default hook'];
to cycle through all the modules that implement the hook, and that is defined in views.install
:
'default hook' => 'views_default_views',
so it certainly took a bit to find but it is a nice api way to allow all sorts of modules to export objects in a defined fashion. I won't include the code here as it's a bit more verbose than the D6 version below but do let me know if you need any other help on this.
MY BAD: This is The following for D6....D7 answer on the wayabove but I'll keep this in here if anyone in D6land ever needs an answer: