33__DIR__=` dirname " $0 " `
44ROOT_DIR=" ${__DIR__} /../.."
55
6+ PHP_VERSIONS_SUPPORTED_PATTERN=' (php74|php8)'
7+
68main ()
79{
810 importEnvironmentVariablesFromDirectory " ${ROOT_DIR} "
@@ -11,8 +13,6 @@ main ()
1113
1214 startDockerComposeServices
1315
14- populatePHPVersions
15-
1616 runTests
1717}
1818
2828
2929Options:
3030 --help Show this screen.
31- --php-versions Select specific php versions. [default: ${PHP_VERSIONS} ]
31+ --php-versions Select specific php versions. [default: ' ` echo ${PHP_VERSIONS} ` ' ]
3232 Examples:
3333 php53
3434 'php53 php54'
@@ -86,7 +86,7 @@ importEnvironmentVariablesFromDirectory ()
8686startDockerComposeServices ()
8787{
8888 echo " + ${DOCKER_COMPOSE} build"
89- ${DOCKER_COMPOSE} up -d --build --remove-orphans > /dev/null
89+ ${DOCKER_COMPOSE} up -d --build --remove-orphans ${PHP_VERSIONS} > /dev/null
9090}
9191
9292configureWithArguments ()
@@ -105,6 +105,8 @@ configureWithArguments ()
105105 PHP_TEST_RUNTIME=' tests/run.php'
106106 hasHelpOption=false
107107
108+ populatePHPVersions
109+
108110 parseOperands ${1+" $@ " }
109111
110112 if ${hasHelpOption} ; then
@@ -141,13 +143,18 @@ hasTty ()
141143populatePHPVersions ()
142144{
143145 if test x' all' = x" ${PHP_VERSIONS} " ; then
144- PHP_VERSIONS=` fetchAllPHPVersions `
146+ PHP_VERSIONS=` fetchSupportedPHPVersions `
145147 else : ; fi
146148}
147149
150+ fetchSupportedPHPVersions ()
151+ {
152+ fetchAllPHPVersions | grep -E " ${PHP_VERSIONS_SUPPORTED_PATTERN} "
153+ }
154+
148155fetchAllPHPVersions ()
149156{
150- ${DOCKER_COMPOSE} 2> /dev/null ps --services --filter status=running \
157+ ${DOCKER_COMPOSE} 2> /dev/null ps --services \
151158 | grep php \
152159 | sort
153160}
0 commit comments