mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/12620] Allow the user to define multiples environments
PHPBB3-12620
This commit is contained in:
@@ -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
|
||||
|
2
phpBB/config/config_debug.yml
Normal file
2
phpBB/config/config_debug.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
imports:
|
||||
- { resource: services.yml }
|
2
phpBB/config/config_productive.yml
Normal file
2
phpBB/config/config_productive.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
imports:
|
||||
- { resource: services.yml }
|
@@ -1,19 +1,19 @@
|
||||
imports:
|
||||
- { resource: auth.yml }
|
||||
- { resource: avatar.yml }
|
||||
- { resource: captcha.yml }
|
||||
- { resource: console.yml }
|
||||
- { resource: content.yml }
|
||||
- { resource: cron.yml }
|
||||
- { resource: db.yml }
|
||||
- { resource: event.yml }
|
||||
- { resource: feed.yml }
|
||||
- { resource: mimetype_guesser.yml }
|
||||
- { resource: notification.yml }
|
||||
- { resource: password.yml }
|
||||
- { resource: profilefield.yml }
|
||||
- { resource: twig.yml }
|
||||
- { resource: user.yml }
|
||||
- { resource: services_auth.yml }
|
||||
- { resource: services_avatar.yml }
|
||||
- { resource: services_captcha.yml }
|
||||
- { resource: services_console.yml }
|
||||
- { resource: services_content.yml }
|
||||
- { resource: services_cron.yml }
|
||||
- { resource: services_db.yml }
|
||||
- { resource: services_event.yml }
|
||||
- { resource: services_feed.yml }
|
||||
- { resource: services_mimetype_guesser.yml }
|
||||
- { resource: services_notification.yml }
|
||||
- { resource: services_password.yml }
|
||||
- { resource: services_profilefield.yml }
|
||||
- { resource: services_twig.yml }
|
||||
- { resource: services_user.yml }
|
||||
|
||||
- { resource: tables.yml }
|
||||
- { resource: parameters.yml }
|
||||
|
@@ -453,11 +453,11 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
|
||||
|
||||
if ($debug)
|
||||
{
|
||||
$config_data .= "@define('DEBUG', true);\n";
|
||||
$config_data .= "@define('ENVIRONMENT', 'debug');\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$config_data .= "// @define('DEBUG', true);\n";
|
||||
$config_data .= "@define('ENVIRONMENT', 'productive');\n";
|
||||
}
|
||||
|
||||
if ($debug_container)
|
||||
|
@@ -50,7 +50,7 @@ class core extends Extension
|
||||
public function load(array $config, ContainerBuilder $container)
|
||||
{
|
||||
$loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path)));
|
||||
$loader->load('services.yml');
|
||||
$loader->load('config_' . ENVIRONMENT . '.yml');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user