Larry nice proposal. but doesn't module_invoke_all already do basically what you're describing without the caching and naming enforcement? I agree with the naming convention, but not the enforcement.<br><br>Maybe we just need a module_invoke_all_cacheable($expire, $hook, ....) {<br>
// expire is same as cache_set, only CACHE_STATIC indicates use a static var, no db.<br> static $cache;<br> $cid = $hook .':'. md5(serialize(args));<br> <br> // test static cache<br> if (!isset($cache[$cid])) {<br>
// test db cache if necessary, CACHE_STATIC indicates no DB cache<br> if ($expires == CACHE_STATIC || !$cache[$cid] = cache_get('cache_hook_all', $cid)) <br> $cache[$cid] = module_invoke_all();<br> }<br>
<br> // store to db cache if necessary<br> if ($expires != CACHE_STATIC) {<br> cache_set('cache_hook_all',....);<br> }<br> }<br> return $cache[$cid])<br>}<br><br>