Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PhpUnitBridge] Also search for composer.phar in git root folder #34188

Merged
merged 1 commit into from Nov 5, 2019

Conversation

@MaPePeR
Copy link
Contributor

MaPePeR commented Oct 30, 2019

Q A
Branch? 4.4 for features
Bug fix? kindof
New feature? addition to existing feature
Deprecations? no
Tickets Related: #26637 (comment)
License MIT

When you don't have a system composer installation, but a composer.phar in the project folder, you cannot use the simple-phpunit script from a subfolder of the project with e.g. ../vendor/bin/simple-phpunit.

This change also searches for the composer.phar in the current git root folder if it was not found at any other places to increase the likelihood of it being found.

@@ -99,6 +99,7 @@
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
|| file_exists($COMPOSER = rtrim(`git rev-parse --show-toplevel 2> /dev/null`).DIRECTORY_SEPARATOR.'composer.phar')

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Nov 4, 2019

Member

we should use NUL instead of /dev/null on Windows

This comment has been minimized.

Copy link
@MaPePeR

MaPePeR Nov 5, 2019

Author Contributor

In dfd1f18 NUL is used if '\\' === DIRECTORY_SEPARATOR

@nicolas-grekas nicolas-grekas added this to the 4.4 milestone Nov 5, 2019
@nicolas-grekas nicolas-grekas force-pushed the MaPePeR:patch-1 branch from dfd1f18 to 97fd204 Nov 5, 2019
@nicolas-grekas

This comment has been minimized.

Copy link
Member

nicolas-grekas commented Nov 5, 2019

Thank you @MaPePeR.

nicolas-grekas added a commit that referenced this pull request Nov 5, 2019
…t folder (MaPePeR)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Also search for composer.phar in git root folder

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features
| Bug fix?      | kindof
| New feature?  | addition to existing feature
| Deprecations? | no
| Tickets       | Related: #26637 (comment)
| License       | MIT

When you don't have a system `composer` installation, but a `composer.phar` in the project folder, you cannot use the `simple-phpunit` script from a subfolder of the project with e.g. `../vendor/bin/simple-phpunit`.

This change also searches for the `composer.phar` in the current git root folder if it was not found at any other places to increase the likelihood of it being found.

Commits
-------

97fd204 [PhpUnitBridge] Also search for composer.phar in git root folder
@nicolas-grekas nicolas-grekas merged commit 97fd204 into symfony:4.4 Nov 5, 2019
0 of 3 checks passed
0 of 3 checks passed
fabbot.io Some changes should be done to comply with our standards.
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@MaPePeR MaPePeR deleted the MaPePeR:patch-1 branch Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.