File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
set -o errexit # Exit the script with error if any of the commands fail
3
3
4
+ set_php_version ()
5
+ {
6
+ PHP_VERSION=$1
7
+
8
+ if [ ! -d " /opt/php" ]; then
9
+ echo " PHP is not available"
10
+ exit 1
11
+ fi
12
+
13
+ if [ -d " /opt/php/${PHP_VERSION} -64bit/bin" ]; then
14
+ export PHP_PATH=" /opt/php/${PHP_VERSION} -64bit/bin"
15
+ else
16
+ # Try to find the newest version matching our constant
17
+ ls -1 /opt/php
18
+ find /opt/php/ -maxdepth 1 -type d -name " ${PHP_VERSION} *-64bit" -print
19
+ export PHP_PATH=` find /opt/php/ -maxdepth 1 -type d -name " ${PHP_VERSION} *-64bit" -print | sort -V -r | head -1` /bin
20
+ fi
21
+
22
+ if [ ! -d " $PHP_PATH " ]; then
23
+ echo " Could not find PHP binaries for version ${PHP_VERSION} . Listing available versions..."
24
+ ls -1 /opt/php
25
+ exit 1
26
+ fi
27
+
28
+ export PATH=$PHP_PATH :$PATH
29
+ }
30
+
4
31
install_extension ()
5
32
{
6
33
# Workaround to get PECL running on PHP 7.0
@@ -100,10 +127,7 @@ case "$DEPENDENCIES" in
100
127
;;
101
128
esac
102
129
103
- PHP_PATH=/opt/php/${PHP_VERSION} -64bit
104
- OLD_PATH=$PATH
105
- PATH=$PHP_PATH /bin:$OLD_PATH
106
-
130
+ set_php_version $PHP_VERSION
107
131
install_extension
108
132
install_composer
109
133
Original file line number Diff line number Diff line change @@ -37,9 +37,6 @@ OS=$(uname -s | tr '[:upper:]' '[:lower:]')
37
37
38
38
echo " Running tests with $AUTH and $SSL , connecting to: $MONGODB_URI "
39
39
40
- OLD_PATH=$PATH
41
- PATH=/opt/php/${PHP_VERSION} -64bit/bin:$OLD_PATH
42
-
43
40
# Disable failing PHPUnit due to deprecations
44
41
export SYMFONY_DEPRECATIONS_HELPER=999999
45
42
You can’t perform that action at this time.
0 commit comments