BAC-91: fix PHP out of memory caused by recursive hook calls
Bring back globals
Merge pull request #488 from Wikia/bac-91-debug-hook

BAC-91: fix PHP out of memory caused by recursive hook calls