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

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

Why do you global the container in these functions? Pass the arguments you need as parameters?