Skip to content

Commit d583a4b

Browse files
author
Kevin Porebski
committed
Allow php 8 to install this package
1 parent 22b14e3 commit d583a4b

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.1.0,<8.0",
13+
"php": "^7.1.0 || ^8.0",
1414
"ext-mongodb": "*",
1515
"mongodb/mongodb": "^1.0",
1616
"phpunit/phpunit": ">=6.0,<10.0",

docker-compose.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
version: "3"
22
services:
3-
phpunit:
3+
php7phpunit:
44
build:
55
context: .
6-
dockerfile: phpunit.DOCKERFILE
7-
command:
6+
dockerfile: php7phpunit.DOCKERFILE
7+
command:
88
- bash
99
- -c
1010
- |
11-
composer install
11+
composer update
12+
vendor/bin/phpunit
13+
working_dir: /work
14+
15+
php8phpunit:
16+
build:
17+
context: .
18+
dockerfile: php8phpunit.DOCKERFILE
19+
command:
20+
- bash
21+
- -c
22+
- |
23+
composer update
1224
vendor/bin/phpunit
1325
working_dir: /work
14-
volumes:
15-
- .:/work

php7phpunit.DOCKERFILE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM php:7.3
2+
3+
RUN pecl install --force mongodb
4+
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini
5+
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
6+
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
7+
php composer-setup.php && \
8+
php -r "unlink('composer-setup.php');" && \
9+
mv composer.phar /usr/bin/composer
10+
RUN apt-get update && apt-get install -y git zip
11+
12+
COPY . /work/
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
FROM php:7.2
1+
FROM php:8
22

33
RUN pecl install --force mongodb
44
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini
55
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
6-
php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
6+
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
77
php composer-setup.php && \
88
php -r "unlink('composer-setup.php');" && \
9-
mv composer.phar /usr/bin/composer
9+
mv composer.phar /usr/bin/composer
10+
RUN apt-get update && apt-get install -y git zip
11+
12+
COPY . /work/

0 commit comments

Comments
 (0)