mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/12620] Allow the user to define multiples environments
PHPBB3-12620
This commit is contained in:
parent
6fa0ca1f96
commit
c22562f5cd
21 changed files with 27 additions and 18 deletions
|
@ -29,6 +29,11 @@ $phpbb_class_loader->register();
|
||||||
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
|
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
|
||||||
extract($phpbb_config_php_file->get_all());
|
extract($phpbb_config_php_file->get_all());
|
||||||
|
|
||||||
|
if (!defined('ENVIRONMENT'))
|
||||||
|
{
|
||||||
|
@define('ENVIRONMENT', 'productive');
|
||||||
|
}
|
||||||
|
|
||||||
if (!defined('PHPBB_INSTALLED'))
|
if (!defined('PHPBB_INSTALLED'))
|
||||||
{
|
{
|
||||||
// Redirect the user to the installer
|
// 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:
|
imports:
|
||||||
- { resource: auth.yml }
|
- { resource: services_auth.yml }
|
||||||
- { resource: avatar.yml }
|
- { resource: services_avatar.yml }
|
||||||
- { resource: captcha.yml }
|
- { resource: services_captcha.yml }
|
||||||
- { resource: console.yml }
|
- { resource: services_console.yml }
|
||||||
- { resource: content.yml }
|
- { resource: services_content.yml }
|
||||||
- { resource: cron.yml }
|
- { resource: services_cron.yml }
|
||||||
- { resource: db.yml }
|
- { resource: services_db.yml }
|
||||||
- { resource: event.yml }
|
- { resource: services_event.yml }
|
||||||
- { resource: feed.yml }
|
- { resource: services_feed.yml }
|
||||||
- { resource: mimetype_guesser.yml }
|
- { resource: services_mimetype_guesser.yml }
|
||||||
- { resource: notification.yml }
|
- { resource: services_notification.yml }
|
||||||
- { resource: password.yml }
|
- { resource: services_password.yml }
|
||||||
- { resource: profilefield.yml }
|
- { resource: services_profilefield.yml }
|
||||||
- { resource: twig.yml }
|
- { resource: services_twig.yml }
|
||||||
- { resource: user.yml }
|
- { resource: services_user.yml }
|
||||||
|
|
||||||
- { resource: tables.yml }
|
- { resource: tables.yml }
|
||||||
- { resource: parameters.yml }
|
- { resource: parameters.yml }
|
||||||
|
|
|
@ -453,11 +453,11 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
|
||||||
|
|
||||||
if ($debug)
|
if ($debug)
|
||||||
{
|
{
|
||||||
$config_data .= "@define('DEBUG', true);\n";
|
$config_data .= "@define('ENVIRONMENT', 'debug');\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$config_data .= "// @define('DEBUG', true);\n";
|
$config_data .= "@define('ENVIRONMENT', 'productive');\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($debug_container)
|
if ($debug_container)
|
||||||
|
|
|
@ -50,7 +50,7 @@ class core extends Extension
|
||||||
public function load(array $config, ContainerBuilder $container)
|
public function load(array $config, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path)));
|
$loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path)));
|
||||||
$loader->load('services.yml');
|
$loader->load('config_' . ENVIRONMENT . '.yml');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue