silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
720 stars 820 forks source link

Sake script failure when PHP binary path contains spaces in SilverStripe 5.2.2 #11289

Closed digitall-it closed 5 days ago

digitall-it commented 6 days ago

Module version(s) affected

5.2.2

Description

When executing the 'vendor/bin/sake' command in a SilverStripe 5.2.2 environment where the PHP binary path includes spaces, the script fails. This prevents the build process from completing successfully.

How to reproduce

  1. Install PHP in a directory with spaces in its path.
  2. Configure the environment to use this PHP binary.
  3. Run 'vendor/bin/sake build' from the terminal.
  4. Observe the failure due to spaces in the PHP path in row 45, and when corrected, on row 121

Possible Solution

Quote all paths used in shell commands within the script to properly handle spaces. For example, changing the script to use "$php" instead of $php when invoking the PHP binary.

Additional Context

This issue arises particularly on systems where default installation paths for software like PHP may contain spaces, such as within 'Program Files' on Windows or 'Application Support' on Mac.

Validations

PRs

GuySartorelli commented 5 days ago

PR merged. The fix will be included in the October minor release.