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

Respect PHP version used by Composer and provide better feedback on failure #80

Merged
merged 4 commits into from Dec 16, 2019
Merged

Commits on Dec 14, 2019

  1. Improve feedback to user on failure to set paths

    Related to 79.
    
    When the setting of `installed_paths` fails, show an error instead of giving the impression that the setting of the `installed_paths` succeeded.
    jrfnl committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    c7a2e52 View commit details
    Browse the repository at this point in the history
  2. Use the PHP version used by Composer

    Possible not the best way to do this, but it does work, so consider this a proof of concept, if not the solution.
    
    The `getPhpExecCommand()` method in the `Composer\EventDispatcher\EventDispatcher` class basically does what is needed: find the PHP executable used by Composer and turn it into an executable command.
    
    Unfortunately, that method is `protected`, making it difficult to call that method from within the plugin.
    
    This now copies that method into the plugin and uses it to create the command to pass on to the `ProcessExecutor`.
    
    The copied method has some minor modifications to comply with the coding standards used within this project.
    
    Based on the proof of conflict referenced in 79, I can confirm that this would solve the issue.
    jrfnl committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    7199248 View commit details
    Browse the repository at this point in the history
  3. Minor code cleanup for Plugin.php

    - Moves command outside of exec call, for readability
    - Moves error message composition to begin of method, to keep it together with other preparations and keep `if/else` statement cleaner
    - Adds whitespace to separate actions that do not belong together or for readability
    - Removes redundant variable concat
    Potherca authored and jrfnl committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    6de96f6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    22d3cdc View commit details
    Browse the repository at this point in the history