Skip to content

Commit 6c39cb8

Browse files
authored
Add new layer for MongoDB driver for PHP v2.0.0 (#592)
1 parent f81e9ef commit 6c39cb8

File tree

6 files changed

+35
-3
lines changed

6 files changed

+35
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 1.8.0
44

55
- Upgrade Imagick to version 7.1.1-38 and build with support for AVIF format (aom encoder).
6+
- Added support for [MongoDB driver for PHP](https://pecl.php.net/package/mongodb) 2.0.0
67

78
## 1.7.2
89

Readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ functions:
6464
| gnupg | `${bref-extra:gnupg-php-81}` |
6565
| GMP | `${bref-extra:gmp-php-81}` |
6666
| gRPC | `${bref-extra:grpc-php-81}` |
67-
| h3 | `${bref-extra:h3-php-81}` |
67+
| h3 | `${bref-extra:h3-php-81}` |
6868
| Igbinary | `${bref-extra:igbinary-php-81}` |
6969
| Imagick | `${bref-extra:imagick-php-81}` |
7070
| IMAP | `${bref-extra:imap-php-81}` |
@@ -73,7 +73,8 @@ functions:
7373
| MaxMind DB | `${bref-extra:maxminddb-php-81}` |
7474
| Memcache | `${bref-extra:memcache-php-81}` |
7575
| Memcached | `${bref-extra:memcached-php-81}` |
76-
| MongoDB | `${bref-extra:mongodb-php-81}` |
76+
| MongoDB v1.x | `${bref-extra:mongodb-php-81` |
77+
| MongoDB v2.x | `${bref-extra:mongodb2-php-81}` |
7778
| MsgPack | `${bref-extra:msgpack-php-81}` |
7879
| Newrelic | `${bref-extra:newrelic-php-81}` |
7980
| ODBC Snowflake | `${bref-extra:odbc-snowflake-php-81}` |

layers/mongodb/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG PHP_VERSION
22
ARG BREF_VERSION
33
FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext
44

5-
RUN pecl install --force mongodb
5+
RUN pecl install --force mongodb-1.20.0
66
RUN cp `php-config --extension-dir`/mongodb.so /tmp/mongodb.so
77
RUN echo 'extension=mongodb.so' > /tmp/ext.ini
88

layers/mongodb2/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ARG PHP_VERSION
2+
ARG BREF_VERSION
3+
FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext
4+
5+
RUN pecl install --force mongodb-2.0.0
6+
RUN cp `php-config --extension-dir`/mongodb.so /tmp/mongodb.so
7+
RUN echo 'extension=mongodb.so' > /tmp/ext.ini
8+
9+
# Build the final image with just the files we need
10+
FROM scratch
11+
12+
# Copy the things we installed to the final image
13+
COPY --from=ext /tmp/mongodb.so /opt/bref/extensions/mongodb.so
14+
COPY --from=ext /tmp/ext.ini /opt/bref/etc/php/conf.d/ext-mongodb.ini

layers/mongodb2/config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"php": [
3+
"81",
4+
"82",
5+
"83",
6+
"84"
7+
]
8+
}

layers/mongodb2/test.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
if (!class_exists($class = MongoDB\Driver\Manager::class)) {
4+
echo sprintf('FAIL: Class "%s" does not exist.', $class).PHP_EOL;
5+
exit(1);
6+
}
7+
8+
exit(0);

0 commit comments

Comments
 (0)