Skip to content

Instantly share code, notes, and snippets.

@juancarielo
Created February 10, 2024 01:08
Show Gist options
  • Select an option

  • Save juancarielo/e962fb244f08a72dc810a43c8a7b9e37 to your computer and use it in GitHub Desktop.

Select an option

Save juancarielo/e962fb244f08a72dc810a43c8a7b9e37 to your computer and use it in GitHub Desktop.
Local settings for Drupal using Lando.
<?php
// Get info about Lando
$lando_info = json_decode(getenv('LANDO_INFO'), TRUE);
// Database
$databases['default']['default'] = [
'database' => $lando_info['database']['creds']['database'],
'username' => $lando_info['database']['creds']['user'],
'password' => $lando_info['database']['creds']['password'],
'prefix' => '',
'host' => $lando_info['database']['hostnames'][0],
'port' => $lando_info['database']['internal_connection']['port'],
'driver' => 'mysql',
'namespace' => 'Drupal\\mysql\\Driver\\Database\\mysql',
'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
'isolation_level' => 'READ COMMITTED',
];
// Debug
$config['system.logging']['error_level'] = 'hide';
// $config['system.logging']['error_level'] = 'verbose';
// Disable cache
$settings['container_yamls'][] = __DIR__ . '/services.local.yml';
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['page'] = 'cache.backend.null';
// Trusted hosts
$settings['trusted_host_patterns'] = [
'^'.$_ENV['LANDO_APP_NAME'].'\.lndo\.site$',
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment