Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Fix finding a composer executable #17

Merged
merged 1 commit into from
Jun 5, 2014

Conversation

kaloyan-raev
Copy link
Contributor

This patch makes the following improvements for finding a composer
executable:

  1. The check if composer is available on the executable path should
    check the exit code instead of the output. The assumption that the
    output will be empty if there is no executable is wrong. Checking the
    exit code is more reliable.
  2. The usage of file_put_contents() to download composer.phar was wrong.
    Instead of downloading the composer.phar, a text file with the download
    URL was created. This is now fixed.
  3. The patch makes sure that the downloaded composer.phar will be
    executable on UNIX systems.
  4. The getComposerExecutable() method now returns the full path of the
    downloaded or existing composer.phar, which makes it executable on UNIX
    systems too. Just 'composer.phar' cannot execute the file from the
    current directory. It must be at least './composer.phar'.
  5. The error message if composer fails now includes the exit code and
    the last line of the output.

This patch makes the following improvements for finding a composer
executable:
1. The check if composer is available on the executable path should
check the exit code instead of the output. The assumption that the
output will be empty if there is no executable is wrong. Checking the
exit code is more reliable.
2. The usage of file_put_contents() to download composer.phar was wrong.
Instead of downloading the composer.phar, a text file with the download
URL was created. This is now fixed.
3. The patch makes sure that the downloaded composer.phar will be
executable on UNIX systems.
4. The getComposerExecutable() method now returns the full path of the
downloaded or existing composer.phar, which makes it executable on UNIX
systems too. Just 'composer.phar' cannot execute the file from the
current directory. It must be at least './composer.phar'.
5. The error message if composer fails now includes the exit code and
the last line of the output.
ezimuel added a commit that referenced this pull request Jun 5, 2014
Fix finding a composer executable
@ezimuel ezimuel merged commit 1cd8c91 into zfcampus:master Jun 5, 2014
@ezimuel
Copy link
Contributor

ezimuel commented Jun 5, 2014

Thanks for the PR!

@weierophinney weierophinney added this to the 1.0.3 milestone Jun 5, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants