Repository navigation
feat: enhance PHP addon environment with DockerEnv() integration - #7651
Merged
Merged
Conversation
## The Issue PHP addons were using a limited set of hardcoded environment variables instead of the comprehensive environment provided by DockerEnv(). This resulted in: - Empty port values instead of actual configured ports - Missing environment variables available to other DDEV components - Hardcoded DDEV_APPROOT instead of configurable app root ## How This PR Solves The Issue - Replace manual environment variable creation with app.DockerEnv() - Use mergo library for proper map merging of addon-specific environment variables - Maintain backward compatibility for .ddev/.env.<addon-name> files - Preserve DDEV_VERBOSE functionality for verbose mode ## Manual Testing Instructions 1. Install a PHP addon that uses environment variables 2. Verify addon has access to proper port numbers and URLs 3. Test with custom .ddev/.env.<addon-name> files to ensure merging works 4. Confirm verbose mode still adds DDEV_VERBOSE=true ## Automated Testing Overview Existing tests for addon installation and PHP action processing should continue to pass. The change is backward compatible and only enhances the available environment variables. ## Release/Deployment Notes This change enhances PHP addon capabilities by providing the full environment variable set. No breaking changes expected as this only adds variables and improves existing values. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
2 tasks done
|
Download the artifacts for this pull request:
See Testing a PR. |
stasadev
approved these changes
Sep 24, 2025
stasadev
left a comment
Member
There was a problem hiding this comment.
Looks good to me.
I tested it with:
post_install_actions:
- |
<?php
var_dump($_ENV);I confirm that $_ENV now contains many more env variables.
Overrides from .ddev/.env* work.
DDEV_VERBOSE is added with --verbose.
Member
Author
|
Nice testing approach, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue
Working on ddev-upsun, I discovered that PHP addons were using a limited set of hardcoded environment variables instead of the complete environment provided by DockerEnv(). This resulted in:
Most of all I needed DDEV_PRIMARY_URL
How This PR Solves The Issue
This does change the signature of DockerEnv() but shouldn't do any damage that way.
Manual Testing Instructions
Automated Testing Overview
No changes
Release/Deployment Notes
🤖 Generated with Claude Code