Skip to content

Commit

Permalink
Merge pull request #16 from mlocati/master
Browse files Browse the repository at this point in the history
Fork Sync: Update from parent repository
  • Loading branch information
vanderletenpartners authored Jan 1, 2024
2 parents fcf32f6 + fbd6d87 commit bc4d3ac
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 33 deletions.
1 change: 1 addition & 0 deletions .github/workflows/monitor-php8.3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
distro:
- alpine3.17
- alpine3.18
- alpine3.19
- bullseye
- bookworm
name: Check on ${{ matrix.distro }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/readme-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
CREATE_TAG=n
for CHANGED_FILE in $(git diff --name-only "refs/tags/$VERSIONTAG_LAST" HEAD); do
case "$CHANGED_FILE" in
install-php-extensions)
install-php-extensions | Dockerfile)
CREATE_TAG=y
;;
esac
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
RELEASE_NOTES='First version'
else
printf 'Generating release notes for commits between %s and %s\n' "$VERSIONTAG_PREVIOUS" "$VERSIONTAG_THIS"
RELEASE_NOTES="$(git log --format='- %s' --no-merges --reverse "refs/tags/$VERSIONTAG_PREVIOUS...refs/tags/$VERSIONTAG_THIS" -- ./install-php-extensions | grep -vE '^- \[minor\]')"
RELEASE_NOTES="$(git log --format='- %s' --no-merges --reverse "refs/tags/$VERSIONTAG_PREVIOUS...refs/tags/$VERSIONTAG_THIS" -- ./install-php-extensions ./Dockerfile | grep -vE '^- \[minor\]')"
fi
printf 'Release notes:\n%s\n' "$RELEASE_NOTES"
printf 'RELEASE_NAME=v%s\n' "$VERSIONTAG_THIS" >> "$GITHUB_ENV"
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/test-dockerfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Docker image

on:
pull_request:
paths:
- Dockerfile
- .github/workflows/test-dockerfile.yml

jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Build image
run: docker build --tag test:latest .
-
name: Save image contents
run: docker save --output /tmp/image.tar test:latest
-
name: Extract layer
run: tar -C /tmp -x -f /tmp/image.tar --wildcards '*layer.tar' --strip-components=1
-
name: Check layer contents
run: |
ENTRY="$(tar -v -t -f /tmp/layer.tar --wildcards '*bin/install-php-extensions')"
if [ -z "$ENTRY" ]; then
echo 'File not found'
exit 1
fi
if ! printf '%s' "$ENTRY" | grep -E '^.r.xr.xr.x '; then
printf 'Invalid entry permissions:\n%s\n' "$ENTRY"
exit 1
fi
echo 'Entry is correct.'
1 change: 1 addition & 0 deletions .github/workflows/test-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
- alpine3.16
- alpine3.17
- alpine3.18
- alpine3.19
- jessie
- stretch
- buster
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-recent-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- alpine3.16
- alpine3.17
- alpine3.18
- alpine3.19
- jessie
- stretch
- buster
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ RUN chmod +x /tmp/install-php-extensions

FROM scratch

LABEL org.opencontainers.image.source="https://github.com/mlocati/docker-php-extension-installer" \
org.opencontainers.image.licenses="MIT"

COPY --from=build /tmp/install-php-extensions /usr/bin/install-php-extensions
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ You may want to run `docker pull mlocati/php-extension-installer` in order to us
### Using the script of a Docker image

```Dockerfile
RUN --mount=type=bind,from=mlocati/php-extension-installer:1.5,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
RUN --mount=type=bind,from=mlocati/php-extension-installer:latest,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
install-php-extensions gd xdebug
```

