Skip to content

Commit

Permalink
Merge pull request #45 from boesing/feature/php81
Browse files Browse the repository at this point in the history
PHP 8.1 support
  • Loading branch information
Ocramius committed Sep 21, 2021
2 parents c4e19f1 + 6ba0747 commit fc538bb
Show file tree
Hide file tree
Showing 21 changed files with 588 additions and 1,396 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/test/ export-ignore
/autoload-dev/ export-ignore
5 changes: 4 additions & 1 deletion .laminas-ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"mongodb",
"mysql",
"pgsql"
]
],
"ignore_php_platform_requirements": {
"8.1": true
}
}
28 changes: 28 additions & 0 deletions .laminas-ci/install-mongodb-extension-from-source.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

PHP_VERSION="$1"

if ! [[ "${PHP_VERSION}" =~ 8\.1 ]]; then
echo "MongoDB extension is only installed from source for PHP 8.1, ${PHP_VERSION} detected."
exit 0;
fi

set +e

CURRENT_WORKING_DIRECTORY=$(pwd)

cd $TMPDIR
git clone https://github.com/mongodb/mongo-php-driver
cd mongo-php-driver

git submodule deinit --all -f
git submodule update --init
phpize
./configure
make
make install

echo "extension=mongodb.so" > /etc/php/${PHP_VERSION}/mods-available/mongodb.ini

cd $CURRENT_WORKING_DIRECTORY

7 changes: 7 additions & 0 deletions .laminas-ci/pre-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

WORKING_DIRECTORY=$2
JOB=$3
PHP_VERSION=$(echo "${JOB}" | jq -r '.php')

${WORKING_DIRECTORY}/.laminas-ci/install-mongodb-extension-from-source.sh "${PHP_VERSION}" || exit 1
9 changes: 9 additions & 0 deletions autoload-dev/ReturnTypeWillChange.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);

if (\PHP_VERSION_ID < 80100) {
#[Attribute(Attribute::TARGET_METHOD)]
final class ReturnTypeWillChange
{
}
}
31 changes: 17 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
}
},
"require": {
"php": "^7.3 || ~8.0.0",
"laminas/laminas-eventmanager": "^3.0",
"laminas/laminas-stdlib": "^3.2.1",
"laminas/laminas-zendframework-bridge": "^1.0"
"php": "^7.3 || ~8.0.0 || ~8.1.0",
"laminas/laminas-eventmanager": "^3.4",
"laminas/laminas-stdlib": "^3.6"
},
"require-dev": {
"container-interop/container-interop": "^1.1",
"laminas/laminas-cache": "^2.6.1",
"laminas/laminas-cache": "3.0.x-dev",
"laminas/laminas-cache-storage-adapter-memory": "2.0.x-dev",
"laminas/laminas-coding-standard": "~2.2.1",
"laminas/laminas-db": "^2.7",
"laminas/laminas-http": "^2.5.4",
"laminas/laminas-servicemanager": "^3.0.3",
"laminas/laminas-validator": "^2.6",
"mongodb/mongodb": "^1.0.1",
"laminas/laminas-db": "^2.13.4",
"laminas/laminas-http": "^2.15",
"laminas/laminas-servicemanager": "^3.7",
"laminas/laminas-validator": "^2.15",
"mongodb/mongodb": "v1.9.x-dev",
"php-mock/php-mock-phpunit": "^1.1.2 || ^2.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.3"
"phpunit/phpunit": "^9.5.9"
},
"suggest": {
"laminas/laminas-cache": "Laminas\\Cache component",
Expand All @@ -59,7 +59,10 @@
"autoload-dev": {
"psr-4": {
"LaminasTest\\Session\\": "test/"
}
},
"files": [
"autoload-dev/ReturnTypeWillChange.php"
]
},
"scripts": {
"check": [
Expand All @@ -71,7 +74,7 @@
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
},
"replace": {
"zendframework/zend-session": "^2.9.1"
"conflict": {
"zendframework/zend-session": "*"
}
}
Loading

0 comments on commit fc538bb

Please sign in to comment.