Manual:$wgRequest

Examples
This code can be useful within hook functions when you want to return without executing additional function code if the user is editing, rather than viewing, the current page.