Skip to content

Commit 527e51e

Browse files
committed
use minor version in PHP_VERSION
1 parent 22f2032 commit 527e51e

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

build-static.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,20 @@ if [ -n "${DEBUG_SYMBOLS}" ]; then
5858
fi
5959
# php version to build
6060
if [ -z "${PHP_VERSION}" ]; then
61-
export PHP_VERSION="8.4"
61+
get_latest_php_version() {
62+
input="$1"
63+
json=$(curl -s "https://www.php.net/releases/index.php?json&version=$input")
64+
latest=$(echo "$json" | jq -r '.version')
65+
66+
if [[ "$latest" == "$input"* ]]; then
67+
echo "$latest"
68+
else
69+
echo "$input"
70+
fi
71+
}
72+
73+
PHP_VERSION="$(get_latest_php_version "8")"
74+
export PHP_VERSION
6275
fi
6376
# default extension set
6477
defaultExtensions="apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,ftp,gd,gmp,gettext,iconv,igbinary,imagick,intl,ldap,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,parallel,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,ssh2,sysvmsg,sysvsem,sysvshm,tidy,tokenizer,xlswriter,xml,xmlreader,xmlwriter,zip,zlib,yaml,zstd"

0 commit comments

Comments
 (0)