Skip to content

Commit

Permalink
v0.0.9-alpha-20
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorris committed Oct 11, 2024
1 parent e6e5f73 commit f9d2004
Show file tree
Hide file tree
Showing 58 changed files with 248 additions and 316 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ configured
/*-src/
/docs/*.map
/.cache
.env
.env*
packages/**/*.so
packages/**/*.dat
emscripten/
Expand Down
51 changes: 1 addition & 50 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ MAKEFLAGS += --no-builtin-rules --no-builtin-variables
ENV_DIR?=.
ENV_FILE?=.env
-include ${ENV_FILE}
-include ${ENV_FILE}.${PHP_VERSION}

## Default libraries
WITH_BCMATH ?=1
Expand Down Expand Up @@ -593,56 +594,6 @@ ifeq (${WITH_SOURCEMAPS},1)
${DOCKER_RUN} ./remap-sourcemap.sh packages/php-wasm/php-node.mjs.wasm.map
endif

# Deprecated
${PHP_DIST_DIR}/php-shell.js: BUILD_TYPE=js
${PHP_DIST_DIR}/php-shell.js: ENVIRONMENT=shell
${PHP_DIST_DIR}/php-shell.js: ${DEPENDENCIES} | ${ORDER_ONLY}
@ echo -e "\e[33;4mBuilding PHP for ${ENVIRONMENT} {${BUILD_TYPE}}\e[0m"
${DOCKER_RUN_IN_PHP} scripts/dev/credits
${DOCKER_RUN_IN_PHP} emmake make cli install-cli install-build install-programs install-headers ${BUILD_FLAGS} PHP_BINARIES=cli WASM_SHARED_LIBS="$(addprefix /src/,${SHARED_LIBS})" | tee ${PHP_DIST_DIR}/build.log
${DOCKER_RUN_IN_PHP} mv -f \
/src/third_party/php${PHP_VERSION}-src/sapi/cli/php-${ENVIRONMENT}${PHP_SUFFIX}.${BUILD_TYPE}.${BUILD_TYPE} \
/src/third_party/php${PHP_VERSION}-src/sapi/cli/php-${ENVIRONMENT}${PHP_SUFFIX}.${BUILD_TYPE}
- cp -Lprf third_party/php${PHP_VERSION}-src/sapi/cli/php-${ENVIRONMENT}${PHP_SUFFIX}.${BUILD_TYPE}* ${PHP_DIST_DIR}
perl -pi -w -e 's|import\(name\)|import(/* webpackIgnore: true */ name)|g' $@
perl -pi -w -e 's|require\("fs"\)|require(/* webpackIgnore: true */ "fs")|g' $@
- cp -Lprf ${PHP_DIST_DIR}/php-${ENVIRONMENT}${PHP_SUFFIX}.${BUILD_TYPE}.* ${PHP_ASSET_DIR}/
ifneq (${PRELOAD_ASSETS},)
cp third_party/php${PHP_VERSION}-src/sapi/cli/${PRELOAD_NAME}.data ${PHP_DIST_DIR}
cp third_party/php${PHP_VERSION}-src/sapi/cli/${PRELOAD_NAME}.data ${PHP_ASSET_DIR}
${MAKE} ${PHP_ASSET_DIR}/${PRELOAD_NAME}.data
endif
${MAKE} $(addprefix ${PHP_ASSET_DIR}/,${PHP_ASSET_LIST}) ${PHP_DIST_DIR}/config.js
ifeq (${WITH_SOURCEMAPS},1)
${DOCKER_RUN} ./remap-sourcemap.sh packages/php-wasm/php-shell.js.wasm.map
endif


# Deprecated
${PHP_DIST_DIR}/php-shell.mjs: BUILD_TYPE=mjs
${PHP_DIST_DIR}/php-shell.mjs: ENVIRONMENT=shell
${PHP_DIST_DIR}/php-shell.mjs: ${DEPENDENCIES} | ${ORDER_ONLY}/
@ echo -e "\e[33;4mBuilding PHP for ${ENVIRONMENT} {${BUILD_TYPE}}\e[0m"
${DOCKER_RUN_IN_PHP} scripts/dev/credits
${DOCKER_RUN_IN_PHP} emmake make cli install-cli install-build install-programs install-headers ${BUILD_FLAGS} PHP_BINARIES=cli WASM_SHARED_LIBS="$(addprefix /src/,${SHARED_LIBS})" | tee ${PHP_DIST_DIR}/build.log
${DOCKER_RUN_IN_PHP} mv -f \
/src/third_party/php${PHP_VERSION}-src/sapi/cli/php-${ENVIRONMENT}${PHP_SUFFIX}.${BUILD_TYPE}.${BUILD_TYPE} \
/src/third_party/php${PHP_VERSION}-src/sapi/cli/php-${ENVIRONMENT}${PHP_SUFFIX}.${BUILD_TYPE}
- cp -Lprf third_party/php${PHP_VERSION}-src/sapi/cli/php-${ENVIRONMENT}${PHP_SUFFIX}.${BUILD_TYPE}* ${PHP_DIST_DIR}
perl -pi -w -e 's|import\(name\)|import(/* webpackIgnore: true */ name)|g' $@
perl -pi -w -e 's|require\("fs"\)|require(/* webpackIgnore: true */ "fs")|g' $@
perl -pi -w -e 's|var _script(Dir\|Name) = import.meta.url;|const importMeta = import.meta;var _script\1 = importMeta.url;|g' $@
- cp -Lprf ${PHP_DIST_DIR}/php-${ENVIRONMENT}${PHP_SUFFIX}.${BUILD_TYPE}.* ${PHP_ASSET_DIR}/
ifneq (${PRELOAD_ASSETS},)
cp third_party/php${PHP_VERSION}-src/sapi/cli/${PRELOAD_NAME}.data ${PHP_DIST_DIR}
cp third_party/php${PHP_VERSION}-src/sapi/cli/${PRELOAD_NAME}.data ${PHP_ASSET_DIR}
${MAKE} ${PHP_ASSET_DIR}/${PRELOAD_NAME}.data
endif
${MAKE} $(addprefix ${PHP_ASSET_DIR}/,${PHP_ASSET_LIST}) ${PHP_DIST_DIR}/config.mjs
ifeq (${WITH_SOURCEMAPS},1)
${DOCKER_RUN} ./remap-sourcemap.sh packages/php-wasm/php-shell.mjs.wasm.map
endif

