Lines with module_load_include() like
module_load_include('inc', 'crumbs', 'crumbs.TrailFinder');
...
should be moved into hook_init()
It's slowing down bootstrap loading process, it could slow down as well cache pages or some other loading like drush etc.
Then other problem is when you use the same method of loading plugins for modules which hook_boot defined, you have following error:
Fatal error: Call to undefined function drupal_get_path()
Because they have in {system} table 'bootstrap' = 1, which make them to load before drupal_get_path() is defined.
Comments
Comment #1
kenorb commentedComment #2
donquixote commentedHey, great someone is looking into the code and doing some code review!
I think the smartest way would be to load this stuff when it is needed, and ignore otherwise. For instance, ajax calls don't need crumbs.
-------
[sidetracking]
If you have the time, I would appreciate if you can also review the plugin mechanism a bit. I think the classes and objects are a good idea, but I'm not sure if I need the separate methods find() and decorate(), or if this should be one and the same. I am also a bit undecided about the way that these methods communicate with the $item parameter, and how I deal with different .
[/sidetracking]
Comment #3
kenorb commentedSee: http://php.net/manual/en/language.oop5.autoload.php
But probably only one global function __autoload could be defined, but I'm not sure.
Comment #4
kenorb commentedI started to implement Crumbs module in the project on which I'm working on, so hopefully everything will goes fine. So it will be a good review.
In case of any critical bugs and unsolved issues, later I'd like to have cvs access to be able to fix them, in case if you are not around, because I'm not sure how active this module will be in case of any problems.
Comment #5
donquixote commentedthis stuff is now all looking different in code, so the original issue no longer applies.