mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Use php-config to get semver
This commit is contained in:
parent
cb614c45fa
commit
22ebe0d733
@ -92,7 +92,7 @@ configure_php() {
|
|||||||
|
|
||||||
# Function to get PHP version in semver format.
|
# Function to get PHP version in semver format.
|
||||||
php_semver() {
|
php_semver() {
|
||||||
php -v | grep -Eo -m 1 "[0-9]+\.[0-9]+\.[0-9]+((-?[a-zA-Z]+([0-9]+)?)?){2}" | head -n 1
|
grep -Eo 'version="[0-9]+(\.[0-9]+){2}((-?[a-zA-Z]+([0-9]+)?)?){2}' "$(command -v php-config)" | cut -d '"' -f 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to get the tag for a php version.
|
# Function to get the tag for a php version.
|
||||||
|
Loading…
Reference in New Issue
Block a user