aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/common.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-05-30 15:29:09 +0200
committerTristan Darricau <github@nicofuma.fr>2014-11-20 19:00:34 +0100
commit873260589eaa7ac2d7e520ebe321cb8bb2609ce0 (patch)
tree31c0bfed5170ab604052d5e5b0d757bc099e051e /phpBB/common.php
parent1a6e1ecf6f96acb7eb3fc0cc6233773ecb5125a8 (diff)
downloadforums-873260589eaa7ac2d7e520ebe321cb8bb2609ce0.tar
forums-873260589eaa7ac2d7e520ebe321cb8bb2609ce0.tar.gz
forums-873260589eaa7ac2d7e520ebe321cb8bb2609ce0.tar.bz2
forums-873260589eaa7ac2d7e520ebe321cb8bb2609ce0.tar.xz
forums-873260589eaa7ac2d7e520ebe321cb8bb2609ce0.zip
[ticket/12620] Display error message when the environment isn't available
PHPBB3-12620
Diffstat (limited to 'phpBB/common.php')
-rw-r--r--phpBB/common.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index d4549dc2d4..586c2f080f 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -96,11 +96,30 @@ set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handle
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
+if (ENVIRONMENT == 'debug' && !class_exists('Goutte\Client', true))
+{
+ trigger_error(
+ 'Composer dependencies have not been set up for the development environment yet, run ' .
+ "'php ../composer.phar install --dev' from the phpBB directory to do so.",
+ E_USER_ERROR
+ );
+}
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();
+$phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx);
+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 ' . 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'));