Skip to content

Commit

Permalink
fix: PHP CodeSniffer on settings.ddev.php for Drupal 8 - 11 (ddev#6217)…
Browse files Browse the repository at this point in the history
… [skip ci]
  • Loading branch information
truls1502 authored May 20, 2024
1 parent 8293165 commit 6eaf943
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 40 deletions.
18 changes: 10 additions & 8 deletions pkg/ddevapp/drupal/drupal/settings.ddev.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
{{ $config := . }}
/**
* @file
* {{ $config.Signature }}: Automatically generated Drupal settings file.
* ddev manages this file and may delete or overwrite the file unless this
* comment is removed. It is recommended that you leave this file alone.
* This is a Drupal settings file automatically generated by DDEV.
*
* DDEV manages this file and may delete or overwrite it unless this
* comment, marked with {{ $config.Signature }}, is removed. It is recommended
* that you leave this file alone.
*/

$host = "{{ $config.DatabaseHost }}";
Expand Down Expand Up @@ -36,12 +38,12 @@
$settings['config_sync_directory'] = 'sites/default/files/sync';
}

// Override drupal/symfony_mailer default config to use Mailpit
// Override drupal/symfony_mailer default config to use Mailpit.
$config['symfony_mailer.mailer_transport.sendmail']['plugin'] = 'smtp';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user']='';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass']='';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host']='localhost';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port']='1025';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user'] = '';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass'] = '';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host'] = 'localhost';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port'] = '1025';

// Enable verbose logging for errors.
// https://www.drupal.org/forum/support/post-installation/2018-07-18/enable-drupal-8-backend-errorlogdebugging-mode
Expand Down
18 changes: 10 additions & 8 deletions pkg/ddevapp/drupal/drupal10/settings.ddev.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
{{ $config := . }}
/**
* @file
* {{ $config.Signature }}: Automatically generated Drupal settings file.
* ddev manages this file and may delete or overwrite the file unless this
* comment is removed. It is recommended that you leave this file alone.
* This is a Drupal settings file automatically generated by DDEV.
*
* DDEV manages this file and may delete or overwrite it unless this
* comment, marked with {{ $config.Signature }}, is removed. It is recommended
* that you leave this file alone.
*/

$host = "{{ $config.DatabaseHost }}";
Expand Down Expand Up @@ -36,12 +38,12 @@
$settings['config_sync_directory'] = 'sites/default/files/sync';
}

// Override drupal/symfony_mailer default config to use Mailpit
// Override drupal/symfony_mailer default config to use Mailpit.
$config['symfony_mailer.mailer_transport.sendmail']['plugin'] = 'smtp';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user']='';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass']='';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host']='localhost';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port']='1025';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user'] = '';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass'] = '';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host'] = 'localhost';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port'] = '1025';

// Enable verbose logging for errors.
// https://www.drupal.org/forum/support/post-installation/2018-07-18/enable-drupal-8-backend-errorlogdebugging-mode
Expand Down
18 changes: 10 additions & 8 deletions pkg/ddevapp/drupal/drupal11/settings.ddev.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
{{ $config := . }}
/**
* @file
* {{ $config.Signature }}: Automatically generated Drupal settings file.
* ddev manages this file and may delete or overwrite the file unless this
* comment is removed. It is recommended that you leave this file alone.
* This is a Drupal settings file automatically generated by DDEV.
*
* DDEV manages this file and may delete or overwrite it unless this
* comment, marked with {{ $config.Signature }}, is removed. It is recommended
* that you leave this file alone.
*/

$host = "{{ $config.DatabaseHost }}";
Expand Down Expand Up @@ -36,12 +38,12 @@
$settings['config_sync_directory'] = 'sites/default/files/sync';
}

// Override drupal/symfony_mailer default config to use Mailpit
// Override drupal/symfony_mailer default config to use Mailpit.
$config['symfony_mailer.mailer_transport.sendmail']['plugin'] = 'smtp';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user']='';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass']='';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host']='localhost';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port']='1025';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user'] = '';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass'] = '';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host'] = 'localhost';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port'] = '1025';

