-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathmongodb
More file actions
executable file
·51 lines (37 loc) · 1.06 KB
/
mongodb
File metadata and controls
executable file
·51 lines (37 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
set -e
if [ -n "${BUILDPACK_DEBUG}" ]; then
set -x
fi
# $mongodb_version, $PREFIX and $EXT_DIR are loaded from versions.sh
source "/buildpack/conf/versions.sh"
# The following variables are passed to this script by lib/php_ext
php_version="${1}"
zend_api_version="${2}"
# Use legacy version with PHP < 8.1
# See conf/versions.sh for further explanations regarding this support.
if [ "${zend_api_version}" -lt "${PHP_MODULE_API_VERSIONS['8.1']}" ]; then
mongodb_version="${pre81_mongodb_version}"
fi
url="https://pecl.php.net/get/mongodb-${mongodb_version}.tgz"
curl --location "${url}" \
| tar xzv
pushd "mongodb-${mongodb_version}"
if ! /app/vendor/php/bin/phpize; then
echo "Fail to PHPize mongodb extension"
exit 1
fi
if ! ./configure \
--with-php-config=/app/vendor/php/bin/php-config \
--enable-mongo
then
echo "Fail to configure mongo extension"
exit 1
fi
if ! make; then
echo "Fail to build mongodb extension"
exit 1
fi
cp modules/mongodb.so "${EXT_DIR}/mongodb.so"
popd
echo "extension=mongodb.so" > "${PREFIX}/etc/conf.d/mongodb.ini"