On Sun, Mar 23, 2008 at 10:49 AM, Rotem Liss rotemliss@gmail.com wrote:
Is calling wfRunHooks that expenseive? It returns almost immediately if no hooks are registered as "userCan"; and Title::userCanRead returns anyway after the hook if the user is allowed to read. I can't see why is the quick "shortcut" necessary, when many other hooks get called during every request.
I moved the shortcut below the hook execution in r32354. If a hook is running too slowly, it should be fixed, not the call to wfRunHooks. Actually, though, I can't see what code is skipped anyway. If $wgGroupPermissions['*']['read'] is true, it seems like you're just skipping a call to $wgUser->isAllowed, which basically does nothing but check $wgGroupPermissions. Domas, could you explain? Or someone?