// Enable verbose logging for errors.
// https://www.drupal.org/forum/support/post-installation/2018-07-18/enable-drupal-8-backend-errorlogdebugging-mode
Expand Down
16 changes: 9 additions & 7 deletions pkg/ddevapp/drupal/drupal8/settings.ddev.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
{{ $config := . }}
/**
* @file
* {{ $config.Signature }}: Automatically generated Drupal settings file.
* ddev manages this file and may delete or overwrite the file unless this
* comment is removed. It is recommended that you leave this file alone.
* This is a Drupal settings file automatically generated by DDEV.
*
* DDEV manages this file and may delete or overwrite it unless this
* comment, marked with {{ $config.Signature }}, is removed. It is recommended
* that you leave this file alone.
*/

$host = "{{ $config.DatabaseHost }}";
$port = {{ $config.DatabasePort }};
$driver = "{{ $config.DatabaseDriver }}";

// If DDEV_PHP_VERSION is not set but IS_DDEV_PROJECT *is*, it means we're running (drush) on the host,
// so use the host-side bind port on docker IP
// so use the host-side bind port on docker IP.
if (empty(getenv('DDEV_PHP_VERSION') && getenv('IS_DDEV_PROJECT') == 'true')) {
$host = "{{ $config.DockerIP }}";
$port = {{ $config.DBPublishedPort }};
Expand All @@ -39,20 +41,20 @@
$settings['class_loader_auto_detect'] = FALSE;

// This specifies the default configuration sync directory.
// For D8 before 8.8.0, we set $config_directories[CONFIG_SYNC_DIRECTORY] if not set
// For D8 before 8.8.0, we set $config_directories[CONFIG_SYNC_DIRECTORY] if not set.
if (version_compare(Drupal::VERSION, "8.8.0", '<') &&
empty($config_directories[CONFIG_SYNC_DIRECTORY])) {
$config_directories[CONFIG_SYNC_DIRECTORY] = 'sites/default/files/sync';
}
// For D8.8/D8.9, set $settings['config_sync_directory'] if neither
// $config_directories nor $settings['config_sync_directory is set
// $config_directories nor $settings['config_sync_directory is set.
if (version_compare(DRUPAL::VERSION, "8.8.0", '>=') &&
empty($config_directories[CONFIG_SYNC_DIRECTORY]) &&
empty($settings['config_sync_directory'])) {
$settings['config_sync_directory'] = 'sites/default/files/sync';
}

// Override drupal/swiftmailer default config to use Mailpit
// Override drupal/swiftmailer default config to use Mailpit.
$config['swiftmailer.transport']['transport'] = 'smtp';
$config['swiftmailer.transport']['smtp_host'] = '127.0.0.1';
$config['swiftmailer.transport']['smtp_port'] = '1025';
Expand Down
20 changes: 11 additions & 9 deletions pkg/ddevapp/drupal/drupal9/settings.ddev.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
{{ $config := . }}
/**
* @file
* {{ $config.Signature }}: Automatically generated Drupal settings file.
* ddev manages this file and may delete or overwrite the file unless this
* comment is removed. It is recommended that you leave this file alone.
* This is a Drupal settings file automatically generated by DDEV.
*
* DDEV manages this file and may delete or overwrite it unless this
* comment, marked with {{ $config.Signature }}, is removed. It is recommended
* that you leave this file alone.
*/

$host = "{{ $config.DatabaseHost }}";
Expand Down Expand Up @@ -36,14 +38,14 @@
$settings['config_sync_directory'] = 'sites/default/files/sync';
}

// Override drupal/symfony_mailer default config to use Mailpit
// Override drupal/symfony_mailer default config to use Mailpit.
$config['symfony_mailer.mailer_transport.sendmail']['plugin'] = 'smtp';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user']='';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass']='';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host']='localhost';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port']='1025';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user'] = '';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass'] = '';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host'] = 'localhost';
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port'] = '1025';

// Override drupal/swiftmailer default config to use Mailpit
// Override drupal/swiftmailer default config to use Mailpit.
$config['swiftmailer.transport']['transport'] = 'smtp';
$config['swiftmailer.transport']['smtp_host'] = '127.0.0.1';
$config['swiftmailer.transport']['smtp_port'] = '1025';
Expand Down

0 comments on commit 6eaf943

Please sign in to comment.