Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions wp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ if [ "x$wp_cli_php_override" != "x" ] ; then
fi

# Get the php version
PHP_VERSION=$($php -r echo\ phpversion\(\)\;)
PHP_VERSION=$($php -r 'echo phpversion();')
# Keep only major version number
PHP_VERSION=${PHP_VERSION%%-*}

# Format version numbers
CURRENT_NUMBER=$(echo "$PHP_VERSION" | tr -d '.')
Expand All @@ -106,4 +108,4 @@ fi

# Pass in the path to php so that wp-cli knows which one
# to use if it re-launches itself to run subcommands
exec $php "$SCRIPT_PATH" "$@"
exec $php "$SCRIPT_PATH" "$@"