From c22562f5cdb3db9482a7c6bc2398ebb12cbcfb8b Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 30 May 2014 14:57:19 +0200 Subject: [ticket/12620] Allow the user to define multiples environments PHPBB3-12620 --- phpBB/common.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 0782bd7321..d4549dc2d4 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('ENVIRONMENT')) +{ + @define('ENVIRONMENT', 'productive'); +} + if (!defined('PHPBB_INSTALLED')) { // Redirect the user to the installer -- cgit v1.2.1 From 873260589eaa7ac2d7e520ebe321cb8bb2609ce0 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 30 May 2014 15:29:09 +0200 Subject: [ticket/12620] Display error message when the environment isn't available PHPBB3-12620 --- phpBB/common.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'phpBB/common.php') 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')); -- cgit v1.2.1 From 733ae584dd09a0d922fa8f56a0bdc7b3ae359266 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 30 May 2014 15:41:54 +0200 Subject: [ticket/12620] Improve error message PHPBB3-12620 --- phpBB/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 586c2f080f..47c9085d5f 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -99,7 +99,7 @@ $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 ' . + 'Composer development 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 ); -- cgit v1.2.1 From 7fa3b4c6860d85c7616e2182241eefe9515dc8a8 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 30 May 2014 18:33:56 +0200 Subject: [ticket/12620] Rename productive to production PHPBB3-12620 --- phpBB/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 47c9085d5f..a1142e4af4 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -31,7 +31,7 @@ extract($phpbb_config_php_file->get_all()); if (!defined('ENVIRONMENT')) { - @define('ENVIRONMENT', 'productive'); + @define('ENVIRONMENT', 'production'); } if (!defined('PHPBB_INSTALLED')) -- cgit v1.2.1 From d2822af6d7fb6e1d8d67d9c8b758ecedb1d67b58 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sat, 9 Aug 2014 16:46:16 +0200 Subject: [ticket/12620] Rebased to the latest develop-ascraeus PHPBB3-12620 --- phpBB/common.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index a1142e4af4..2332802f30 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -107,7 +107,6 @@ if (ENVIRONMENT == 'debug' && !class_exists('Goutte\Client', true)) phpbb_load_extensions_autoloaders($phpbb_root_path); // Set up 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); -- cgit v1.2.1 From b697273aaa53d9f9f4a3d4a53cc6267e906953cd Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 4 Sep 2014 17:06:39 +0200 Subject: [ticket/12620] Use PHPBB_ENVIRONMENT PHPBB3-12620 --- phpBB/common.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 2332802f30..85568ab10e 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -29,9 +29,9 @@ $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('ENVIRONMENT')) +if (!defined('PHPBB_ENVIRONMENT')) { - @define('ENVIRONMENT', 'production'); + @define('PHPBB_ENVIRONMENT', 'production'); } if (!defined('PHPBB_INSTALLED')) @@ -96,7 +96,7 @@ 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)) +if (PHPBB_ENVIRONMENT == 'debug' && !class_exists('Goutte\Client', true)) { trigger_error( 'Composer development dependencies have not been set up for the development environment yet, run ' . @@ -115,7 +115,7 @@ try catch (InvalidArgumentException $e) { trigger_error( - 'The requested environment ' . ENVIRONMENT . ' is not available.', + 'The requested environment ' . PHPBB_ENVIRONMENT . ' is not available.', E_USER_ERROR ); } -- cgit v1.2.1 From 6cbb60d13f75da6d9b6c6d60555ea119df79b5c0 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sat, 4 Oct 2014 16:30:34 +0200 Subject: [ticket/12620] Adds a yaml config file PHPBB3-12620 --- phpBB/common.php | 8 -------- 1 file changed, 8 deletions(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 85568ab10e..2fa0c46b22 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -96,14 +96,6 @@ 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 (PHPBB_ENVIRONMENT == 'debug' && !class_exists('Goutte\Client', true)) -{ - trigger_error( - 'Composer development 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 -- cgit v1.2.1