Skip to content

Commit

Permalink
Added support for the version of PHP that comes with Cygwin, in addit…
Browse files Browse the repository at this point in the history
…ion to the existing support for running standard PHP for Windows within Cygwin. Only in the latter case should we convert to the Windows path.
  • Loading branch information
mmcev106 committed Nov 22, 2016
1 parent 9f69119 commit f200689
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bin/wp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ while [ -h "$SELF_PATH" ]; do
done
cd "$ORIGDIR"

# Build the path to the root PHP file
SCRIPT_PATH="$(dirname "$SELF_PATH")/../php/boot-fs.php"

case $(uname -a) in
CYGWIN*)
SCRIPT_PATH="$(cygpath -w -a -- "$SCRIPT_PATH")" ;;
esac

if [ ! -z "$WP_CLI_PHP" ] ; then
# Use the WP_CLI_PHP environment variable if it is available.
php="$WP_CLI_PHP"
Expand All @@ -39,6 +31,13 @@ else
php="`which php`"
fi

# Build the path to the root PHP file
SCRIPT_PATH="$(dirname "$SELF_PATH")/../php/boot-fs.php"
case $("$php" -r "echo PHP_OS;") in
WINNT*)
SCRIPT_PATH="$(cygpath -w -a -- "$SCRIPT_PATH")" ;;
esac

# Pass in the path to php so that wp-cli knows which one
# to use if it re-launches itself to run other commands.
export WP_CLI_PHP_USED="$php"
Expand Down

0 comments on commit f200689

Please sign in to comment.