Use php-config to get semver

This commit is contained in:
Shivam Mathur 2022-01-03 06:49:22 +05:30
parent cb614c45fa
commit 22ebe0d733
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -92,7 +92,7 @@ configure_php() {
# Function to get PHP version in semver format.
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.