Skip to content

Commit 9b2ee00

Browse files
committedJan 31, 2025·
Target local env as well.
1 parent c8eaff3 commit 9b2ee00

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed
 

‎settings/acquia-recommended.settings.php

+16-13
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,27 @@
8585
// phpcs:ignore
8686
$site_name = EnvironmentDetector::getSiteName($site_path);
8787

88-
// Acquia Cloud settings.
88+
// Acquia platform settings includes a require line that
89+
// opens database connection, hence the mysql57 settings
90+
// file should be added before platform require line.
91+
// @see: https://www.drupal.org/project/mysql57
92+
// @todo: Remove this line once acquia platform start supporting mysql 8.0
93+
if(!EnvironmentDetector::isAhIdeEnv()) {
94+
$settings_files[] = __DIR__ . "/mysql57.settings.php";
95+
}
96+
97+
// Acquia Cloud settings
8998
if (EnvironmentDetector::isAhEnv()) {
9099
try {
91-
// Acquia cloud expects mysql57 settings file
92-
// to be included before any settings.
93-
// Though Cloud IDE expect it to be included after db settings.
94-
// @todo: Remove this line once acquia platform start supporting myslql 8.0
95-
if(!EnvironmentDetector::isAhIdeEnv()) {
96-
$settings_files[] = __DIR__ . "/mysql57.settings.php";
97-
}
98100
if (!EnvironmentDetector::isAcsfEnv()) {
99101
$settings_files[] = FilePaths::ahSettingsFile(EnvironmentDetector::getAhGroup(), $site_name);
100102
}
103+
// Acquia Cloud IDE settings have $databases variable defined hence
104+
// the mysql57 setting file should be added after platform require line.
105+
// @todo: Remove this line once acquia platform start supporting mysql 8.0
106+
if(EnvironmentDetector::isAhIdeEnv()) {
107+
$settings_files[] = __DIR__ . "/mysql57.settings.php";
108+
}
101109
}
102110
catch (SettingsException $e) {
103111
trigger_error($e->getMessage(), E_USER_WARNING);
@@ -117,11 +125,6 @@
117125
'filesystem',
118126
'misc',
119127
];
120-
// Cloud IDE expect mysql57 driver to be included after db settings.
121-
if(EnvironmentDetector::isAhIdeEnv()) {
122-
$acquia_settings_files[] = 'mysql57';
123-
}
124-
125128
foreach ($acquia_settings_files as $recommended_settings_file) {
126129
$settings_files[] = __DIR__ . "/$recommended_settings_file.settings.php";
127130
}

0 commit comments

Comments
 (0)
Please sign in to comment.