This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/drupal/console/templates/files/settings.php.twig
2018-11-23 12:29:20 +00:00

35 lines
1,002 B
Twig

{% if load_from_env is defined %}
{{ yaml_comment('commands.dotenv.init.messages.load-from-env') }}
{% endif %}
# Load environment
$env = getenv('ENVIRONMENT');
{% if load_settings is defined %}
{{ yaml_comment('commands.dotenv.init.messages.load-settings') }}
{% endif %}
$base_path = $app_root . '/' . $site_path;
$servicesFile = $base_path . '/services.'.$env.'.yml';
$settingsFile = $base_path . '/settings.'.$env.'.php';
// Load services definition file.
if (file_exists($servicesFile)) {
$settings['container_yamls'][] = $servicesFile;
}
// Load settings file.
if (file_exists($settingsFile)) {
include $settingsFile;
}
$databases['default']['default'] = array (
'database' => getenv('DATABASE_NAME'),
'username' => getenv('DATABASE_USER'),
'password' => getenv('DATABASE_PASSWORD'),
'prefix' => '',
'host' => getenv('DATABASE_HOST'),
'port' => getenv('DATABASE_PORT'),
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);