Expand Down Expand Up @@ -217,7 +217,7 @@ install-php-extensions @fix_letsencrypt
| dba | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ddtrace[*](#special-requirements-for-ddtrace) | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| decimal | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ds | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| ds | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ecma_intl[*](#special-requirements-for-ecma_intl) | | | | | | | | | | ✓ | ✓ |
| enchant | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ev | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Expand Down Expand Up @@ -253,7 +253,7 @@ install-php-extensions @fix_letsencrypt
| lzf | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| mailparse | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| maxminddb | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| mcrypt | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| mcrypt | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memcache | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memcached | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memprof[*](#special-requirements-for-memprof) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Expand All @@ -269,7 +269,7 @@ install-php-extensions @fix_letsencrypt
| odbc | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| opcache | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| opencensus | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| openswoole | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| openswoole | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| opentelemetry | | | | | | | | ✓ | ✓ | ✓ | ✓ |
| parallel[*](#special-requirements-for-parallel) | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| parle[*](#special-requirements-for-parle) | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Expand Down
6 changes: 3 additions & 3 deletions data/supported-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ csv 7.3 7.4 8.0 8.1 8.2 8.3
dba 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
ddtrace 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
decimal 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
ds 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2
ds 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
ecma_intl 8.2 8.3
enchant 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
ev 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
Expand Down Expand Up @@ -49,7 +49,7 @@ lz4 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
lzf 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
mailparse 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
maxminddb 7.2 7.3 7.4 8.0 8.1 8.2 8.3
mcrypt 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2
mcrypt 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
memcache 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
memcached 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
memprof 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
Expand All @@ -65,7 +65,7 @@ oci8 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
odbc 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
opcache 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
opencensus 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
openswoole 7.2 7.3 7.4 8.0 8.1 8.2
openswoole 7.2 7.3 7.4 8.0 8.1 8.2 8.3
opentelemetry 8.0 8.1 8.2 8.3
parallel 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
parle 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
Expand Down
126 changes: 102 additions & 24 deletions install-php-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ buildRequiredPackageLists() {
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $PHPIZE_DEPS"
fi
if test -z "$(apk info 2>/dev/null | grep -E ^libssl)"; then
buildRequiredPackageLists_libssl='libssl1.0'
buildRequiredPackageLists_libssl='^libssl[0-9]+(\.[0-9]+)*$'
elif test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libtls')" && test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libssl')" && test -z "$(apk info 2>/dev/null | grep -E '^libretls-')"; then
buildRequiredPackageLists_libssl=$(apk search -q libressl*-libtls)
else
Expand Down Expand Up @@ -941,6 +941,9 @@ buildRequiredPackageLists() {
imagick@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent imagemagick libgomp"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile imagemagick-dev"
if [ $DISTRO_MAJMIN_VERSION -ge 319 ]; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ghostscript libheif libjxl libraw librsvg"
fi
;;
imagick@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmagickwand-6.q16-[0-9]+$ ^libmagickcore-6.q16-[0-9]+-extra$"
Expand Down Expand Up @@ -1225,7 +1228,7 @@ buildRequiredPackageLists() {
relay@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs zstd-libs"
if test $DISTRO_MAJMIN_VERSION -ge 317; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssl1.1"
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent $buildRequiredPackageLists_libssl"
fi
;;
saxon@debian)
Expand Down Expand Up @@ -2765,8 +2768,10 @@ installRemoteModule() {
;;
ds)
if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -le 702; then
if test $PHP_MAJMIN_VERSION -lt 703; then
installRemoteModule_version=1.3.0
elif test $PHP_MAJMIN_VERSION -lt 704; then
installRemoteModule_version=1.4.0
fi
fi
;;
Expand Down Expand Up @@ -2984,6 +2989,13 @@ installRemoteModule() {
fi
fi
;;
jsonpath)
if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -lt 800; then
installRemoteModule_version=1.0.1
fi
fi
;;
luasandbox)
if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -lt 702; then
Expand Down Expand Up @@ -3178,28 +3190,88 @@ installRemoteModule() {
installRemoteModule_sockets=no
fi
installRemoteModule_openssl=yes
# enable sockets supports? (v < 22.1.0) / enable coroutine sockets? (v >= 22.1.0)
addConfigureOption enable-sockets $installRemoteModule_sockets
# enable openssl support?
addConfigureOption enable-openssl $installRemoteModule_openssl
# enable http2 support?
addConfigureOption enable-http2 yes
# enable mysqlnd support? (v < 22.1.0) / enable coroutine mysqlnd? (v >= 22.1.0)
addConfigureOption enable-mysqlnd yes
if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" '22.0.0') -lt 0; then
if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 22.1.2) -ge 0; then
# enable coroutine sockets?
addConfigureOption enable-sockets $installRemoteModule_sockets
# enable openssl support?
addConfigureOption enable-openssl $installRemoteModule_openssl
# enable http2 protocol?
addConfigureOption enable-http2 yes
# enable coroutine mysqlnd?
addConfigureOption enable-mysqlnd yes
# enable coroutine curl?
addConfigureOption enable-hook-curl yes
# enable coroutine postgres?
addConfigureOption with-postgres yes
elif test $(compareVersions "$installRemoteModule_version" 22.1.1) -ge 0; then
# enable c-ares support?
addConfigureOption enable-cares yes
# enable coroutine sockets?
addConfigureOption enable-sockets $installRemoteModule_sockets
# enable openssl support?
addConfigureOption enable-openssl $installRemoteModule_openssl
# enable http2 protocol?
addConfigureOption enable-http2 yes
# enable coroutine mysqlnd?
addConfigureOption enable-mysqlnd yes
# enable coroutine curl?
addConfigureOption enable-hook-curl yes
# enable coroutine postgres?
addConfigureOption with-postgres yes
elif test $(compareVersions "$installRemoteModule_version" 22.1.0) -ge 0; then
# enable coroutine sockets?
addConfigureOption enable-sockets $installRemoteModule_sockets
# enable openssl support?
addConfigureOption enable-openssl $installRemoteModule_openssl
# enable http2 protocol?
addConfigureOption enable-http2 yes
# enable coroutine mysqlnd?
addConfigureOption enable-mysqlnd yes
# enable coroutine curl?
addConfigureOption enable-hook-curl yes
# enable coroutine postgres?
addConfigureOption with-postgres yes
elif test $(compareVersions "$installRemoteModule_version" 22.0.0) -ge 0; then
# enable sockets supports?
addConfigureOption enable-sockets $installRemoteModule_sockets
# enable openssl support?
addConfigureOption enable-openssl $installRemoteModule_openssl
# enable http2 support?
addConfigureOption enable-http2 yes
# enable mysqlnd support?
addConfigureOption enable-mysqlnd yes
# enable hook curl support?
addConfigureOption enable-hook-curl yes
# enable postgres support?
addConfigureOption with-postgres yes
elif test $(compareVersions "$installRemoteModule_version" 4.8.0) -ge 0; then
# enable sockets supports?
addConfigureOption enable-sockets $installRemoteModule_sockets
# enable openssl support?
addConfigureOption enable-openssl $installRemoteModule_openssl
# enable http2 support?
addConfigureOption enable-http2 yes
# enable mysqlnd support?
addConfigureOption enable-mysqlnd yes
# enable json support?
addConfigureOption enable-swoole-json yes
# enable curl support?
addConfigureOption enable-swoole-curl yes
if test $(compareVersions "$installRemoteModule_version" '4.8.0') -ge 0; then
# enable postgres support?
addConfigureOption with-postgres yes
fi
else
#enable hook curl support? (v < 22.1.0) / enable coroutine curl? (v >= 22.1.0)
addConfigureOption enable-hook-curl yes
# enable postgres support? (v < 22.1.0) / enable coroutine postgres? (v >= 22.1.0)
# enable postgres support?
addConfigureOption with-postgres yes
else
# enable sockets supports?
addConfigureOption enable-sockets $installRemoteModule_sockets
# enable openssl support?
addConfigureOption enable-openssl $installRemoteModule_openssl
# enable http2 support?
addConfigureOption enable-http2 yes
# enable mysqlnd support?
addConfigureOption enable-mysqlnd yes
# enable json support?
addConfigureOption enable-swoole-json yes
# enable curl support?
addConfigureOption enable-swoole-curl yes
fi
;;
opentelemetry)
Expand Down Expand Up @@ -3598,6 +3670,12 @@ installRemoteModule() {
fi
;;
esac
if test $PHP_MAJMIN_VERSION -eq 803; then
# see https://github.com/swoole/docker-swoole/issues/45
installRemoteModule_curl=no
else
installRemoteModule_curl=yes
fi
if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then
# enable sockets supports?
addConfigureOption enable-sockets $installRemoteModule_sockets
Expand All @@ -3606,7 +3684,7 @@ installRemoteModule() {
# enable mysqlnd support?
addConfigureOption enable-mysqlnd yes
# enable curl support?
addConfigureOption enable-swoole-curl yes
addConfigureOption enable-swoole-curl $installRemoteModule_curl
# enable cares support?
addConfigureOption enable-cares yes
# enable brotli support?
Expand All @@ -3619,7 +3697,7 @@ installRemoteModule() {
# enable mysqlnd support?
addConfigureOption enable-mysqlnd yes
# enable curl support?
addConfigureOption enable-swoole-curl yes
addConfigureOption enable-swoole-curl $installRemoteModule_curl
# enable cares support?
addConfigureOption enable-cares yes
elif test $(compareVersions "$installRemoteModule_version" 4.8.11) -ge 0; then
Expand All @@ -3634,7 +3712,7 @@ installRemoteModule() {
# enable json support?
addConfigureOption enable-swoole-json yes
# enable curl support?
addConfigureOption enable-swoole-curl yes
addConfigureOption enable-swoole-curl $installRemoteModule_curl
# enable cares support?
addConfigureOption enable-cares yes
elif test $(compareVersions "$installRemoteModule_version" 4.6.1) -ge 0; then
Expand All @@ -3649,7 +3727,7 @@ installRemoteModule() {
# enable json support?
addConfigureOption enable-swoole-json yes
# enable curl support?
addConfigureOption enable-swoole-curl yes
addConfigureOption enable-swoole-curl $installRemoteModule_curl
elif test $(compareVersions "$installRemoteModule_version" 4.4.0) -ge 0; then
# enable sockets supports?
addConfigureOption enable-sockets $installRemoteModule_sockets
Expand Down
15 changes: 15 additions & 0 deletions scripts/tests/swoole
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env php
<?php

if (extension_loaded('curl')) {
// This leads to Segmentation fault when the script ends
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1/foo');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if (defined('CURLOPT_TIMEOUT_MS')) {
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1);
} else {
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
}
curl_exec($ch);
}

0 comments on commit bc4d3ac

Please sign in to comment.