Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[PhpUnitBridge] Ability to use different composer.json file#26482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Hi, I have a project where I use a different composer.json via environment variable. Look here. Because of this, $root gets set to "/" and everything fails.Hope this helps.
| $PHPUNIT_VERSION ='4.8'; | ||
| } | ||
| COMPOSER_FILE_NAME =getenv('COMPOSER_FILE_NAME') ? :'composer.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
COMPOSER_FILE_NAMEis non-standard. According to https://getcomposer.org/doc/03-cli.md#environment-variables, it should beCOMPOSER` instead.
nicolas-grekasMar 12, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This should work:
if ('composer.json' !== $COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json') { putenv('COMPOSER=composer.json'); $_SERVER['COMPOSER'] = $_ENV['COMPOSER'] = 'composer.json';}amcastror commentedMar 10, 2018
@fabpot, if we used COMPOSER as the var name, then other composer calls would fail:
I'm not sure at which point it fails, I could look in to it but I'll need some more time. Do you have any ideas why that fails? |
amcastror commentedMar 12, 2018
@nicolas-grekas, I can confirm it works using "COMPOSER": I updated the PR. |
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
(for 3.4)
fabpot commentedMar 13, 2018
Thank you@amcastror. |
…e (amcastror)This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes#26482).Discussion----------[PhpUnitBridge] Ability to use different composer.json fileHi, I have a project where I use a different composer.json via environment variable. Look [here](https://getcomposer.org/doc/03-cli.md#composer). Because of this, $root gets set to "/" and everything fails.Hope this helps.| Q | A| ------------- | ---| Branch? | master for features / 2.7 up to 4.0 for bug fixes <!-- see below -->| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes| Tests pass? | I'll add if this is useful.| Fixed tickets || License | MIT| Doc PR | symfony/symfony-docs<!--Write a short README entry for your feature/bugfix here (replace this comment block.)This will help people understand your PR and can be used as a start of the Doc PR.Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch.-->Commits-------77e643d [PhpUnitBridge] Ability to use different composer.json file


Hi, I have a project where I use a different composer.json via environment variable. Lookhere. Because of this, $root gets set to "/" and everything fails.
Hope this helps.