Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
now that [#325665 has landed, it would be nice to get rid of the remaining places where we use:
foreach (module_list() as $module)) {
// do something with a hook on each module
and replace them with:
foreach (module_implements($hook) as $module)) {
// do something with $hook on each module
this will help to with #332003: cut the fat out of _drupal_bootstrap_full.
Comment | File | Size | Author |
---|---|---|---|
#13 | drupal-module_implements-334030-13.patch | 5.61 KB | hefox |
#11 | drupal-module_implements-334030-10.patch | 5.61 KB | hefox |
#1 | 334030-module-list-used-hook.patch | 7.56 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #2
catchVisually this looks great. I'm running all tests but it's taking a very long time, no fails so far :)
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedyay, more kittens saved. simple patch, looks good, all tests pass, RTBC.
Comment #4
catchall tests passed for me too in the end.
We should document this as a best practice in the upgrade docs once it gets in.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #6
catchMarking to needs work for docs.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commented@catch: where is it that the doc updates should go exactly?
Comment #8
catchhttp://drupal.org/update/modules ought to do fine.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedclosing, as i've put some docs in.
Comment #10
hefox CreditAttribution: hefox commentedAs far as I can tell, its not an api change to backport this change to d6, and instead a performance improvement that should have no negative effects, so re-opening (and marking #1861562: Use module_implements('user') instead of module_list()/function_exists (for performance) as duplicate which filled before finding this).
did not backport the variable name only changes, e.g. node_invoke_nodeapi change.
Sorta related, #1861604: Skip module_invoke/module_hook in calling hook_watchdog (excessive function_exist) is for watchdog as it combines module_implements with module_invoke which is extra function_exists calls.
And spawned #1864188: user_filters invokes hook_permission with argument 'permission' ($function('permission')) after noticing the issue when backporting.
Comment #11
hefox CreditAttribution: hefox commented... I guess I could attach the patch
Comment #13
hefox CreditAttribution: hefox commentedmodul_implements => module_implements