File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,23 @@ MEMSIZE_MB=$(free -m | awk '/^Mem:/{print $2}')
16
16
# ----------------#
17
17
18
18
bison_version=" 2.7.1"
19
- php_version=" 5.6.40"
19
+ php_version=" latest"
20
+
21
+ # get the exact latest 5.6 version number
22
+ if [ " ${php_version,,} " = ' latest' ]; then
23
+ # get something like "5.6.40"
24
+ php_version=$( \
25
+ curl -s -k ' https://api.github.com/repos/php/php-src/git/refs/tags' | \
26
+ python -m json.tool | \
27
+ command grep -Pio ' php-5.6.[0-9]+((alpha|beta|rc)[0-9]*)?' | \
28
+ uniq | \
29
+ tail -1 | \
30
+ # remove leading "php-"
31
+ cut -b 5-
32
+ )
33
+
34
+ echo " [*] The latest PHP 5.6 version is ${php_version} "
35
+ fi
20
36
21
37
# such as "5.6.39" => "56"
22
38
php_version_path=$( echo " ${php_version} " | sed -r ' s/^([0-9]+)(\.([0-9]+))?.*$/\1\3/g' )
You can’t perform that action at this time.
0 commit comments