Skip to content

Commit bb381c3

Browse files
authored
Merge pull request #345 from qkdreyer/ffi
feat: add support ffi extension
2 parents a2dd512 + b7aeafd commit bb381c3

File tree

7 files changed

+25
-3
lines changed

7 files changed

+25
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Below is a list of extensions available in this image:
177177

178178
**Enabled by default (in addition to extensions enabled in Slim image):** `apcu`, `hash`, `iconv`, `igbinary`, `mysqli`, `mysqlnd`, `redis`, `soap`, `xsl`, `zlib` and all enabled in slim.
179179

180-
**Available (can be enabled using environment variables):** `amqp` `ast` `bcmath` `blackfire` `bz2` `dba` `ds` `enchant` `ev` `event` `exif` `mailparse` `msgpack` `gd` `gettext` `gmp` `gnupg` `grpc` `igbinary` `imagick` `imap` `intl` `ldap` `mcrypt` `memcached` `mongodb` `pcov` `pdo_dblib` `pdo_pgsql` `pdo_sqlite` `pgsql` `pspell` `shmop` `snmp` `sockets` `sqlite3` `swoole` `tidy` `uploadprogress` `uuid` `weakref(-beta)` `xdebug` `xmlrpc` `xsl` `yaml`
180+
**Available (can be enabled using environment variables):** `amqp` `ast` `bcmath` `blackfire` `bz2` `dba` `ds` `enchant` `ev` `event` `exif` `ffi` `mailparse` `msgpack` `gd` `gettext` `gmp` `gnupg` `grpc` `igbinary` `imagick` `imap` `intl` `ldap` `mcrypt` `memcached` `mongodb` `pcov` `pdo_dblib` `pdo_pgsql` `pdo_sqlite` `pgsql` `pspell` `shmop` `snmp` `sockets` `sqlite3` `swoole` `tidy` `uploadprogress` `uuid` `weakref(-beta)` `xdebug` `xmlrpc` `xsl` `yaml`
181181

182182
This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:8.1-v4-cli php -m`
183183

@@ -188,6 +188,7 @@ This list can be outdated, you can verify by executing : `docker run --rm -it th
188188
- *event*, *gnupg* are not available in PHP 8.0+
189189
- *gettext*, *ev*, *swoole* are not available in PHP 8.1+
190190
- *ev*, *rdkafka*, *snmp*, *swoole* are not available in all `ARM64` images (build time is too long : it's possible to install manually as required)
191+
- *ffi* is only available in PHP 7.4+
191192

192193
### Enabling/disabling extensions in the fat image
193194

extensions/7.4/ffi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../core/ffi

extensions/8.0/ffi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../core/ffi

extensions/8.1/ffi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../core/ffi

extensions/core/ffi/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
export EXTENSION=ffi
5+
6+
../docker-install.sh

tests-suite/php-extensions.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test_presenceOfMbstring() {
1010
assert_equals "mbstring" "${RESULT}" "Missing php-mbstring"
1111
}
1212
############################################################
13-
## Let's check that mbstring is enabled by default
13+
## Let's check that PDO is enabled by default
1414
## (it's compiled in PHP)
1515
############################################################
1616
test_presenceOfPDO() {
@@ -24,6 +24,17 @@ test_presenceOfUploadprogressOnFat() {
2424
RESULT=$(docker run ${RUN_OPTIONS} -e "PHP_EXTENSIONS=uploadprogress" --rm "${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}" php -m | tail -n +1 | grep --color=never uploadprogress)
2525
assert_equals "uploadprogress" "${RESULT}" "Missing php-uploadprogress"
2626
}
27+
###################################################################
28+
## Let's check that FFI is enabled explicitly with fat for PHP 7.4+
29+
###################################################################
30+
if [[ "${PHP_VERSION}" == "7.2" || "${PHP_VERSION}" == "7.3" ]]; then
31+
echo "-- FFI is only available for PHP 7.4+"
32+
else
33+
test_presenceOfFFIOnFat() {
34+
RESULT=$(docker run ${RUN_OPTIONS} -e "PHP_EXTENSIONS=ffi" --rm "${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}" php -m | tail -n +1 | grep --color=never FFI)
35+
assert_equals "FFI" "${RESULT}" "Missing php-FFI"
36+
}
37+
fi
2738
############################################################
2839
## Let's check that the extensions are enabled when composer is run
2940
############################################################

utils/README.blueprint.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Below is a list of extensions available in this image:
9595

9696
**Enabled by default (in addition to extensions enabled in Slim image):** `apcu`, `hash`, `iconv`, `igbinary`, `mysqli`, `mysqlnd`, `redis`, `soap`, `xsl`, `zlib` and all enabled in slim.
9797

98-
**Available (can be enabled using environment variables):** `amqp` `ast` `bcmath` `blackfire` `bz2` `dba` `ds` `enchant` `ev` `event` `exif` `mailparse` `msgpack` `gd` `gettext` `gmp` `gnupg` `grpc` `igbinary` `imagick` `imap` `intl` `ldap` `mcrypt` `memcached` `mongodb` `pcov` `pdo_dblib` `pdo_pgsql` `pdo_sqlite` `pgsql` `pspell` `shmop` `snmp` `sockets` `sqlite3` `swoole` `tidy` `uploadprogress` `uuid` `weakref(-beta)` `xdebug` `xmlrpc` `xsl` `yaml`
98+
**Available (can be enabled using environment variables):** `amqp` `ast` `bcmath` `blackfire` `bz2` `dba` `ds` `enchant` `ev` `event` `exif` `ffi` `mailparse` `msgpack` `gd` `gettext` `gmp` `gnupg` `grpc` `igbinary` `imagick` `imap` `intl` `ldap` `mcrypt` `memcached` `mongodb` `pcov` `pdo_dblib` `pdo_pgsql` `pdo_sqlite` `pgsql` `pspell` `shmop` `snmp` `sockets` `sqlite3` `swoole` `tidy` `uploadprogress` `uuid` `weakref(-beta)` `xdebug` `xmlrpc` `xsl` `yaml`
9999

100100
This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:{{ $image.php_version }}-v4-cli php -m`
101101

@@ -106,6 +106,7 @@ This list can be outdated, you can verify by executing : `docker run --rm -it th
106106
- *event*, *gnupg* are not available in PHP 8.0+
107107
- *gettext*, *ev*, *swoole* are not available in PHP 8.1+
108108
- *ev*, *rdkafka*, *snmp*, *swoole* are not available in all `ARM64` images (build time is too long : it's possible to install manually as required)
109+
- *ffi* is only available in PHP 7.4+
109110

110111
### Enabling/disabling extensions in the fat image
111112

0 commit comments

Comments
 (0)