acquia / drupal-environment-detector

Provides common methods for detecting the current Acquia environment
GNU General Public License v2.0
10 stars 12 forks source link

Replace hyphen with underscore in ahSettingsFile (#86) #87

Closed ssu-carlsoni closed 3 months ago

ssu-carlsoni commented 6 months ago

Fixes #

86

Motivation

Acquia Cloud does not support hyphens in db names. FilePaths::ahSettingsFile handles periods but not hyphens.

Proposed changes

Ensure FilePaths::ahSettingsFile return the correct settings file when a site_name contains a hyphen

Alternatives considered

A hyphen is valid character in domain names.

Testing steps

Add a multisite with a hyphen in the name to a project on Acquia Cloud using Acquia Recommended Settings. example: childrens-school.domain.com

ssu-carlsoni commented 3 months ago

Thank you @danepowell. I learned str_replace can accept arrays for search and/or replace.

danepowell commented 3 months ago

Thanks. I think there's a CI outage right now but I'll circle back to this tomorrow.