[ticket/12620] Allow the user to define multiples environments

PHPBB3-12620
This commit is contained in:
Tristan Darricau 2014-05-30 14:57:19 +02:00
parent 6fa0ca1f96
commit c22562f5cd
21 changed files with 27 additions and 18 deletions

View file

@ -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

View file

@ -0,0 +1,2 @@
imports:
- { resource: services.yml }

View file

@ -0,0 +1,2 @@
imports:
- { resource: services.yml }

View file

@ -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 }

View file

@ -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)

View file

@ -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');
}
/**