Updated get-modules tests

This commit is contained in:
cytopia 2022-02-03 10:01:56 +01:00
parent 9b37e3a307
commit 928d5a2475
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
2 changed files with 44 additions and 5 deletions

View File

@ -8,7 +8,7 @@ endif
# -------------------------------------------------------------------------------------------------
update-readme:
cat "../README.md" \
| perl -00 -pe "s#<!-- modules -->.*<!-- /modules -->#<!-- modules -->\n$$(./scripts/get-modules.sh)\n<!-- /modules -->#s" \
| perl -0 -pe "s#<!-- modules -->.*<!-- /modules -->#<!-- modules -->\n$$(./scripts/get-modules.sh)\n<!-- /modules -->#s" \
> "../README.md.tmp"
yes | mv -f "../README.md.tmp" "../README.md"

View File

@ -169,6 +169,18 @@ if ! PHP81_BASE="$( run "\
exit 1
fi
if ! PHP82_BASE="$( run "\
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
| tac \
| tac \
| grep -E '82-base' \
| sed \
-e 's/.*\">//g' \
-e 's/<.*//g'" "${RETRIES}" )"; then
>&2 echo "Failed to retrieve modules for PHP 8.2"
exit 1
fi
###
### Get PHP mods modules (5 rounds)
###
@ -317,10 +329,22 @@ if ! PHP81_MODS="$( run "\
exit 1
fi
if ! PHP82_MODS="$( run "\
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
| tac \
| tac \
| grep -E '82-mods' \
| sed \
-e 's/.*\">//g' \
-e 's/<.*//g'" "${RETRIES}" )"; then
>&2 echo "Failed to retrieve modules for PHP 8.2"
exit 1
fi
###
### Todo: add ioncube
###
MODS="$( echo "${PHP52_MODS}, ${PHP53_MODS}, ${PHP54_MODS}, ${PHP55_MODS}, ${PHP56_MODS}, ${PHP70_MODS}, ${PHP71_MODS}, ${PHP72_MODS}, ${PHP73_MODS}, ${PHP74_MODS}, ${PHP80_MODS}, ${PHP81_MODS}" | sed 's/,/\n/g' | sed -e 's/^\s*//g' -e 's/\s*$//g' | sort -uf )"
MODS="$( echo "${PHP52_MODS}, ${PHP53_MODS}, ${PHP54_MODS}, ${PHP55_MODS}, ${PHP56_MODS}, ${PHP70_MODS}, ${PHP71_MODS}, ${PHP72_MODS}, ${PHP73_MODS}, ${PHP74_MODS}, ${PHP80_MODS}, ${PHP81_MODS}, ${PHP82_MODS}" | sed 's/,/\n/g' | sed -e 's/^\s*//g' -e 's/\s*$//g' | sort -uf )"
###
@ -333,11 +357,11 @@ E="🗸" # Enabled mods modules (can be disabled)
D="d" # Disabled modules (can be enabled)
U=" " # Unavailable
echo "| Modules | <sup>PHP 5.2</sup> | <sup>PHP 5.3</sup> | <sup>PHP 5.4</sup> | <sup>PHP 5.5</sup> | <sup>PHP 5.6</sup> | <sup>PHP 7.0</sup> | <sup>PHP 7.1</sup> | <sup>PHP 7.2</sup> | <sup>PHP 7.3</sup> | <sup>PHP 7.4</sup> | <sup>PHP 8.0</sup> | <sup>PHP 8.1</sup> |"
echo "|-------------------------------|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|"
echo "| Modules | <sup>PHP 5.2</sup> | <sup>PHP 5.3</sup> | <sup>PHP 5.4</sup> | <sup>PHP 5.5</sup> | <sup>PHP 5.6</sup> | <sup>PHP 7.0</sup> | <sup>PHP 7.1</sup> | <sup>PHP 7.2</sup> | <sup>PHP 7.3</sup> | <sup>PHP 7.4</sup> | <sup>PHP 8.0</sup> | <sup>PHP 8.1</sup> | <sup>PHP 8.2</sup> |"
echo "|-------------------------------|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|"
echo "${MODS}" | while read -r line; do
# Print current module
printf "| %-30s%s" "<small>${line}</small>" "|"
printf "| %-30s%s" "<sup>${line}</sup>" "|"
# ---------- PHP 5.2 ----------#
if echo ",${PHP52_MODS}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
@ -519,5 +543,20 @@ echo "${MODS}" | while read -r line; do
printf " %s |" "${U}" # Not available
fi
# ---------- PHP 8.2 ----------#
if echo ",${PHP82_MODS}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
if echo "${DISABLED}" | grep -Eq ",${line},"; then
printf " %s |" "${D}" # Currently disabled
else
if echo ",${PHP82_BASE}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${B}" # Enabled, but cannot be disabled
else
printf " %s |" "${E}" # Enabled, can be disabled
fi
fi
else
printf " %s |" "${U}" # Not available
fi
printf "\\n"
done