mirror of
https://github.com/cytopia/devilbox.git
synced 2025-04-13 22:03:08 +00:00
Fix check against PHP version
This commit is contained in:
parent
d8794950c0
commit
09ac5f3f85
@ -5,7 +5,7 @@ set -u
|
||||
set -o pipefail
|
||||
|
||||
|
||||
DISABLED_VERSIONS=("7.2")
|
||||
DISABLED_VERSIONS=("7.4")
|
||||
|
||||
|
||||
#
|
||||
@ -20,15 +20,15 @@ DISABLED_VERSIONS=("7.2")
|
||||
|
||||
printf "[TEST] Get PHP version"
|
||||
# 1st Try
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
# 2nd Try
|
||||
sleep 1
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
# 3rd Try
|
||||
sleep 1
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
printf "\r[FAIL] Get PHP version\n"
|
||||
curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' || true
|
||||
curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' || true
|
||||
exit 1
|
||||
else
|
||||
printf "\r[OK] Get PHP version (3 rounds): %s\n" "${PHP_VERSION}"
|
||||
|
@ -49,15 +49,15 @@ fi
|
||||
|
||||
printf "[TEST] Get PHP version"
|
||||
# 1st Try
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
# 2nd Try
|
||||
sleep 1
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
# 3rd Try
|
||||
sleep 1
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
printf "\r[FAIL] Get PHP version\n"
|
||||
curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' || true
|
||||
curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' || true
|
||||
exit 1
|
||||
else
|
||||
printf "\r[OK] Get PHP version (3 rounds): %s\n" "${PHP_VERSION}"
|
||||
@ -70,16 +70,16 @@ else
|
||||
fi
|
||||
|
||||
|
||||
|
||||
###
|
||||
### Ensure only to check against desired versions
|
||||
###
|
||||
|
||||
if [[ ! ${DISABLED_VERSIONS[*]} =~ ${PHP_VERSION} ]]; then
|
||||
|
||||
###
|
||||
### Ensure PHPRedmin works in subdirectory
|
||||
###
|
||||
|
||||
###
|
||||
### Ensure PHPRedmin works in subdirectory
|
||||
###
|
||||
URL="/vendor/phpredmin/public/index.php/welcome/info/0/0"
|
||||
|
||||
printf "[TEST] Fetch ${URL}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user