diff options
Diffstat (limited to 'phpBB/common.php')
| -rw-r--r-- | phpBB/common.php | 19 | 
1 files changed, 17 insertions, 2 deletions
| diff --git a/phpBB/common.php b/phpBB/common.php index 0782bd7321..2fa0c46b22 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -29,6 +29,11 @@ $phpbb_class_loader->register();  $phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);  extract($phpbb_config_php_file->get_all()); +if (!defined('PHPBB_ENVIRONMENT')) +{ +	@define('PHPBB_ENVIRONMENT', 'production'); +} +  if (!defined('PHPBB_INSTALLED'))  {  	// Redirect the user to the installer @@ -94,8 +99,18 @@ $phpbb_class_loader_ext->register();  phpbb_load_extensions_autoloaders($phpbb_root_path);  // Set up container -$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); -$phpbb_container = $phpbb_container_builder->get_container(); +try +{ +	$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); +	$phpbb_container = $phpbb_container_builder->get_container(); +} +catch (InvalidArgumentException $e) +{ +	trigger_error( +		'The requested environment ' . PHPBB_ENVIRONMENT . ' is not available.', +		E_USER_ERROR +	); +}  $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));  $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); | 
