Skip to content

Commit

Permalink
PHP: Add zif_array_filter to Asyncify list (#397)
Browse files Browse the repository at this point in the history
Adds `zif_array_filter` to Asyncify list to fix the WooCommerce error
reported in #392
  • Loading branch information
adamziel authored May 30, 2023
1 parent fe731db commit 79272d3
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 10 deletions.
3 changes: 2 additions & 1 deletion packages/php-wasm/compile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ RUN if [ "$WITH_WS_NETWORKING_PROXY" = "yes" ]; \
"dynCall_viiiii",\
"dynCall_viiiiiii",\
"dynCall_viiiiiiii",'; \
export ASYNCIFY_ONLY=$'"zend_call_known_instance_method_with_2_params",\
export ASYNCIFY_ONLY=$'"zif_array_filter",\
"zend_call_known_instance_method_with_2_params",\
"zend_fetch_dimension_address_read_R",\
"_zval_dtor_func_for_ptr",\
"ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER",\
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_5_6.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10176192;
export const dependenciesTotalSize = 10176855;
const dependencyFilename = __dirname + '/php_5_6.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_5_6.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_0.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10389492;
export const dependenciesTotalSize = 10390258;
const dependencyFilename = __dirname + '/php_7_0.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_0.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10583119;
export const dependenciesTotalSize = 10583885;
const dependencyFilename = __dirname + '/php_7_1.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_1.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10992646;
export const dependenciesTotalSize = 10993354;
const dependencyFilename = __dirname + '/php_7_2.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_2.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10916038;
export const dependenciesTotalSize = 10916624;
const dependencyFilename = __dirname + '/php_7_3.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_3.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 11015985;
export const dependenciesTotalSize = 11016595;
const dependencyFilename = __dirname + '/php_7_4.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_4.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_8_0.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10172313;
export const dependenciesTotalSize = 10172733;
const dependencyFilename = __dirname + '/php_8_0.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_8_0.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_8_1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10044311;
export const dependenciesTotalSize = 10044712;
const dependencyFilename = __dirname + '/php_8_1.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_8_1.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_8_2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10302665;
export const dependenciesTotalSize = 10303111;
const dependencyFilename = __dirname + '/php_8_2.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_8_2.wasm
Binary file not shown.
16 changes: 16 additions & 0 deletions packages/php-wasm/node/src/test/php-asyncify.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ describe.each(phpVersions)('PHP %s – asyncify', (phpVersion) => {
));
});

describe('Array functions', () => {
test('array_filter', () =>
assertNoCrash(`
function top() { ${networkCall} }
array_filter(array('top'), 'top');
`));

test('array_map', () =>
assertNoCrash(`
function top() { ${networkCall} }
array_map(array('top'), 'top');
`));

// Network calls in sort() would be silly so let's skip those for now.
});

describe('Class method calls', () => {
test('Regular method', () =>
assertNoCrash(`
Expand Down

0 comments on commit 79272d3

Please sign in to comment.