Merge pull request #408 from mlocati/event

Add support for event
This commit is contained in:
Michele Locati 2021-08-03 12:13:27 +02:00 committed by GitHub
commit 17eb02083d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 105 additions and 0 deletions

View File

@ -275,6 +275,7 @@ The compilation of some extensions may be fine-tuned to better fit your needs by
| Extension | Environment variable | Description |
|---|---|---|
| lzf | IPE_LZF_BETTERCOMPRESSION=1 | By default `install-php-extensions` compiles the `lzf` extension to prefer speed over size; you can use this environment variable to compile it preferring size over speed |
| event | IPE_EVENT_NAMESPACE=... | By default the `event` classes are defined in the root namespace. You can use this environment variable to specify a custom namespace |
## Special requirements

View File

@ -12,6 +12,7 @@ decimal 7.0 7.1 7.2 7.3 7.4 8.0 8.1
ds 7.0 7.1 7.2 7.3 7.4 8.0
enchant 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
ev 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
event 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
excimer 7.1 7.2 7.3 7.4 8.0 8.1
exif 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
ffi 7.4 8.0 8.1

View File

@ -360,6 +360,16 @@ sortModulesToInstall() {
checkRequiredModule 'http' 'propro'
fi
checkRequiredModule 'http' 'raphf'
# event requires sockets (for PHP <= 5.6)
if test $PHP_MAJMIN_VERSION -le 506; then
checkRequiredModule event sockets
fi
# Some module installation may use sockets if available: move it before other modules
if stringInList 'sockets' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'sockets' "$PHP_MODULES_TO_INSTALL")"
PHP_MODULES_TO_INSTALL="sockets $PHP_MODULES_TO_INSTALL"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }"
fi
# Some module installation may use igbinary if available: move it before other modules
if stringInList 'igbinary' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'igbinary' "$PHP_MODULES_TO_INSTALL")"
@ -485,6 +495,14 @@ buildRequiredPackageLists() {
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant1c2a"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-dev"
;;
event@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent $buildRequiredPackageLists_libssl"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev"
;;
event@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libevent[0-9\.\-]*$ ^libevent-openssl[0-9\.\-]*$ ^libevent-extra[0-9\.\-]*$ ^libevent-pthreads[0-9\.\-]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev"
;;
ffi@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libffi"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev"
@ -1675,6 +1693,66 @@ installRemoteModule() {
;;
esac
;;
event)
if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then
# Enable internal debugging in Event
addConfigureOption enable-event-debug no
# Enable sockets support in Event
if php --ri sockets >/dev/null 2>/dev/null; then
addConfigureOption enable-event-sockets yes
else
addConfigureOption enable-event-sockets no
fi
# libevent installation prefix
addConfigureOption with-event-libevent-dir /usr
# Include libevent's pthreads library and enable thread safety support in Event
addConfigureOption with-event-pthreads yes
# Include libevent protocol-specific functionality support including HTTP, DNS, and RPC
addConfigureOption with-event-extra yes
# Include libevent OpenSSL support
addConfigureOption with-event-openssl yes
# PHP Namespace for all Event classes
if test -n "${IPE_EVENT_NAMESPACE:-}"; then
addConfigureOption with-event-ns "$IPE_EVENT_NAMESPACE"
else
addConfigureOption with-event-ns no
fi
# openssl installation prefix
addConfigureOption with-openssl-dir no
elif test $(compareVersions "$installRemoteModule_version" 1.7.6) -ge 0; then
# Enable internal debugging in Event
addConfigureOption enable-event-debug no
# Enable sockets support in Event
if php --ri sockets >/dev/null 2>/dev/null; then
addConfigureOption enable-event-sockets yes
else
addConfigureOption enable-event-sockets no
fi
# libevent installation prefix
addConfigureOption with-event-libevent-dir /usr
# Include libevent's pthreads library and enable thread safety support in Event
addConfigureOption with-event-pthreads yes
# Include libevent protocol-specific functionality support including HTTP, DNS, and RPC
addConfigureOption with-event-extra yes
# Include libevent OpenSSL support
addConfigureOption with-event-openssl yes
# openssl installation prefix
addConfigureOption with-openssl-dir no
elif test $(compareVersions "$installRemoteModule_version" 1.3.0) -ge 0; then
# Enable internal debugging in event
addConfigureOption enable-event-debug no
# libevent installation prefix
addConfigureOption with-event-libevent-dir /usr
# Include libevent's pthreads library and enable thread safety support in event
addConfigureOption with-event-pthreads yes
# Include libevent protocol-specific functionality support including HTTP, DNS, and RPC
addConfigureOption with-event-extra yes
# Include libevent OpenSSL support
addConfigureOption with-event-openssl yes
# openssl installation prefix
addConfigureOption with-openssl-dir no
fi
;;
gearman)
if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -le 506; then
@ -2387,6 +2465,10 @@ installRemoteModule() {
# apcu_bc must be loaded after apcu
docker-php-ext-enable --ini-name "xx-php-ext-$installRemoteModule_module.ini" apc
;;
event)
# event must be loaded after sockets
docker-php-ext-enable --ini-name "xx-php-ext-$installRemoteModule_module.ini" "$installRemoteModule_module"
;;
ioncube_loader)
# On PHP 5.5, docker-php-ext-enable fails to detect that ionCube Loader is a Zend Extension
if test $PHP_MAJMIN_VERSION -le 505; then

21
scripts/tests/event Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
set -o errexit
set -o nounset
rc=0
if php --ri sockets >/dev/null 2>/dev/null; then
if test -z "$(php --ri event | grep 'Sockets support => enabled')"; then
echo 'event has not been compiled with sockets support' >&2
rc=1
else
echo 'event has been compiled with sockets support'
fi
fi
if test -z "$(php --ri event | grep 'OpenSSL support => enabled')"; then
echo 'event has not been compiled with OpenSSL support' >&2
rc=1
else
echo 'event has been compiled with OpenSSL support'
fi
exit $rc