Skip to content

Commit

Permalink
Change default PHP version from 7.1 to 7.2 (#1497)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Mar 21, 2019
1 parent e3e30f0 commit c39d6bd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pkg/ddevapp/apptypes.go
Expand Up @@ -68,7 +68,7 @@ func init() {
settingsCreator: createDrupal6SettingsFile, uploadDir: getDrupalUploadDir, hookDefaultComments: getDrupal6Hooks, apptypeSettingsPaths: setDrupalSiteSettingsPaths, appTypeDetect: isDrupal6App, postImportDBAction: nil, configOverrideAction: drupal6ConfigOverrideAction, postConfigAction: nil, postStartAction: drupal6PostStartAction, importFilesAction: drupalImportFilesAction, defaultWorkingDirMap: docrootWorkingDir,
},
AppTypeDrupal7: {
settingsCreator: createDrupal7SettingsFile, uploadDir: getDrupalUploadDir, hookDefaultComments: getDrupal7Hooks, apptypeSettingsPaths: setDrupalSiteSettingsPaths, appTypeDetect: isDrupal7App, postImportDBAction: nil, configOverrideAction: drupal7ConfigOverrideAction, postConfigAction: nil, postStartAction: drupal7PostStartAction, importFilesAction: drupalImportFilesAction, defaultWorkingDirMap: docrootWorkingDir,
settingsCreator: createDrupal7SettingsFile, uploadDir: getDrupalUploadDir, hookDefaultComments: getDrupal7Hooks, apptypeSettingsPaths: setDrupalSiteSettingsPaths, appTypeDetect: isDrupal7App, postImportDBAction: nil, configOverrideAction: nil, postConfigAction: nil, postStartAction: drupal7PostStartAction, importFilesAction: drupalImportFilesAction, defaultWorkingDirMap: docrootWorkingDir,
},
AppTypeDrupal8: {
settingsCreator: createDrupal8SettingsFile, uploadDir: getDrupalUploadDir, hookDefaultComments: getDrupal8Hooks, apptypeSettingsPaths: setDrupalSiteSettingsPaths, appTypeDetect: isDrupal8App, postImportDBAction: nil, configOverrideAction: nil, postConfigAction: nil, postStartAction: drupal8PostStartAction, importFilesAction: drupalImportFilesAction, defaultWorkingDirMap: docrootWorkingDir,
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/apptypes_test.go
Expand Up @@ -56,7 +56,7 @@ func TestPostConfigAction(t *testing.T) {

appTypes := map[string]string{
ddevapp.AppTypeDrupal6: ddevapp.PHP56,
ddevapp.AppTypeDrupal7: ddevapp.PHP71,
ddevapp.AppTypeDrupal7: ddevapp.PHPDefault,
ddevapp.AppTypeDrupal8: ddevapp.PHPDefault,
ddevapp.AppTypeWordPress: ddevapp.PHPDefault,
ddevapp.AppTypeBackdrop: ddevapp.PHPDefault,
Expand Down
14 changes: 7 additions & 7 deletions pkg/ddevapp/config_test.go
Expand Up @@ -143,8 +143,8 @@ func TestConfigCommand(t *testing.T) {
const phpVersionPos = 1
testMatrix := map[string][]string{
"drupal6phpversion": {AppTypeDrupal6, PHP56},
"drupal7phpversion": {AppTypeDrupal7, PHP71},
"drupal8phpversion": {AppTypeDrupal8, PHP71},
"drupal7phpversion": {AppTypeDrupal7, PHP72},
"drupal8phpversion": {AppTypeDrupal8, PHP72},
}

for testName, testValues := range testMatrix {
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestConfigCommand(t *testing.T) {
assert.Equal(name, app.Name)
assert.Equal(testValues[apptypePos], app.Type)
assert.Equal("docroot", app.Docroot)
assert.EqualValues(testValues[phpVersionPos], app.PHPVersion)
assert.EqualValues(testValues[phpVersionPos], app.PHPVersion, "PHP value incorrect for app %v", app)
err = PrepDdevDirectory(testDir)
assert.NoError(err)
}
Expand All @@ -224,8 +224,8 @@ func TestConfigCommandInteractiveCreateDocrootDenied(t *testing.T) {

testMatrix := map[string][]string{
"drupal6phpversion": {AppTypeDrupal6, PHP56},
"drupal7phpversion": {AppTypeDrupal7, PHP71},
"drupal8phpversion": {AppTypeDrupal8, PHP71},
"drupal7phpversion": {AppTypeDrupal7, PHP72},
"drupal8phpversion": {AppTypeDrupal8, PHP72},
}

for testName := range testMatrix {
Expand Down Expand Up @@ -270,8 +270,8 @@ func TestConfigCommandCreateDocrootAllowed(t *testing.T) {
const phpVersionPos = 1
testMatrix := map[string][]string{
"drupal6phpversion": {AppTypeDrupal6, PHP56},
"drupal7phpversion": {AppTypeDrupal7, PHP71},
"drupal8phpversion": {AppTypeDrupal8, PHP71},
"drupal7phpversion": {AppTypeDrupal7, PHP72},
"drupal8phpversion": {AppTypeDrupal8, PHP72},
}

for testName, testValues := range testMatrix {
Expand Down
6 changes: 0 additions & 6 deletions pkg/ddevapp/drupal.go
Expand Up @@ -615,12 +615,6 @@ func isDrupal6App(app *DdevApp) bool {
return false
}

// drupal7ConfigOverrideAction sets a safe php_version for D7
func drupal7ConfigOverrideAction(app *DdevApp) error {
app.PHPVersion = PHP71
return nil
}

// drupal6ConfigOverrideAction overrides php_version for D6, since it is incompatible
// with php7+
func drupal6ConfigOverrideAction(app *DdevApp) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/values.go
Expand Up @@ -43,7 +43,7 @@ const (
)

// PHPDefault is the default PHP version, overridden by $DDEV_PHP_VERSION
const PHPDefault = PHP71
const PHPDefault = PHP72

// ValidPHPVersions should be updated whenever PHP versions are added or removed, and should
// be used to ensure user-supplied values are valid.
Expand Down

0 comments on commit c39d6bd

Please sign in to comment.