Skip to content

Commit

Permalink
Remove php7.2 config override for typo3 and drupal7 (#2612)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Nov 7, 2020
1 parent 780fc87 commit 8e87bd3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 30 deletions.
8 changes: 2 additions & 6 deletions pkg/ddevapp/apptypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,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,
},
nodeps.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,
},
nodeps.AppTypeDrupal8: {
settingsCreator: createDrupal8SettingsFile, uploadDir: getDrupalUploadDir, hookDefaultComments: getDrupal8Hooks, apptypeSettingsPaths: setDrupalSiteSettingsPaths, appTypeDetect: isDrupal8App, postImportDBAction: nil, configOverrideAction: drupal8ConfigOverrideAction, postConfigAction: nil, postStartAction: drupal8PostStartAction, importFilesAction: drupalImportFilesAction, defaultWorkingDirMap: docrootWorkingDir,
Expand All @@ -83,7 +83,7 @@ func init() {
settingsCreator: createWordpressSettingsFile, uploadDir: getWordpressUploadDir, hookDefaultComments: getWordpressHooks, apptypeSettingsPaths: setWordpressSiteSettingsPaths, appTypeDetect: isWordpressApp, postImportDBAction: nil, configOverrideAction: nil, postConfigAction: nil, postStartAction: wordpressPostStartAction, importFilesAction: wordpressImportFilesAction,
},
nodeps.AppTypeTYPO3: {
settingsCreator: createTypo3SettingsFile, uploadDir: getTypo3UploadDir, hookDefaultComments: getTypo3Hooks, apptypeSettingsPaths: setTypo3SiteSettingsPaths, appTypeDetect: isTypo3App, postImportDBAction: nil, configOverrideAction: typo3ConfigOverrideAction, postConfigAction: nil, postStartAction: typo3PostStartAction, importFilesAction: typo3ImportFilesAction,
settingsCreator: createTypo3SettingsFile, uploadDir: getTypo3UploadDir, hookDefaultComments: getTypo3Hooks, apptypeSettingsPaths: setTypo3SiteSettingsPaths, appTypeDetect: isTypo3App, postImportDBAction: nil, configOverrideAction: nil, postConfigAction: nil, postStartAction: typo3PostStartAction, importFilesAction: typo3ImportFilesAction,
},
nodeps.AppTypeBackdrop: {
settingsCreator: createBackdropSettingsFile, uploadDir: getBackdropUploadDir, hookDefaultComments: getBackdropHooks, apptypeSettingsPaths: setBackdropSiteSettingsPaths, appTypeDetect: isBackdropApp, postImportDBAction: backdropPostImportDBAction, configOverrideAction: nil, postConfigAction: nil, postStartAction: backdropPostStartAction, importFilesAction: backdropImportFilesAction, defaultWorkingDirMap: docrootWorkingDir,
Expand All @@ -96,10 +96,6 @@ func init() {
},
nodeps.AppTypeLaravel: {appTypeDetect: isLaravelApp, postStartAction: laravelPostStartAction},
nodeps.AppTypeShopware6: {appTypeDetect: isShopware6App, apptypeSettingsPaths: setShopware6SiteSettingsPaths, uploadDir: getShopwareUploadDir, configOverrideAction: shopware6ConfigOverrideAction, postStartAction: shopware6PostStartAction, importFilesAction: shopware6ImportFilesAction},

//nodeps.AppTypeShopware6: {
// settingsCreator: createShopware6SettingsFile, uploadDir: getMagento2UploadDir, hookDefaultComments: nil, apptypeSettingsPaths: setShopware6SiteSettingsPaths, appTypeDetect: isShopware6App, postImportDBAction: nil, configOverrideAction: nil, postConfigAction: nil, postStartAction: nil, importFilesAction: Shopware6ImportFilesAction, defaultWorkingDirMap: nil,
//},
}
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/ddevapp/apptypes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ func TestPostConfigAction(t *testing.T) {

appTypes := map[string]string{
nodeps.AppTypeDrupal6: nodeps.PHP56,
nodeps.AppTypeDrupal7: nodeps.PHP72,
nodeps.AppTypeDrupal7: nodeps.PHPDefault,
nodeps.AppTypeDrupal8: nodeps.PHPDefault,
nodeps.AppTypeDrupal9: nodeps.PHPDefault,
nodeps.AppTypeWordPress: nodeps.PHPDefault,
nodeps.AppTypeBackdrop: nodeps.PHPDefault,
nodeps.AppTypeMagento: nodeps.PHP56,
}

for appType, expectedPHPVersion := range appTypes {
Expand Down
12 changes: 6 additions & 6 deletions pkg/ddevapp/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ func TestConfigCommand(t *testing.T) {
const phpVersionPos = 1
testMatrix := map[string][]string{
"drupal6phpversion": {nodeps.AppTypeDrupal6, nodeps.PHP56},
"drupal7phpversion": {nodeps.AppTypeDrupal7, nodeps.PHP72},
"drupal8phpversion": {nodeps.AppTypeDrupal8, nodeps.PHP73},
"drupal7phpversion": {nodeps.AppTypeDrupal7, nodeps.PHPDefault},
"drupal8phpversion": {nodeps.AppTypeDrupal8, nodeps.PHPDefault},
}

for testName, testValues := range testMatrix {
Expand Down Expand Up @@ -295,8 +295,8 @@ func TestConfigCommandInteractiveCreateDocrootDenied(t *testing.T) {

testMatrix := map[string][]string{
"drupal6phpversion": {nodeps.AppTypeDrupal6, nodeps.PHP56},
"drupal7phpversion": {nodeps.AppTypeDrupal7, nodeps.PHP72},
"drupal8phpversion": {nodeps.AppTypeDrupal8, nodeps.PHP73},
"drupal7phpversion": {nodeps.AppTypeDrupal7, nodeps.PHPDefault},
"drupal8phpversion": {nodeps.AppTypeDrupal8, nodeps.PHPDefault},
}

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

for testName, testValues := range testMatrix {
Expand Down
3 changes: 0 additions & 3 deletions pkg/ddevapp/ddevapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1391,9 +1391,6 @@ func TestDdevRestoreSnapshot(t *testing.T) {

app.Hooks = map[string][]ddevapp.YAMLTask{"post-snapshot": {{"exec-host": "touch hello-post-snapshot-" + app.Name}}, "pre-snapshot": {{"exec-host": "touch hello-pre-snapshot-" + app.Name}}}

// Try using php72 to avoid SIGBUS failures after restore.
app.PHPVersion = nodeps.PHP72

// First do regular start, which is good enough to get us to an ImportDB()
err = app.Start()
require.NoError(t, err)
Expand Down
7 changes: 0 additions & 7 deletions pkg/ddevapp/drupal.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,6 @@ func drupal6ConfigOverrideAction(app *DdevApp) error {
return nil
}

// drupal7ConfigOverrideAction overrides php_version for D7,
// since it is not yet compatible with php7.3
func drupal7ConfigOverrideAction(app *DdevApp) error {
app.PHPVersion = nodeps.PHP72
return nil
}

// drupal8ConfigOverrideAction overrides mariadb_version for Druapl 8 for future
// compatibility with Drupal 9, since it requires at least 10.3.
func drupal8ConfigOverrideAction(app *DdevApp) error {
Expand Down
7 changes: 0 additions & 7 deletions pkg/ddevapp/typo3.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package ddevapp

import (
"fmt"
"github.com/drud/ddev/pkg/nodeps"
"io/ioutil"

"os"
Expand Down Expand Up @@ -164,12 +163,6 @@ func isTypo3App(app *DdevApp) bool {
return false
}

// typo3ConfigOverrideAction sets a safe php_version for TYPO3
func typo3ConfigOverrideAction(app *DdevApp) error {
app.PHPVersion = nodeps.PHP72
return nil
}

// typo3ImportFilesAction defines the TYPO3 workflow for importing project files.
// The TYPO3 import-files workflow is currently identical to the Drupal workflow.
func typo3ImportFilesAction(app *DdevApp, importPath, extPath string) error {
Expand Down

0 comments on commit 8e87bd3

Please sign in to comment.