@@ -158,26 +158,29 @@ func extractRelationshipsEnvs(env Environment) Envs {
158
158
}
159
159
if detectedLanguage == "php" {
160
160
versionKey := fmt .Sprintf ("%sVERSION" , prefix )
161
- if doctrineConfigVersion , err := platformsh .ReadDBVersionFromDoctrineConfigYAML (env .Path ()); err == nil && doctrineConfigVersion != "" {
162
- // configuration from doctrine.yaml
163
- values [versionKey ] = doctrineConfigVersion
164
- } else if v , ok := endpoint ["type" ]; ok {
165
- // type is available when in the cloud or locally via a tunnel
166
- if version , hasVersionInEnv := os .LookupEnv (versionKey ); hasVersionInEnv {
167
- values [versionKey ] = version
168
- } else if strings .Contains (v .(string ), ":" ) {
169
- version := strings .SplitN (v .(string ), ":" , 2 )[1 ]
161
+ if v , ok := endpoint ["type" ]; ok {
162
+ // configuration from doctrine.yaml takes precedence over psh config
163
+ if doctrineConfigVersion , err := platformsh .ReadDBVersionFromDoctrineConfigYAML (env .Path ()); err == nil && doctrineConfigVersion != "" {
164
+ // configuration from doctrine.yaml
165
+ values [versionKey ] = doctrineConfigVersion
166
+ } else {
167
+ // type is available when in the cloud or locally via a tunnel
168
+ if version , hasVersionInEnv := os .LookupEnv (versionKey ); hasVersionInEnv {
169
+ values [versionKey ] = version
170
+ } else if strings .Contains (v .(string ), ":" ) {
171
+ version := strings .SplitN (v .(string ), ":" , 2 )[1 ]
170
172
171
- // we actually provide mariadb not mysql
172
- if endpoint ["scheme" ].(string ) == "mysql" {
173
- minor := 0
174
- if version == "10.2" {
175
- minor = 7
173
+ // we actually provide mariadb not mysql
174
+ if endpoint ["scheme" ].(string ) == "mysql" {
175
+ minor := 0
176
+ if version == "10.2" {
177
+ minor = 7
178
+ }
179
+ version = fmt .Sprintf ("%s.%d-MariaDB" , version , minor )
176
180
}
177
- version = fmt .Sprintf ("%s.%d-MariaDB" , version , minor )
178
- }
179
181
180
- values [versionKey ] = version
182
+ values [versionKey ] = version
183
+ }
181
184
}
182
185
} else if env .Local () {
183
186
// Docker support
0 commit comments