[ticket/12687] Remove globals

PHPBB3-12687