${PHP_DIST_DIR}/php-webview.js: BUILD_TYPE=js
${PHP_DIST_DIR}/php-webview.js: ENVIRONMENT=webview
${PHP_DIST_DIR}/php-webview.js: FS_TYPE=${WEB_FS_TYPE}
Expand Down
7 changes: 6 additions & 1 deletion demo-node/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ const php = new PhpCgiNode({
, sharedLibs: [
await import('php-wasm-intl')
, await import('php-wasm-libxml')
, await import('php-wasm-sqlite')
, await import('php-wasm-phar')
, await import('php-wasm-mbstring')
, await import('php-wasm-openssl')
, await import('php-wasm-dom')
, await import('php-wasm-xml')
, await import('php-wasm-simplexml')
, await import('php-wasm-sqlite')
, await import('php-wasm-zlib')
, await import('php-wasm-gd')
]
, types: {
jpeg: 'image/jpeg'
Expand Down
128 changes: 64 additions & 64 deletions demo-node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions demo-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
"start": "./index.mjs"
},
"dependencies": {
"php-cgi-wasm": "0.0.9-alpha-18",
"php-wasm-dom": "0.0.9-alpha-18",
"php-wasm-gd": "0.0.9-alpha-18",
"php-wasm-iconv": "0.0.9-alpha-18",
"php-wasm-intl": "0.0.9-alpha-18",
"php-wasm-libxml": "0.0.9-alpha-18",
"php-wasm-libzip": "0.0.9-alpha-18",
"php-wasm-mbstring": "0.0.9-alpha-18",
"php-wasm-openssl": "0.0.9-alpha-18",
"php-wasm-phar": "0.0.9-alpha-18",
"php-wasm-simplexml": "0.0.9-alpha-18",
"php-wasm-sqlite": "0.0.9-alpha-18",
"php-wasm-tidy": "0.0.9-alpha-18",
"php-wasm-xml": "0.0.9-alpha-18",
"php-wasm-yaml": "0.0.9-alpha-18",
"php-wasm-zlib": "0.0.9-alpha-18"
"php-cgi-wasm": "0.0.9-alpha-20",
"php-wasm-dom": "0.0.9-alpha-20",
"php-wasm-gd": "0.0.9-alpha-20",
"php-wasm-iconv": "0.0.9-alpha-20",
"php-wasm-intl": "0.0.9-alpha-20",
"php-wasm-libxml": "0.0.9-alpha-20",
"php-wasm-libzip": "0.0.9-alpha-20",
"php-wasm-mbstring": "0.0.9-alpha-20",
"php-wasm-openssl": "0.0.9-alpha-20",
"php-wasm-phar": "0.0.9-alpha-20",
"php-wasm-simplexml": "0.0.9-alpha-20",
"php-wasm-sqlite": "0.0.9-alpha-20",
"php-wasm-tidy": "0.0.9-alpha-20",
"php-wasm-xml": "0.0.9-alpha-20",
"php-wasm-yaml": "0.0.9-alpha-20",
"php-wasm-zlib": "0.0.9-alpha-20"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified demo-node/persist/cakephp-5/tmp/debug_kit.sqlite
Binary file not shown.
5 changes: 3 additions & 2 deletions demo-node/persist/drupal-7.95/php.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extension=php${PHP_VERSION}-gd.so
extension=php${PHP_VERSION}-dom.so
;extension=php${PHP_VERSION}-dom.so
;extension=php${PHP_VERSION}-sqlite.so
;extension=php${PHP_VERSION}-pdo-sqlite.so
;extension=php${PHP_VERSION}-zlib.so
;extension=php${PHP_VERSION}-gd.so
Loading

0 comments on commit f9d2004

Please sign in to comment.