Deprecate PHP < 7.1.3 (#9645)

* Added validation and support for users on PHP < 7.1.3

* Branch name php56
This commit is contained in:
Neil Lathwood
2019-02-07 19:23:30 +00:00
committed by Tony Murray
parent 80f31b4831
commit 6fdafd137c
3 changed files with 25 additions and 6 deletions

View File

@@ -126,16 +126,23 @@ set_notifiable_result() {
#######################################
check_php_ver() {
local branch=$(git rev-parse --abbrev-ref HEAD)
local ver_res=$(php -r "echo (int)version_compare(PHP_VERSION, '5.6.4', '<');")
if [[ "$branch" == "php53" ]] && [[ "$ver_res" == "0" ]]; then
local ver_56=$(php -r "echo (int)version_compare(PHP_VERSION, '5.6.4', '<');")
local ver_71=$(php -r "echo (int)version_compare(PHP_VERSION, '7.1.3', '<');")
if [[ "$branch" == "php53" ]] && [[ "$ver_56" == "0" ]]; then
status_run "Supported PHP version, switched back to master branch." 'git checkout master'
branch="master"
elif [[ "$branch" != "php53" ]] && [[ "$ver_res" == "1" ]]; then
elif [[ "$branch" == "php56" ]] && [[ "$ver_71" == "0" ]]; then
status_run "Supported PHP version, switched back to master branch." 'git checkout master'
branch="master"
elif [[ "$branch" != "php53" ]] && [[ "$ver_56" == "1" ]]; then
status_run "Unsupported PHP version, switched to php53 branch." 'git checkout php53'
branch="php53"
elif [[ "$branch" != "php56" ]] && [[ "$ver_71" == "1" ]]; then
status_run "Unsupported PHP version, switched to php56 branch." 'git checkout php56'
branch="php56"
fi
set_notifiable_result phpver ${ver_res}
set_notifiable_result phpver ${branch}
return ${ver_res};
}