At versioncontrol module(whre we are trying to fix tests: #893010: Fix tests) we have a little piece of code that seems to be too hacky at the start of hook_menu():
// FIXME this is hacky; it forces autoload to rebuild its cache to ensure
// everything is up-to-date, since we need it to be for this function.
if (function_exists('autoload_get_lookup')) {
// for autoload 1.x
autoload_get_lookup(TRUE);
}
else {
// autoload 2.x branch
autoload_registry_update();
}
So, is this the better way to deal with this problem?
There is exactly the same problem for dbtng module(see #957262: Make sure autoload registry is setup), so it would be great to receive a suggestion :-)
Comments
Comment #1
Crell commentedEew. :-)
The 1.x code should still work in the 2.x branch, though. If not, autoload_get_lookup() should be modified to call autoload_registry_update().
Or you could just assume a 2.x dependency once that's declared stable. Dave's handling that branch and I'm hoping to hand the module over to him once the 2.x is released. (I haven't told him that, though, so don't let him find out. Shhh!)
Comment #2
dave reidBAM!
http://drupal.org/cvs?commit=447760
Comment #3
marvil07 commentedThanks for the commit for backward compatibility :-)
But my question is to ask if there is another way to have autoload working without calling
autoload_registry_update()athook_menu(). I suppose I am missing something at implementing autoload API in versioncontrol module.Comment #4
Crell commented