On Mon, Mar 24, 2008 at 5:24 AM, Domas Mituzas midom.lists@gmail.com wrote:
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.
Well, the major issue then is to check for 'read' condition in any extension that uses userCan hook, and do fast execution without unstubbing too many objects.
Yup, sure. Title.php is not the best place to address those issues.
but check $wgGroupPermissions. Domas, could you explain? Or someone?
and unstubs the User object, which can be skipped in quite many code executions :)
Ah, so that's it. The problem with this kind of thing is that it does break flexibility somewhat. In this case it still breaks the UserGetRights hook for one particular use. The solution might be to have isAllowed not call getRights at all, or not hit the getRights hook anyway, and give it a separate hook. It would be nice if your optimization could be moved into User::isAllowed, but that breaks UserGetRights even further.