File tree Expand file tree Collapse file tree 2 files changed +28
-9
lines changed Expand file tree Collapse file tree 2 files changed +28
-9
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
+ export PHP_PATH=` find /opt/php/ -maxdepth 1 -type d -name " ${PHP_VERSION} .*-64bit" -print | sort -V -r | head -1`
18
+ fi
19
+
20
+ if [ ! -d " $PHP_PATH " ]; then
21
+ echo " Could not find PHP binaries for version ${PHP_VERSION} . Listing available versions..."
22
+ ls -1 /opt/php
23
+ exit 1
24
+ fi
25
+
26
+ export PATH=$PHP_PATH /bin:$PATH
27
+ }
28
+
4
29
install_extension ()
5
30
{
6
31
# Workaround to get PECL running on PHP 7.0
7
- export PHP_PEAR_PHP_BIN=${PHP_PATH} /bin/php
8
- export PHP_PEAR_INSTALL_DIR=${PHP_PATH} /lib /php
32
+ # export PHP_PEAR_PHP_BIN=${PHP_PATH}/bin/php
33
+ # export PHP_PEAR_INSTALL_DIR=${PHP_PATH}/bin /php
9
34
10
35
rm -f ${PHP_PATH} /lib/php.ini
11
36
@@ -100,10 +125,7 @@ case "$DEPENDENCIES" in
100
125
;;
101
126
esac
102
127
103
- PHP_PATH=/opt/php/${PHP_VERSION} -64bit
104
- OLD_PATH=$PATH
105
- PATH=$PHP_PATH /bin:$OLD_PATH
106
-
128
+ set_php_version $PHP_VERSION
107
129
install_extension
108
130
install_composer
109
131
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