Skip to content

Commit

Permalink
fix: TYPO3 no longer has typo3cms command, update other out-of-date (d…
Browse files Browse the repository at this point in the history
…dev#6211) [skip ci]
  • Loading branch information
rfay authored May 20, 2024
1 parent 52d42d4 commit 926722b
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 24 deletions.
1 change: 0 additions & 1 deletion .spellcheckwordlist.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
1Password
ARG
AdditionalConfig
AdditionalConfiguration
Adminer
Apache
Acquia
Expand Down
4 changes: 2 additions & 2 deletions cmd/ddev/cmd/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestCustomCommands(t *testing.T) {
app.Type = origAppType

// The various CMS commands should not be available here
for _, c := range []string{"artisan", "cake", "drush", "magento", "typo3", "typo3cms", "wp"} {
for _, c := range []string{"artisan", "cake", "drush", "magento", "typo3", "wp"} {
_, err = exec.RunHostCommand(DdevBin, c, "-h")
assert.Error(err, "found command %s when it should not have been there (no error) app.Type=%s", c, app.Type)
}
Expand All @@ -225,7 +225,7 @@ func TestCustomCommands(t *testing.T) {
_, _ = exec.RunHostCommand(DdevBin, "debug", "fix-commands")
err = app.MutagenSyncFlush()
assert.NoError(err)
for _, c := range []string{"typo3", "typo3cms"} {
for _, c := range []string{"typo3"} {
_, err = exec.RunHostCommand(DdevBin, "help", c)
assert.NoError(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/users/usage/cms-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml'

#### Settings Files

On [`ddev start`](../usage/commands.md#start), DDEV creates a `public/typo3conf/AdditionalConfiguration.php` file with database configuration in it.
On [`ddev start`](../usage/commands.md#start), DDEV creates a `config/system/additional.php` file with database configuration in it.

#### Setup a Base Variant (since TYPO3 9.5)

Expand Down
2 changes: 1 addition & 1 deletion docs/content/users/usage/managing-projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For **Magento 1**, DDEV settings go into `app/etc/local.xml`.

In **Magento 2**, DDEV settings go into `app/etc/env.php`.

For **TYPO3**, DDEV settings are written to `AdditionalConfiguration.php`. If `AdditionalConfiguration.php` exists and is not managed by DDEV, it will not be modified.
For **TYPO3**, DDEV settings are written to `config/system/additional.php`. If `additional.php` exists and is not managed by DDEV, it will not be modified.

For **WordPress**, DDEV settings are written to a DDEV-managed file, `wp-config-ddev.php`. The `ddev config` command will attempt to write settings through the following steps:

Expand Down
12 changes: 0 additions & 12 deletions pkg/ddevapp/global_dotddev_assets/commands/web/typo3cms

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/ddevapp/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const ConfigInstructions = `
# disable_settings_management: false
# If true, DDEV will not create CMS-specific settings files like
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
# Drupal's settings.php/settings.ddev.php or TYPO3's additional.php
# In this case the user must provide all such settings.
# You can inject environment variables into the web container with:
Expand Down
10 changes: 5 additions & 5 deletions pkg/ddevapp/typo3.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/ddev/ddev/pkg/util"
)

// createTypo3SettingsFile creates the app's LocalConfiguration.php and
// AdditionalConfiguration.php, adding things like database host, name, and
// createTypo3SettingsFile creates the app's settings.php and
// additional.php, adding things like database host, name, and
// password. Returns the fullpath to settings file and error
func createTypo3SettingsFile(app *DdevApp) (string, error) {
if filepath.Dir(app.SiteDdevSettingsFile) == app.AppRoot {
Expand All @@ -29,7 +29,7 @@ func createTypo3SettingsFile(app *DdevApp) (string, error) {
util.Warning("TYPO3 does not seem to have been set up yet, missing %s (%s)", filepath.Base(app.SiteSettingsPath), app.SiteSettingsPath)
}

// TYPO3 DDEV settings file will be AdditionalConfiguration.php (app.SiteDdevSettingsFile).
// TYPO3 DDEV settings file will be additional.php (app.SiteDdevSettingsFile).
// Check if the file already exists.
if fileutil.FileExists(app.SiteDdevSettingsFile) {
// Check if the file is managed by ddev.
Expand All @@ -47,14 +47,14 @@ func createTypo3SettingsFile(app *DdevApp) (string, error) {

output.UserOut.Printf("Generating %s file for database connection.", filepath.Base(app.SiteDdevSettingsFile))
if err := writeTypo3SettingsFile(app); err != nil {
return "", fmt.Errorf("failed to write TYPO3 AdditionalConfiguration.php file: %v", err.Error())
return "", fmt.Errorf("failed to write TYPO3 %s file: %v", app.SiteDdevSettingsFile, err.Error())
}

return app.SiteDdevSettingsFile, nil
}

// writeTypo3SettingsFile produces AdditionalConfiguration.php file
// It's assumed that the LocalConfiguration.php already exists, and we're
// It's assumed that the settings.php already exists, and we're
// overriding the db config values in it. The typo3conf/ directory will
// be created if it does not yet exist.
func writeTypo3SettingsFile(app *DdevApp) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/typo3/AdditionalConfiguration.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* #ddev-generated: Automatically generated TYPO3 AdditionalConfiguration.php file.
* #ddev-generated: Automatically generated TYPO3 additional.php file.
* ddev manages this file and may delete or overwrite the file unless this comment is removed.
* It is recommended that you leave this file alone.
*/
Expand Down

0 comments on commit 926722b

Please sign in to comment.