(app *DdevApp)
| 84 | } |
| 85 | |
| 86 | func enableDotEnvLoading(app *DdevApp) error { |
| 87 | bootstrapFileName := "config/bootstrap.php" |
| 88 | bootstrapFilePath := filepath.Join(app.AppRoot, app.ComposerRoot, bootstrapFileName) |
| 89 | envFunction := "// if (!env('APP_NAME') && file_exists(CONFIG . '.env')) {\n// $dotenv = new \\josegonzalez\\Dotenv\\Loader([CONFIG . '.env']);\n// $dotenv->parse()\n// ->putenv()\n// ->toEnv()\n// ->toServer();\n// }\n" |
| 90 | err := fileutil.ReplaceStringInFile(envFunction, strings.ReplaceAll(envFunction, "// ", ""), bootstrapFilePath, bootstrapFilePath) |
| 91 | if err != nil { |
| 92 | return err |
| 93 | } |
| 94 | |
| 95 | return nil |
| 96 | } |
no test coverage detected