[ticket/12620] Allow the user to define multiples environments

https://tracker.phpbb.com/browse/PHPBB3-12620

replace #2521

PHPBB3-12620

Would really prefer if we could use fewer globals here not more.