Skip to content

Commit 3eed5ca

Browse files
authored
Merge pull request #250 from speniti/ffi-extension
Enable FFI extension
2 parents c1e9d72 + 2513c9b commit 3eed5ca

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

php-80/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ RUN make && make install
380380
# libicu-devel : needed for intl
381381
# libxslt-devel : needed for the XSL extension
382382
# sqlite-devel : Since PHP 7.4 this must be installed (https://github.com/php/php-src/blob/99b8e67615159fc600a615e1e97f2d1cf18f14cb/UPGRADING#L616-L619)
383-
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel sqlite-devel
384-
383+
# libffi-devel : needed for the FFI extension
384+
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel sqlite-devel libffi-devel
385385

386386
# Note: this variable is used when building extra/custom extensions, do not remove
387387
ENV PHP_BUILD_DIR=/tmp/php
@@ -449,6 +449,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
449449
--enable-intl=shared \
450450
--enable-soap \
451451
--with-xsl=${INSTALL_DIR} \
452+
--with-ffi \
452453
# necessary for `pecl` to work (to install PHP extensions)
453454
--with-pear \
454455
# extra compilation flags

php-81/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ RUN make && make install
401401
# gettext-devel : needed for the --with-gettext flag
402402
# libicu-devel : needed for intl
403403
# libxslt-devel : needed for the XSL extension
404-
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel
404+
# libffi-devel : needed for the FFI extension
405+
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
405406

406407

407408
# Note: this variable is used when building extra/custom extensions, do not remove
@@ -470,6 +471,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
470471
--enable-intl=shared \
471472
--enable-soap \
472473
--with-xsl=${INSTALL_DIR} \
474+
--with-ffi \
473475
# necessary for `pecl` to work (to install PHP extensions)
474476
--with-pear \
475477
# extra compilation flags

php-82/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ RUN make && make install
401401
# gettext-devel : needed for the --with-gettext flag
402402
# libicu-devel : needed for intl
403403
# libxslt-devel : needed for the XSL extension
404-
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel
404+
# libffi-devel : needed for the FFI extension
405+
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
405406

406407

407408
# Note: this variable is used when building extra/custom extensions, do not remove
@@ -470,6 +471,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
470471
--enable-intl=shared \
471472
--enable-soap \
472473
--with-xsl=${INSTALL_DIR} \
474+
--with-ffi \
473475
# necessary for `pecl` to work (to install PHP extensions)
474476
--with-pear \
475477
# extra compilation flags

php-83/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ RUN make && make install
401401
# gettext-devel : needed for the --with-gettext flag
402402
# libicu-devel : needed for intl
403403
# libxslt-devel : needed for the XSL extension
404-
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel
404+
# libffi-devel : needed for the FFI extension
405+
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
405406

406407

407408
# Note: this variable is used when building extra/custom extensions, do not remove
@@ -470,6 +471,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
470471
--enable-intl=shared \
471472
--enable-soap \
472473
--with-xsl=${INSTALL_DIR} \
474+
--with-ffi \
473475
# necessary for `pecl` to work (to install PHP extensions)
474476
--with-pear \
475477
# extra compilation flags

php-84/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ RUN make && make install
404404
# gettext-devel : needed for the --with-gettext flag
405405
# libicu-devel : needed for intl
406406
# libxslt-devel : needed for the XSL extension
407-
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel
407+
# libffi-devel : needed for the FFI extension
408+
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
408409

409410

410411
# Note: this variable is used when building extra/custom extensions, do not remove
@@ -471,6 +472,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
471472
--enable-intl=shared \
472473
--enable-soap \
473474
--with-xsl=${INSTALL_DIR} \
475+
--with-ffi \
474476
# necessary for `pecl` to work (to install PHP extensions)
475477
--with-pear \
476478
# extra compilation flags

tests/test_2_extensions.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
'readline' => READLINE_LIB === 'readline',
6565
'reflection' => class_exists(\ReflectionClass::class),
6666
'session' => session_status() === PHP_SESSION_NONE,
67+
'ffi' => class_exists(\FFI::class),
6768
'zip' => class_exists(\ZipArchive::class),
6869
'zlib' => md5(gzcompress('abcde')) === 'db245560922b42f1935e73e20b30980e',
6970
];
@@ -94,11 +95,11 @@
9495
if ($private_key === false) {
9596
return false;
9697
}
97-
98+
9899
$public_key_pem = openssl_pkey_get_details($private_key)['key'];
99100
$details = openssl_pkey_get_details(openssl_pkey_get_public($public_key_pem));
100101
return $details['bits'] === 2048;
101-
})(),
102+
})(),
102103
'json' => function_exists('json_encode'),
103104
'bcmath' => function_exists('bcadd'),
104105
'ctype' => function_exists('ctype_digit'),

0 commit comments

Comments
 (0)