Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Exploration] Add Soap PHP library support #1986

Draft
wants to merge 8 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/php-wasm/compile/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ const platformDefaults = {
WITH_MBREGEX: 'yes',
WITH_OPENSSL: 'yes',
WITH_WS_NETWORKING_PROXY: 'yes',
WITH_SOAP: 'yes',
},
web: {},
node: {
Expand Down Expand Up @@ -209,6 +210,8 @@ await asyncSpawn(
'--build-arg',
getArg('WITH_SOURCEMAPS'),
'--build-arg',
getArg('WITH_SOAP'),
'--build-arg',
getArg('WITH_ICONV'),
'--build-arg',
getArg('WITH_MYSQL'),
Expand Down
28 changes: 25 additions & 3 deletions packages/php-wasm/compile/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ARG WITH_MYSQL
ARG WITH_OPENSSL
ARG WITH_ICONV
ARG WITH_SOURCEMAPS
ARG WITH_SOAP
ARG WITH_WS_NETWORKING_PROXY

# The platform to build for: web or node
Expand Down Expand Up @@ -144,11 +145,20 @@ RUN if [ "$WITH_CLI_SAPI" = "yes" ]; \
echo -n ' --disable-cli ' >> /root/.php-configure-flags; \
fi;

# Add Soap if needed
RUN if [ "$WITH_SOAP" = "yes" ]; then \
echo -n ' --enable-soap ' >> /root/.php-configure-flags; \
fi;

# Add Libxml2 if needed
RUN if [ "$WITH_LIBXML" = "yes" ]; \
# Libxml is a dependency for Soap, so we need to enable it if Soap is enabled
RUN if [ "$WITH_LIBXML" = "yes" ] || [ "$WITH_SOAP" = "yes" ]; \
then \
set -euxo pipefail;\
echo -n ' --enable-libxml --with-libxml --with-libxml-dir=/root/lib --enable-dom --enable-xml --enable-simplexml --enable-xmlreader --enable-xmlwriter' >> /root/.php-configure-flags && \
if [ "$WITH_SOAP" = "yes" ]; then \
echo -n ' --enable-soap ' >> /root/.php-configure-flags; \
fi; \
echo -n ' -I /root/lib -I /root/lib/include/libxml2 -lxml2' >> /root/.emcc-php-wasm-flags && \
echo -n ' /root/lib/lib/libxml2.a' >> /root/.emcc-php-wasm-sources && \
# Libxml check is wrong in PHP < 7.4.0.
Expand Down Expand Up @@ -519,7 +529,19 @@ RUN export ASYNCIFY_IMPORTS=$'["_dlopen_js",\n\
"dynCall_viiiiiii",\
"dynCall_viiiiiiii",'; \

export ASYNCIFY_ONLY=$'"rc_dtor_func",\
export ASYNCIFY_ONLY=$'"php_libxml_streams_IO_open_wrapper",\
"php_libxml_input_buffer_create_filename",\
"xmlParserInputBufferCreateFilename",\
"xmlNewInputFromFile",\
"xmlDefaultExternalEntityLoader",\
"_php_libxml_pre_ext_ent_loader",\
"xmlLoadExternalEntity",\
"xmlCreateURLParserCtxt",\
"soap_xmlParseFile",\
"load_wsdl_ex",\
"get_sdl",\
"zim_SoapClient___construct",\
"rc_dtor_func",\
"zif_curl_exec",\
"curl_easy_perform",\
"Curl_wait_ms",\
Expand Down Expand Up @@ -932,7 +954,7 @@ RUN set -euxo pipefail; \
else \
export ASYNCIFY_FLAGS=" -s ASYNCIFY=1 -s ASYNCIFY_IGNORE_INDIRECT=1 -s EXPORTED_RUNTIME_METHODS=ccall,PROXYFS,wasmExports $(cat /root/.emcc-php-asyncify-flags) "; \
echo '' > /root/php_wasm_asyncify.h; \
fi; \
fi; \
export EXPORTED_FUNCTIONS=$'["_exit", \n\
"UTF8ToString", \n\
"stringToUTF8", \n\
Expand Down
Binary file modified packages/php-wasm/node/asyncify/8_0_30/php_8_0.wasm
Binary file not shown.
Loading