@php-wasm/web-8-3 3.1.61 → 3.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- const dependencyFilename = new URL('./8_3_33/php_8_3.wasm', import.meta.url)
1
+ const dependencyFilename = new URL('./8_3_36/php_8_3.wasm', import.meta.url)
2
2
  .href;
3
3
  export { dependencyFilename };
4
- export const dependenciesTotalSize = 18309855;
5
- const phpVersionString = '8.3.33';
4
+ export const dependenciesTotalSize = 18319469;
5
+ const phpVersionString = '8.3.36';
6
6
  export function init(RuntimeName, PHPLoader) {
7
7
  // The rest of the code comes from the built php.js file and esm-suffix.js
8
8
  var Module = typeof PHPLoader != 'undefined' ? PHPLoader : {};
@@ -6547,6 +6547,13 @@ export function init(RuntimeName, PHPLoader) {
6547
6547
  return false;
6548
6548
  };
6549
6549
  _emscripten_resize_heap.sig = 'ip';
6550
+ var runAndAbortIfError = (func) => {
6551
+ try {
6552
+ return func();
6553
+ } catch (e) {
6554
+ abort(e);
6555
+ }
6556
+ };
6550
6557
  var runtimeKeepalivePush = () => {
6551
6558
  runtimeKeepaliveCounter += 1;
6552
6559
  };
@@ -6555,6 +6562,193 @@ export function init(RuntimeName, PHPLoader) {
6555
6562
  runtimeKeepaliveCounter -= 1;
6556
6563
  };
6557
6564
  runtimeKeepalivePop.sig = 'v';
6565
+ var Asyncify = {
6566
+ instrumentWasmImports(imports) {
6567
+ var importPattern =
6568
+ /^(invoke_i|invoke_ii|invoke_iii|invoke_iiii|invoke_iiiii|invoke_iiiiii|invoke_iiiiiii|invoke_iiiiiiii|invoke_iiiiiiiii|invoke_iiiiiiiiii|invoke_v|invoke_vi|invoke_vii|invoke_viidii|invoke_viii|invoke_viiii|invoke_viiiii|invoke_viiiiii|invoke_viiiiiii|invoke_viiiiiiiii|invoke_i|invoke_ii|invoke_iii|invoke_iiii|invoke_iiiii|invoke_iiiiii|invoke_iiiiiii|invoke_iiiiiiii|invoke_iiiiiiiiii|invoke_iij|invoke_iiji|invoke_iiij|invoke_iijii|invoke_iijiji|invoke_jii|invoke_jiii|invoke_viijii|invoke_vji|js_open_process|_js_open_process|_asyncjs__js_open_process|js_popen_to_file|_js_popen_to_file|_asyncjs__js_popen_to_file|__syscall_fcntl64|___syscall_fcntl64|_asyncjs___syscall_fcntl64|js_release_file_locks|_js_release_file_locks|_async_js_release_file_locks|js_flock|_js_flock|_async_js_flock|js_fd_read|_js_fd_read|fd_close|_fd_close|_asyncjs__fd_close|close|_close|js_module_onMessage|zend_hash_str_find|_js_module_onMessage|_asyncjs__js_module_onMessage|js_waitpid|_js_waitpid|_asyncjs__js_waitpid|wasm_poll_socket|_wasm_poll_socket|_asyncjs__wasm_poll_socket|_wasm_shutdown|_asyncjs__wasm_shutdown|recv|_recv|setsockopt|_setsockopt|wasm_connect|_wasm_connect|__asyncjs__.*)$/;
6569
+ for (let [x, original] of Object.entries(imports)) {
6570
+ if (typeof original == 'function') {
6571
+ let isAsyncifyImport =
6572
+ original.isAsync || importPattern.test(x);
6573
+ }
6574
+ }
6575
+ },
6576
+ instrumentFunction(original) {
6577
+ var wrapper = (...args) => {
6578
+ Asyncify.exportCallStack.push(original);
6579
+ try {
6580
+ return original(...args);
6581
+ } finally {
6582
+ if (!ABORT) {
6583
+ var top = Asyncify.exportCallStack.pop();
6584
+ Asyncify.maybeStopUnwind();
6585
+ }
6586
+ }
6587
+ };
6588
+ Asyncify.funcWrappers.set(original, wrapper);
6589
+ wrapper.orig = original;
6590
+ return wrapper;
6591
+ },
6592
+ instrumentWasmExports(exports) {
6593
+ var ret = {};
6594
+ for (let [x, original] of Object.entries(exports)) {
6595
+ if (typeof original == 'function') {
6596
+ var wrapper = Asyncify.instrumentFunction(original);
6597
+ ret[x] = wrapper;
6598
+ } else {
6599
+ ret[x] = original;
6600
+ }
6601
+ }
6602
+ return ret;
6603
+ },
6604
+ State: { Normal: 0, Unwinding: 1, Rewinding: 2, Disabled: 3 },
6605
+ state: 0,
6606
+ StackSize: 4096,
6607
+ currData: null,
6608
+ handleSleepReturnValue: 0,
6609
+ exportCallStack: [],
6610
+ callstackFuncToId: new Map(),
6611
+ callStackIdToFunc: new Map(),
6612
+ funcWrappers: new Map(),
6613
+ callStackId: 0,
6614
+ asyncPromiseHandlers: null,
6615
+ sleepCallbacks: [],
6616
+ getCallStackId(func) {
6617
+ if (!Asyncify.callstackFuncToId.has(func)) {
6618
+ var id = Asyncify.callStackId++;
6619
+ Asyncify.callstackFuncToId.set(func, id);
6620
+ Asyncify.callStackIdToFunc.set(id, func);
6621
+ }
6622
+ return Asyncify.callstackFuncToId.get(func);
6623
+ },
6624
+ maybeStopUnwind() {
6625
+ if (
6626
+ Asyncify.currData &&
6627
+ Asyncify.state === Asyncify.State.Unwinding &&
6628
+ Asyncify.exportCallStack.length === 0
6629
+ ) {
6630
+ Asyncify.state = Asyncify.State.Normal;
6631
+ runtimeKeepalivePush();
6632
+ runAndAbortIfError(_asyncify_stop_unwind);
6633
+ if (typeof Fibers != 'undefined') {
6634
+ Fibers.trampoline();
6635
+ }
6636
+ }
6637
+ },
6638
+ whenDone() {
6639
+ return new Promise((resolve, reject) => {
6640
+ Asyncify.asyncPromiseHandlers = { resolve, reject };
6641
+ });
6642
+ },
6643
+ allocateData() {
6644
+ var ptr = _malloc(12 + Asyncify.StackSize);
6645
+ Asyncify.setDataHeader(ptr, ptr + 12, Asyncify.StackSize);
6646
+ Asyncify.setDataRewindFunc(ptr);
6647
+ return ptr;
6648
+ },
6649
+ setDataHeader(ptr, stack, stackSize) {
6650
+ HEAPU32[ptr >> 2] = stack;
6651
+ HEAPU32[(ptr + 4) >> 2] = stack + stackSize;
6652
+ },
6653
+ setDataRewindFunc(ptr) {
6654
+ var bottomOfCallStack = Asyncify.exportCallStack[0];
6655
+ var rewindId = Asyncify.getCallStackId(bottomOfCallStack);
6656
+ HEAP32[(ptr + 8) >> 2] = rewindId;
6657
+ },
6658
+ getDataRewindFunc(ptr) {
6659
+ var id = HEAP32[(ptr + 8) >> 2];
6660
+ var func = Asyncify.callStackIdToFunc.get(id);
6661
+ return func;
6662
+ },
6663
+ doRewind(ptr) {
6664
+ var original = Asyncify.getDataRewindFunc(ptr);
6665
+ var func = Asyncify.funcWrappers.get(original);
6666
+ runtimeKeepalivePop();
6667
+ return func();
6668
+ },
6669
+ handleSleep(startAsync) {
6670
+ if (ABORT) return;
6671
+ if (Asyncify.state === Asyncify.State.Normal) {
6672
+ var reachedCallback = false;
6673
+ var reachedAfterCallback = false;
6674
+ startAsync((handleSleepReturnValue = 0) => {
6675
+ if (ABORT) return;
6676
+ Asyncify.handleSleepReturnValue = handleSleepReturnValue;
6677
+ reachedCallback = true;
6678
+ if (!reachedAfterCallback) {
6679
+ return;
6680
+ }
6681
+ Asyncify.state = Asyncify.State.Rewinding;
6682
+ runAndAbortIfError(() =>
6683
+ _asyncify_start_rewind(Asyncify.currData)
6684
+ );
6685
+ if (typeof MainLoop != 'undefined' && MainLoop.func) {
6686
+ MainLoop.resume();
6687
+ }
6688
+ var asyncWasmReturnValue,
6689
+ isError = false;
6690
+ try {
6691
+ asyncWasmReturnValue = Asyncify.doRewind(
6692
+ Asyncify.currData
6693
+ );
6694
+ } catch (err) {
6695
+ asyncWasmReturnValue = err;
6696
+ isError = true;
6697
+ }
6698
+ var handled = false;
6699
+ if (!Asyncify.currData) {
6700
+ var asyncPromiseHandlers =
6701
+ Asyncify.asyncPromiseHandlers;
6702
+ if (asyncPromiseHandlers) {
6703
+ Asyncify.asyncPromiseHandlers = null;
6704
+ (isError
6705
+ ? asyncPromiseHandlers.reject
6706
+ : asyncPromiseHandlers.resolve)(
6707
+ asyncWasmReturnValue
6708
+ );
6709
+ handled = true;
6710
+ }
6711
+ }
6712
+ if (isError && !handled) {
6713
+ throw asyncWasmReturnValue;
6714
+ }
6715
+ });
6716
+ reachedAfterCallback = true;
6717
+ if (!reachedCallback) {
6718
+ Asyncify.state = Asyncify.State.Unwinding;
6719
+ if (!Asyncify._cachedData) {
6720
+ Asyncify._cachedData = Asyncify.allocateData();
6721
+ } else {
6722
+ Asyncify.setDataHeader(
6723
+ Asyncify._cachedData,
6724
+ Asyncify._cachedData + 12,
6725
+ Asyncify.StackSize
6726
+ );
6727
+ Asyncify.setDataRewindFunc(Asyncify._cachedData);
6728
+ }
6729
+ Asyncify.currData = Asyncify._cachedData;
6730
+ if (typeof MainLoop != 'undefined' && MainLoop.func) {
6731
+ MainLoop.pause();
6732
+ }
6733
+ runAndAbortIfError(() =>
6734
+ _asyncify_start_unwind(Asyncify.currData)
6735
+ );
6736
+ }
6737
+ } else if (Asyncify.state === Asyncify.State.Rewinding) {
6738
+ Asyncify.state = Asyncify.State.Normal;
6739
+ runAndAbortIfError(_asyncify_stop_rewind);
6740
+ Asyncify.currData = null;
6741
+ Asyncify.sleepCallbacks.forEach(callUserCallback);
6742
+ } else {
6743
+ abort(`invalid state: ${Asyncify.state}`);
6744
+ }
6745
+ return Asyncify.handleSleepReturnValue;
6746
+ },
6747
+ handleAsync: (startAsync) =>
6748
+ Asyncify.handleSleep((wakeUp) => {
6749
+ startAsync().then(wakeUp);
6750
+ }),
6751
+ };
6558
6752
  var safeSetTimeout = (func, timeout) => {
6559
6753
  runtimeKeepalivePush();
6560
6754
  return setTimeout(() => {
@@ -6564,9 +6758,6 @@ export function init(RuntimeName, PHPLoader) {
6564
6758
  };
6565
6759
  var _emscripten_sleep = function (ms) {
6566
6760
  return Asyncify.handleSleep((wakeUp) => {
6567
- // select() yields between socket reads. Nested zero-delay timers are
6568
- // clamped by browsers, adding seconds to even a local curl download.
6569
- // Use a task (not a microtask) so network events still get a turn.
6570
6761
  if (ms === 0 && globalThis.scheduler?.postTask) {
6571
6762
  runtimeKeepalivePush();
6572
6763
  globalThis.scheduler.postTask(() => {
@@ -6997,13 +7188,11 @@ export function init(RuntimeName, PHPLoader) {
6997
7188
  envLength
6998
7189
  ) {
6999
7190
  if (!command) {
7000
- ___errno_location(ERRNO_CODES.EINVAL);
7001
- return -1;
7191
+ return -ERRNO_CODES.EINVAL;
7002
7192
  }
7003
7193
  const cmdstr = UTF8ToString(command);
7004
7194
  if (!cmdstr.length) {
7005
- ___errno_location(ERRNO_CODES.EINVAL);
7006
- return -1;
7195
+ return -ERRNO_CODES.EINVAL;
7007
7196
  }
7008
7197
  let argsArray = [];
7009
7198
  if (argsLength) {
@@ -7058,13 +7247,11 @@ export function init(RuntimeName, PHPLoader) {
7058
7247
  }
7059
7248
  } catch (e) {
7060
7249
  if (e.code === 'SPAWN_UNSUPPORTED') {
7061
- ___errno_location(ERRNO_CODES.ENOSYS);
7062
- return -1;
7250
+ return -ERRNO_CODES.ENOSYS;
7063
7251
  }
7064
7252
  if (typeof FS == 'undefined' || !(e.name === 'ErrnoError'))
7065
7253
  throw e;
7066
- ___errno_location(e.code);
7067
- return -1;
7254
+ return -e.errno;
7068
7255
  }
7069
7256
  const ProcInfo = { pid: cp.pid, exited: false };
7070
7257
  PHPWASM.processTable[ProcInfo.pid] = ProcInfo;
@@ -7075,7 +7262,12 @@ export function init(RuntimeName, PHPLoader) {
7075
7262
  stderrChildFd = std[2]?.child,
7076
7263
  stderrParentFd = std[2]?.parent;
7077
7264
  const detachPipeDataListeners = [];
7078
- cp.on('exit', function (code) {
7265
+ let childPipesClosed = false;
7266
+ const closeChildPipes = function () {
7267
+ if (childPipesClosed) {
7268
+ return;
7269
+ }
7270
+ childPipesClosed = true;
7079
7271
  for (const detach of detachPipeDataListeners) {
7080
7272
  detach();
7081
7273
  }
@@ -7084,6 +7276,9 @@ export function init(RuntimeName, PHPLoader) {
7084
7276
  FS.close(FS.streams[fd]);
7085
7277
  }
7086
7278
  }
7279
+ };
7280
+ cp.on('exit', function (code) {
7281
+ closeChildPipes();
7087
7282
  ProcInfo.exitCode = code;
7088
7283
  ProcInfo.exited = true;
7089
7284
  });
@@ -7163,6 +7358,10 @@ export function init(RuntimeName, PHPLoader) {
7163
7358
  });
7164
7359
  } catch (e) {
7165
7360
  console.error(e);
7361
+ closeChildPipes();
7362
+ if (!ProcInfo.pid) {
7363
+ return -(ERRNO_CODES[e.code] ?? ERRNO_CODES.ECHILD);
7364
+ }
7166
7365
  return ProcInfo.pid;
7167
7366
  }
7168
7367
  if (stdinChildFd) {
@@ -7642,200 +7841,6 @@ export function init(RuntimeName, PHPLoader) {
7642
7841
  function _wasm_shutdown(socketd, how) {
7643
7842
  return PHPWASM.shutdownSocket(socketd, how);
7644
7843
  }
7645
- var runAndAbortIfError = (func) => {
7646
- try {
7647
- return func();
7648
- } catch (e) {
7649
- abort(e);
7650
- }
7651
- };
7652
- var Asyncify = {
7653
- instrumentWasmImports(imports) {
7654
- var importPattern =
7655
- /^(invoke_i|invoke_ii|invoke_iii|invoke_iiii|invoke_iiiii|invoke_iiiiii|invoke_iiiiiii|invoke_iiiiiiii|invoke_iiiiiiiii|invoke_iiiiiiiiii|invoke_v|invoke_vi|invoke_vii|invoke_viidii|invoke_viii|invoke_viiii|invoke_viiiii|invoke_viiiiii|invoke_viiiiiii|invoke_viiiiiiiii|invoke_i|invoke_ii|invoke_iii|invoke_iiii|invoke_iiiii|invoke_iiiiii|invoke_iiiiiii|invoke_iiiiiiii|invoke_iiiiiiiiii|invoke_iij|invoke_iiji|invoke_iiij|invoke_iijii|invoke_iijiji|invoke_jii|invoke_jiii|invoke_viijii|invoke_vji|js_open_process|_js_open_process|_asyncjs__js_open_process|js_popen_to_file|_js_popen_to_file|_asyncjs__js_popen_to_file|__syscall_fcntl64|___syscall_fcntl64|_asyncjs___syscall_fcntl64|js_release_file_locks|_js_release_file_locks|_async_js_release_file_locks|js_flock|_js_flock|_async_js_flock|js_fd_read|_js_fd_read|fd_close|_fd_close|_asyncjs__fd_close|close|_close|js_module_onMessage|zend_hash_str_find|_js_module_onMessage|_asyncjs__js_module_onMessage|js_waitpid|_js_waitpid|_asyncjs__js_waitpid|wasm_poll_socket|_wasm_poll_socket|_asyncjs__wasm_poll_socket|_wasm_shutdown|_asyncjs__wasm_shutdown|recv|_recv|setsockopt|_setsockopt|wasm_connect|_wasm_connect|__asyncjs__.*)$/;
7656
- for (let [x, original] of Object.entries(imports)) {
7657
- if (typeof original == 'function') {
7658
- let isAsyncifyImport =
7659
- original.isAsync || importPattern.test(x);
7660
- }
7661
- }
7662
- },
7663
- instrumentFunction(original) {
7664
- var wrapper = (...args) => {
7665
- Asyncify.exportCallStack.push(original);
7666
- try {
7667
- return original(...args);
7668
- } finally {
7669
- if (!ABORT) {
7670
- var top = Asyncify.exportCallStack.pop();
7671
- Asyncify.maybeStopUnwind();
7672
- }
7673
- }
7674
- };
7675
- Asyncify.funcWrappers.set(original, wrapper);
7676
- wrapper.orig = original;
7677
- return wrapper;
7678
- },
7679
- instrumentWasmExports(exports) {
7680
- var ret = {};
7681
- for (let [x, original] of Object.entries(exports)) {
7682
- if (typeof original == 'function') {
7683
- var wrapper = Asyncify.instrumentFunction(original);
7684
- ret[x] = wrapper;
7685
- } else {
7686
- ret[x] = original;
7687
- }
7688
- }
7689
- return ret;
7690
- },
7691
- State: { Normal: 0, Unwinding: 1, Rewinding: 2, Disabled: 3 },
7692
- state: 0,
7693
- StackSize: 4096,
7694
- currData: null,
7695
- handleSleepReturnValue: 0,
7696
- exportCallStack: [],
7697
- callstackFuncToId: new Map(),
7698
- callStackIdToFunc: new Map(),
7699
- funcWrappers: new Map(),
7700
- callStackId: 0,
7701
- asyncPromiseHandlers: null,
7702
- sleepCallbacks: [],
7703
- getCallStackId(func) {
7704
- if (!Asyncify.callstackFuncToId.has(func)) {
7705
- var id = Asyncify.callStackId++;
7706
- Asyncify.callstackFuncToId.set(func, id);
7707
- Asyncify.callStackIdToFunc.set(id, func);
7708
- }
7709
- return Asyncify.callstackFuncToId.get(func);
7710
- },
7711
- maybeStopUnwind() {
7712
- if (
7713
- Asyncify.currData &&
7714
- Asyncify.state === Asyncify.State.Unwinding &&
7715
- Asyncify.exportCallStack.length === 0
7716
- ) {
7717
- Asyncify.state = Asyncify.State.Normal;
7718
- runtimeKeepalivePush();
7719
- runAndAbortIfError(_asyncify_stop_unwind);
7720
- if (typeof Fibers != 'undefined') {
7721
- Fibers.trampoline();
7722
- }
7723
- }
7724
- },
7725
- whenDone() {
7726
- return new Promise((resolve, reject) => {
7727
- Asyncify.asyncPromiseHandlers = { resolve, reject };
7728
- });
7729
- },
7730
- allocateData() {
7731
- var ptr = _malloc(12 + Asyncify.StackSize);
7732
- Asyncify.setDataHeader(ptr, ptr + 12, Asyncify.StackSize);
7733
- Asyncify.setDataRewindFunc(ptr);
7734
- return ptr;
7735
- },
7736
- setDataHeader(ptr, stack, stackSize) {
7737
- HEAPU32[ptr >> 2] = stack;
7738
- HEAPU32[(ptr + 4) >> 2] = stack + stackSize;
7739
- },
7740
- setDataRewindFunc(ptr) {
7741
- var bottomOfCallStack = Asyncify.exportCallStack[0];
7742
- var rewindId = Asyncify.getCallStackId(bottomOfCallStack);
7743
- HEAP32[(ptr + 8) >> 2] = rewindId;
7744
- },
7745
- getDataRewindFunc(ptr) {
7746
- var id = HEAP32[(ptr + 8) >> 2];
7747
- var func = Asyncify.callStackIdToFunc.get(id);
7748
- return func;
7749
- },
7750
- doRewind(ptr) {
7751
- var original = Asyncify.getDataRewindFunc(ptr);
7752
- var func = Asyncify.funcWrappers.get(original);
7753
- runtimeKeepalivePop();
7754
- return func();
7755
- },
7756
- handleSleep(startAsync) {
7757
- if (ABORT) return;
7758
- if (Asyncify.state === Asyncify.State.Normal) {
7759
- var reachedCallback = false;
7760
- var reachedAfterCallback = false;
7761
- startAsync((handleSleepReturnValue = 0) => {
7762
- if (ABORT) return;
7763
- Asyncify.handleSleepReturnValue = handleSleepReturnValue;
7764
- reachedCallback = true;
7765
- if (!reachedAfterCallback) {
7766
- return;
7767
- }
7768
- Asyncify.state = Asyncify.State.Rewinding;
7769
- runAndAbortIfError(() =>
7770
- _asyncify_start_rewind(Asyncify.currData)
7771
- );
7772
- if (typeof MainLoop != 'undefined' && MainLoop.func) {
7773
- MainLoop.resume();
7774
- }
7775
- var asyncWasmReturnValue,
7776
- isError = false;
7777
- try {
7778
- asyncWasmReturnValue = Asyncify.doRewind(
7779
- Asyncify.currData
7780
- );
7781
- } catch (err) {
7782
- asyncWasmReturnValue = err;
7783
- isError = true;
7784
- }
7785
- var handled = false;
7786
- if (!Asyncify.currData) {
7787
- var asyncPromiseHandlers =
7788
- Asyncify.asyncPromiseHandlers;
7789
- if (asyncPromiseHandlers) {
7790
- Asyncify.asyncPromiseHandlers = null;
7791
- (isError
7792
- ? asyncPromiseHandlers.reject
7793
- : asyncPromiseHandlers.resolve)(
7794
- asyncWasmReturnValue
7795
- );
7796
- handled = true;
7797
- }
7798
- }
7799
- if (isError && !handled) {
7800
- throw asyncWasmReturnValue;
7801
- }
7802
- });
7803
- reachedAfterCallback = true;
7804
- if (!reachedCallback) {
7805
- Asyncify.state = Asyncify.State.Unwinding;
7806
- if (!Asyncify._cachedData) {
7807
- Asyncify._cachedData = Asyncify.allocateData();
7808
- } else {
7809
- Asyncify.setDataHeader(
7810
- Asyncify._cachedData,
7811
- Asyncify._cachedData + 12,
7812
- Asyncify.StackSize
7813
- );
7814
- Asyncify.setDataRewindFunc(Asyncify._cachedData);
7815
- }
7816
- Asyncify.currData = Asyncify._cachedData;
7817
- if (typeof MainLoop != 'undefined' && MainLoop.func) {
7818
- MainLoop.pause();
7819
- }
7820
- runAndAbortIfError(() =>
7821
- _asyncify_start_unwind(Asyncify.currData)
7822
- );
7823
- }
7824
- } else if (Asyncify.state === Asyncify.State.Rewinding) {
7825
- Asyncify.state = Asyncify.State.Normal;
7826
- runAndAbortIfError(_asyncify_stop_rewind);
7827
- Asyncify.currData = null;
7828
- Asyncify.sleepCallbacks.forEach(callUserCallback);
7829
- } else {
7830
- abort(`invalid state: ${Asyncify.state}`);
7831
- }
7832
- return Asyncify.handleSleepReturnValue;
7833
- },
7834
- handleAsync: (startAsync) =>
7835
- Asyncify.handleSleep((wakeUp) => {
7836
- startAsync().then(wakeUp);
7837
- }),
7838
- };
7839
7844
  var getCFunc = (ident) => {
7840
7845
  var func = Module['_' + ident];
7841
7846
  return func;
@@ -8218,10 +8223,7 @@ export function init(RuntimeName, PHPLoader) {
8218
8223
  return ERRNO_CODES.EWOULDBLOCK;
8219
8224
  }
8220
8225
  return returnCallback(async (wakeUp) => {
8221
- var retries = 0;
8222
8226
  var interval = 50;
8223
- var timeout = 5e3;
8224
- var maxRetries = timeout / interval;
8225
8227
  while (true) {
8226
8228
  var returnCode;
8227
8229
  var stream;
@@ -8245,7 +8247,6 @@ export function init(RuntimeName, PHPLoader) {
8245
8247
  return wakeUp(0);
8246
8248
  }
8247
8249
  if (
8248
- ++retries > maxRetries ||
8249
8250
  !stream ||
8250
8251
  FS.isClosed(stream) ||
8251
8252
  returnCode !== ERRNO_CODES.EWOULDBLOCK ||
@@ -8300,6 +8301,7 @@ export function init(RuntimeName, PHPLoader) {
8300
8301
  _ap_php_snprintf,
8301
8302
  _ap_php_vsnprintf,
8302
8303
  _display_ini_entries,
8304
+ __efree,
8303
8305
  __emalloc_24,
8304
8306
  __emalloc_32,
8305
8307
  __emalloc_40,
@@ -8310,7 +8312,6 @@ export function init(RuntimeName, PHPLoader) {
8310
8312
  __emalloc_1280,
8311
8313
  __efree_56,
8312
8314
  __emalloc,
8313
- __efree,
8314
8315
  __erealloc,
8315
8316
  __safe_emalloc,
8316
8317
  ___zend_malloc,
@@ -8421,22 +8422,21 @@ export function init(RuntimeName, PHPLoader) {
8421
8422
  _smart_str_erealloc,
8422
8423
  _strtoll,
8423
8424
  _strlen,
8424
- _munmap,
8425
- _abort,
8426
- _free,
8427
8425
  _memcmp,
8428
- _malloc,
8429
- _snprintf,
8430
- _strchr,
8426
+ _free,
8431
8427
  _mmap,
8432
8428
  ___errno_location,
8429
+ _munmap,
8433
8430
  _dlopen,
8434
8431
  _dlsym,
8435
8432
  _dlclose,
8436
8433
  _strcmp,
8437
8434
  _getenv,
8438
8435
  _explicit_bzero,
8436
+ _malloc,
8437
+ _snprintf,
8439
8438
  _atoi,
8439
+ _strchr,
8440
8440
  _strrchr,
8441
8441
  _realloc,
8442
8442
  _strcasecmp,
@@ -8493,6 +8493,7 @@ export function init(RuntimeName, PHPLoader) {
8493
8493
  _fflush,
8494
8494
  _expf,
8495
8495
  _qsort,
8496
+ _abort,
8496
8497
  _calloc,
8497
8498
  _fgets,
8498
8499
  _initgroups,
@@ -8563,12 +8564,12 @@ export function init(RuntimeName, PHPLoader) {
8563
8564
  ___dynamic_cast,
8564
8565
  __ZNSt20bad_array_new_lengthD1Ev,
8565
8566
  __ZNSt12length_errorD1Ev,
8566
- dynCall_iiii,
8567
- dynCall_ii,
8568
- dynCall_vi,
8569
8567
  dynCall_vii,
8568
+ dynCall_vi,
8570
8569
  dynCall_viiiii,
8571
8570
  dynCall_iii,
8571
+ dynCall_iiii,
8572
+ dynCall_ii,
8572
8573
  dynCall_iiiii,
8573
8574
  dynCall_iiiiii,
8574
8575
  dynCall_viii,
@@ -8603,6 +8604,7 @@ export function init(RuntimeName, PHPLoader) {
8603
8604
  dynCall_iiiiiiiii,
8604
8605
  dynCall_viiiiiiiii,
8605
8606
  dynCall_vidi,
8607
+ dynCall_vj,
8606
8608
  dynCall_viijii,
8607
8609
  dynCall_viidii,
8608
8610
  dynCall_jiiji,
@@ -8676,6 +8678,7 @@ export function init(RuntimeName, PHPLoader) {
8676
8678
  wasmExports['ap_php_vsnprintf'];
8677
8679
  _display_ini_entries = Module['_display_ini_entries'] =
8678
8680
  wasmExports['display_ini_entries'];
8681
+ __efree = Module['__efree'] = wasmExports['_efree'];
8679
8682
  __emalloc_24 = Module['__emalloc_24'] = wasmExports['_emalloc_24'];
8680
8683
  __emalloc_32 = Module['__emalloc_32'] = wasmExports['_emalloc_32'];
8681
8684
  __emalloc_40 = Module['__emalloc_40'] = wasmExports['_emalloc_40'];
@@ -8687,7 +8690,6 @@ export function init(RuntimeName, PHPLoader) {
8687
8690
  wasmExports['_emalloc_1280'];
8688
8691
  __efree_56 = Module['__efree_56'] = wasmExports['_efree_56'];
8689
8692
  __emalloc = Module['__emalloc'] = wasmExports['_emalloc'];
8690
- __efree = Module['__efree'] = wasmExports['_efree'];
8691
8693
  __erealloc = Module['__erealloc'] = wasmExports['_erealloc'];
8692
8694
  __safe_emalloc = Module['__safe_emalloc'] =
8693
8695
  wasmExports['_safe_emalloc'];
@@ -8914,19 +8916,12 @@ export function init(RuntimeName, PHPLoader) {
8914
8916
  wasmExports['smart_str_erealloc'];
8915
8917
  _strtoll = Module['_strtoll'] = wasmExports['strtoll'];
8916
8918
  _strlen = Module['_strlen'] = wasmExports['strlen'];
8917
- _munmap = Module['_munmap'] = wasmExports['munmap'];
8918
- _abort = Module['_abort'] = wasmExports['abort'];
8919
- _free = Module['_free'] = wasmExports['free'];
8920
8919
  _memcmp = Module['_memcmp'] = wasmExports['memcmp'];
8921
- _malloc =
8922
- PHPLoader['malloc'] =
8923
- Module['_malloc'] =
8924
- wasmExports['malloc'];
8925
- _snprintf = Module['_snprintf'] = wasmExports['snprintf'];
8926
- _strchr = Module['_strchr'] = wasmExports['strchr'];
8920
+ _free = Module['_free'] = wasmExports['free'];
8927
8921
  _mmap = Module['_mmap'] = wasmExports['mmap'];
8928
8922
  ___errno_location = Module['___errno_location'] =
8929
8923
  wasmExports['__errno_location'];
8924
+ _munmap = Module['_munmap'] = wasmExports['munmap'];
8930
8925
  _dlopen = Module['_dlopen'] = wasmExports['dlopen'];
8931
8926
  _dlsym = Module['_dlsym'] = wasmExports['dlsym'];
8932
8927
  _dlclose = Module['_dlclose'] = wasmExports['dlclose'];
@@ -8934,7 +8929,13 @@ export function init(RuntimeName, PHPLoader) {
8934
8929
  _getenv = Module['_getenv'] = wasmExports['getenv'];
8935
8930
  _explicit_bzero = Module['_explicit_bzero'] =
8936
8931
  wasmExports['explicit_bzero'];
8932
+ _malloc =
8933
+ PHPLoader['malloc'] =
8934
+ Module['_malloc'] =
8935
+ wasmExports['malloc'];
8936
+ _snprintf = Module['_snprintf'] = wasmExports['snprintf'];
8937
8937
  _atoi = Module['_atoi'] = wasmExports['atoi'];
8938
+ _strchr = Module['_strchr'] = wasmExports['strchr'];
8938
8939
  _strrchr = Module['_strrchr'] = wasmExports['strrchr'];
8939
8940
  _realloc = Module['_realloc'] = wasmExports['realloc'];
8940
8941
  _strcasecmp = Module['_strcasecmp'] = wasmExports['strcasecmp'];
@@ -8993,6 +8994,7 @@ export function init(RuntimeName, PHPLoader) {
8993
8994
  _fflush = Module['_fflush'] = wasmExports['fflush'];
8994
8995
  _expf = Module['_expf'] = wasmExports['expf'];
8995
8996
  _qsort = Module['_qsort'] = wasmExports['qsort'];
8997
+ _abort = Module['_abort'] = wasmExports['abort'];
8996
8998
  _calloc = wasmExports['calloc'];
8997
8999
  _fgets = Module['_fgets'] = wasmExports['fgets'];
8998
9000
  _initgroups = Module['_initgroups'] = wasmExports['initgroups'];
@@ -9108,12 +9110,12 @@ export function init(RuntimeName, PHPLoader) {
9108
9110
  ] = wasmExports['_ZNSt20bad_array_new_lengthD1Ev'];
9109
9111
  __ZNSt12length_errorD1Ev = Module['__ZNSt12length_errorD1Ev'] =
9110
9112
  wasmExports['_ZNSt12length_errorD1Ev'];
9111
- dynCall_iiii = dynCalls['iiii'] = wasmExports['dynCall_iiii'];
9112
- dynCall_ii = dynCalls['ii'] = wasmExports['dynCall_ii'];
9113
- dynCall_vi = dynCalls['vi'] = wasmExports['dynCall_vi'];
9114
9113
  dynCall_vii = dynCalls['vii'] = wasmExports['dynCall_vii'];
9114
+ dynCall_vi = dynCalls['vi'] = wasmExports['dynCall_vi'];
9115
9115
  dynCall_viiiii = dynCalls['viiiii'] = wasmExports['dynCall_viiiii'];
9116
9116
  dynCall_iii = dynCalls['iii'] = wasmExports['dynCall_iii'];
9117
+ dynCall_iiii = dynCalls['iiii'] = wasmExports['dynCall_iiii'];
9118
+ dynCall_ii = dynCalls['ii'] = wasmExports['dynCall_ii'];
9117
9119
  dynCall_iiiii = dynCalls['iiiii'] = wasmExports['dynCall_iiiii'];
9118
9120
  dynCall_iiiiii = dynCalls['iiiiii'] = wasmExports['dynCall_iiiiii'];
9119
9121
  dynCall_viii = dynCalls['viii'] = wasmExports['dynCall_viii'];
@@ -9154,6 +9156,7 @@ export function init(RuntimeName, PHPLoader) {
9154
9156
  dynCall_viiiiiiiii = dynCalls['viiiiiiiii'] =
9155
9157
  wasmExports['dynCall_viiiiiiiii'];
9156
9158
  dynCall_vidi = dynCalls['vidi'] = wasmExports['dynCall_vidi'];
9159
+ dynCall_vj = dynCalls['vj'] = wasmExports['dynCall_vj'];
9157
9160
  dynCall_viijii = dynCalls['viijii'] = wasmExports['dynCall_viijii'];
9158
9161
  dynCall_viidii = dynCalls['viidii'] = wasmExports['dynCall_viidii'];
9159
9162
  dynCall_jiiji = dynCalls['jiiji'] = wasmExports['dynCall_jiiji'];
@@ -9210,37 +9213,37 @@ export function init(RuntimeName, PHPLoader) {
9210
9213
  __indirect_function_table = wasmTable =
9211
9214
  wasmExports['__indirect_function_table'];
9212
9215
  }
9213
- var _executor_globals = (Module['_executor_globals'] = 13120896);
9214
- var _zend_ce_aggregate = (Module['_zend_ce_aggregate'] = 13010016);
9215
- var _zend_ce_iterator = (Module['_zend_ce_iterator'] = 13010020);
9216
- var _zend_ce_countable = (Module['_zend_ce_countable'] = 13010032);
9217
- var _zend_ce_exception = (Module['_zend_ce_exception'] = 13118416);
9218
- var _zend_empty_string = (Module['_zend_empty_string'] = 13008480);
9216
+ var _executor_globals = (Module['_executor_globals'] = 13121368);
9217
+ var _zend_ce_aggregate = (Module['_zend_ce_aggregate'] = 13009360);
9218
+ var _zend_ce_iterator = (Module['_zend_ce_iterator'] = 13009364);
9219
+ var _zend_ce_countable = (Module['_zend_ce_countable'] = 13009376);
9220
+ var _zend_ce_exception = (Module['_zend_ce_exception'] = 13117488);
9221
+ var _zend_empty_string = (Module['_zend_empty_string'] = 13118708);
9219
9222
  var _zend_string_init_interned = (Module['_zend_string_init_interned'] =
9220
- 13008548);
9221
- var _std_object_handlers = (Module['_std_object_handlers'] = 12640432);
9223
+ 13118780);
9224
+ var _std_object_handlers = (Module['_std_object_handlers'] = 12271592);
9222
9225
  var ___memory_base = (Module['___memory_base'] = 0);
9223
9226
  var ___table_base = (Module['___table_base'] = 1);
9224
- var _stdout = (Module['_stdout'] = 13001968);
9225
- var _timezone = (Module['_timezone'] = 13451544);
9226
- var _tzname = (Module['_tzname'] = 13451552);
9227
- var ___heap_base = 14513248;
9227
+ var _stdout = (Module['_stdout'] = 13002512);
9228
+ var _timezone = (Module['_timezone'] = 13452024);
9229
+ var _tzname = (Module['_tzname'] = 13452032);
9230
+ var ___heap_base = 14513728;
9228
9231
  var __ZNSt3__25ctypeIcE2idE = (Module['__ZNSt3__25ctypeIcE2idE'] =
9229
- 13464660);
9232
+ 13465140);
9230
9233
  var __ZTVN10__cxxabiv120__si_class_type_infoE = (Module[
9231
9234
  '__ZTVN10__cxxabiv120__si_class_type_infoE'
9232
- ] = 13002216);
9235
+ ] = 13002760);
9233
9236
  var __ZTVN10__cxxabiv117__class_type_infoE = (Module[
9234
9237
  '__ZTVN10__cxxabiv117__class_type_infoE'
9235
- ] = 13002176);
9238
+ ] = 13002720);
9236
9239
  var __ZTVN10__cxxabiv121__vmi_class_type_infoE = (Module[
9237
9240
  '__ZTVN10__cxxabiv121__vmi_class_type_infoE'
9238
- ] = 13002268);
9241
+ ] = 13002812);
9239
9242
  var __ZTISt20bad_array_new_length = (Module[
9240
9243
  '__ZTISt20bad_array_new_length'
9241
- ] = 13002340);
9242
- var __ZTVSt12length_error = (Module['__ZTVSt12length_error'] = 13002384);
9243
- var __ZTISt12length_error = (Module['__ZTISt12length_error'] = 13002404);
9244
+ ] = 13002884);
9245
+ var __ZTVSt12length_error = (Module['__ZTVSt12length_error'] = 13002928);
9246
+ var __ZTISt12length_error = (Module['__ZTISt12length_error'] = 13002948);
9244
9247
  var wasmImports = {
9245
9248
  __assert_fail: ___assert_fail,
9246
9249
  __asyncify_data: ___asyncify_data,
@@ -9360,6 +9363,7 @@ export function init(RuntimeName, PHPLoader) {
9360
9363
  invoke_viiij,
9361
9364
  invoke_viijii,
9362
9365
  invoke_vijj,
9366
+ invoke_vj,
9363
9367
  invoke_vji,
9364
9368
  js_fd_read,
9365
9369
  js_open_process: _js_open_process,
@@ -9561,51 +9565,61 @@ export function init(RuntimeName, PHPLoader) {
9561
9565
  _setThrew(1, 0);
9562
9566
  }
9563
9567
  }
9564
- function invoke_viijii(index, a1, a2, a3, a4, a5) {
9568
+ function invoke_ji(index, a1) {
9565
9569
  var sp = stackSave();
9566
9570
  try {
9567
- dynCalls['viijii'](index, a1, a2, a3, a4, a5);
9571
+ return dynCalls['ji'](index, a1);
9568
9572
  } catch (e) {
9569
9573
  stackRestore(sp);
9570
9574
  if (e !== e + 0) throw e;
9571
9575
  _setThrew(1, 0);
9576
+ return 0n;
9572
9577
  }
9573
9578
  }
9574
- function invoke_viidii(index, a1, a2, a3, a4, a5) {
9579
+ function invoke_vj(index, a1) {
9575
9580
  var sp = stackSave();
9576
9581
  try {
9577
- dynCalls['viidii'](index, a1, a2, a3, a4, a5);
9582
+ dynCalls['vj'](index, a1);
9578
9583
  } catch (e) {
9579
9584
  stackRestore(sp);
9580
9585
  if (e !== e + 0) throw e;
9581
9586
  _setThrew(1, 0);
9582
9587
  }
9583
9588
  }
9584
- function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) {
9589
+ function invoke_viijii(index, a1, a2, a3, a4, a5) {
9585
9590
  var sp = stackSave();
9586
9591
  try {
9587
- dynCalls['viiiiii'](index, a1, a2, a3, a4, a5, a6);
9592
+ dynCalls['viijii'](index, a1, a2, a3, a4, a5);
9588
9593
  } catch (e) {
9589
9594
  stackRestore(sp);
9590
9595
  if (e !== e + 0) throw e;
9591
9596
  _setThrew(1, 0);
9592
9597
  }
9593
9598
  }
9594
- function invoke_jiii(index, a1, a2, a3) {
9599
+ function invoke_viidii(index, a1, a2, a3, a4, a5) {
9595
9600
  var sp = stackSave();
9596
9601
  try {
9597
- return dynCalls['jiii'](index, a1, a2, a3);
9602
+ dynCalls['viidii'](index, a1, a2, a3, a4, a5);
9598
9603
  } catch (e) {
9599
9604
  stackRestore(sp);
9600
9605
  if (e !== e + 0) throw e;
9601
9606
  _setThrew(1, 0);
9602
- return 0n;
9603
9607
  }
9604
9608
  }
9605
- function invoke_ji(index, a1) {
9609
+ function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) {
9606
9610
  var sp = stackSave();
9607
9611
  try {
9608
- return dynCalls['ji'](index, a1);
9612
+ dynCalls['viiiiii'](index, a1, a2, a3, a4, a5, a6);
9613
+ } catch (e) {
9614
+ stackRestore(sp);
9615
+ if (e !== e + 0) throw e;
9616
+ _setThrew(1, 0);
9617
+ }
9618
+ }
9619
+ function invoke_jiii(index, a1, a2, a3) {
9620
+ var sp = stackSave();
9621
+ try {
9622
+ return dynCalls['jiii'](index, a1, a2, a3);
9609
9623
  } catch (e) {
9610
9624
  stackRestore(sp);
9611
9625
  if (e !== e + 0) throw e;