pantheon-systems / drops-8

Pantheon Upstream for Drupal 8 Sites. Deprecated; please see https://github.com/pantheon-upstreams/drupal-composer-managed
GNU General Public License v2.0
80 stars 117 forks source link

Redis module & Pantheon Services file conflict with ddev #301

Closed CoreyWycliffe closed 4 years ago

CoreyWycliffe commented 4 years ago

I'm in an interesting situation where the settings.pantheon.php file loads the services.pantheon.preproduction.yml file and because I have Redis settings then the services look for redis in my local ddev environment. However, I don't have Redis on my local ddev environment. What I'd like to do is turn it off for ddev locally and on for only pantheon systems. I have modified the code to this

/**
 * Determine whether this is a preproduction or production environment, and
 * then load the pantheon services.yml file.  This file should be named either
 * 'pantheon-production-services.yml' (for 'live' or 'test' environments)
 * 'pantheon-preproduction-services.yml' (for 'dev' or multidev environments).
 */
if ( isset($_ENV['PANTHEON_ENVIRONMENT']) ) {
  if ($_ENV['PANTHEON_ENVIRONMENT'] == 'dev') {
    $pantheon_services_file = __DIR__ . '/services.pantheon.preproduction.yml';
  }
  if ( ($_ENV['PANTHEON_ENVIRONMENT'] == 'live') || ($_ENV['PANTHEON_ENVIRONMENT'] == 'test') ) {
    $pantheon_services_file = __DIR__ . '/services.pantheon.production.yml';
  }
}

Do you think that would be acceptable?

CoreyWycliffe commented 4 years ago

The original is

/**
 * Determine whether this is a preproduction or production environment, and
 * then load the pantheon services.yml file.  This file should be named either
 * 'pantheon-production-services.yml' (for 'live' or 'test' environments)
 * 'pantheon-preproduction-services.yml' (for 'dev' or multidev environments).
 */
$pantheon_services_file = __DIR__ . '/services.pantheon.preproduction.yml';
if (
  isset($_ENV['PANTHEON_ENVIRONMENT']) &&
  ( ($_ENV['PANTHEON_ENVIRONMENT'] == 'live') || ($_ENV['PANTHEON_ENVIRONMENT'] == 'test') )
) {
  $pantheon_services_file = __DIR__ . '/services.pantheon.production.yml';
}
iamstoick commented 4 years ago

That might impact the dashboard one-click update later (merge conflict). How about wrapping this line instead?

if (isset($_ENV['PANTHEON_ENVIRONMENT'])) {
  include __DIR__ . "/settings.pantheon.php";
}

The settings.php file is the configuration file that the customer can modify. This will allow you to work locally while waiting for the fix from the upstream.

CoreyWycliffe commented 4 years ago

Yeah, actually that works too. Thanks!