@php-wasm/node-8-3 3.1.60 → 3.1.62

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.
@@ -13,10 +13,10 @@ const currentDirPath =
13
13
  typeof __dirname !== 'undefined'
14
14
  ? __dirname
15
15
  : path.dirname(fileURLToPath(import.meta.url));
16
- const dependencyFilename = path.join(currentDirPath, '8_3_33', 'php_8_3.wasm');
16
+ const dependencyFilename = path.join(currentDirPath, '8_3_36', 'php_8_3.wasm');
17
17
  export { dependencyFilename };
18
- export const dependenciesTotalSize = 23485474;
19
- const phpVersionString = '8.3.33';
18
+ export const dependenciesTotalSize = 23495244;
19
+ const phpVersionString = '8.3.36';
20
20
  export function init(RuntimeName, PHPLoader) {
21
21
  // The rest of the code comes from the built php.js file and esm-suffix.js
22
22
  // include: shell.js
@@ -8563,6 +8563,14 @@ export function init(RuntimeName, PHPLoader) {
8563
8563
 
8564
8564
  _emscripten_resize_heap.sig = 'ip';
8565
8565
 
8566
+ var runAndAbortIfError = (func) => {
8567
+ try {
8568
+ return func();
8569
+ } catch (e) {
8570
+ abort(e);
8571
+ }
8572
+ };
8573
+
8566
8574
  var runtimeKeepalivePush = () => {
8567
8575
  runtimeKeepaliveCounter += 1;
8568
8576
  };
@@ -8575,6 +8583,242 @@ export function init(RuntimeName, PHPLoader) {
8575
8583
 
8576
8584
  runtimeKeepalivePop.sig = 'v';
8577
8585
 
8586
+ var Asyncify = {
8587
+ instrumentWasmImports(imports) {
8588
+ var importPattern =
8589
+ /^(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__.*)$/;
8590
+ for (let [x, original] of Object.entries(imports)) {
8591
+ if (typeof original == 'function') {
8592
+ let isAsyncifyImport =
8593
+ original.isAsync || importPattern.test(x);
8594
+ }
8595
+ }
8596
+ },
8597
+ instrumentFunction(original) {
8598
+ var wrapper = (...args) => {
8599
+ Asyncify.exportCallStack.push(original);
8600
+ try {
8601
+ return original(...args);
8602
+ } finally {
8603
+ if (!ABORT) {
8604
+ var top = Asyncify.exportCallStack.pop();
8605
+ Asyncify.maybeStopUnwind();
8606
+ }
8607
+ }
8608
+ };
8609
+ Asyncify.funcWrappers.set(original, wrapper);
8610
+ wrapper.orig = original;
8611
+ return wrapper;
8612
+ },
8613
+ instrumentWasmExports(exports) {
8614
+ var ret = {};
8615
+ for (let [x, original] of Object.entries(exports)) {
8616
+ if (typeof original == 'function') {
8617
+ var wrapper = Asyncify.instrumentFunction(original);
8618
+ ret[x] = wrapper;
8619
+ } else {
8620
+ ret[x] = original;
8621
+ }
8622
+ }
8623
+ return ret;
8624
+ },
8625
+ State: {
8626
+ Normal: 0,
8627
+ Unwinding: 1,
8628
+ Rewinding: 2,
8629
+ Disabled: 3,
8630
+ },
8631
+ state: 0,
8632
+ StackSize: 4096,
8633
+ currData: null,
8634
+ handleSleepReturnValue: 0,
8635
+ exportCallStack: [],
8636
+ callstackFuncToId: new Map(),
8637
+ callStackIdToFunc: new Map(),
8638
+ funcWrappers: new Map(),
8639
+ callStackId: 0,
8640
+ asyncPromiseHandlers: null,
8641
+ sleepCallbacks: [],
8642
+ getCallStackId(func) {
8643
+ if (!Asyncify.callstackFuncToId.has(func)) {
8644
+ var id = Asyncify.callStackId++;
8645
+ Asyncify.callstackFuncToId.set(func, id);
8646
+ Asyncify.callStackIdToFunc.set(id, func);
8647
+ }
8648
+ return Asyncify.callstackFuncToId.get(func);
8649
+ },
8650
+ maybeStopUnwind() {
8651
+ if (
8652
+ Asyncify.currData &&
8653
+ Asyncify.state === Asyncify.State.Unwinding &&
8654
+ Asyncify.exportCallStack.length === 0
8655
+ ) {
8656
+ // We just finished unwinding.
8657
+ // Be sure to set the state before calling any other functions to avoid
8658
+ // possible infinite recursion here (For example in debug pthread builds
8659
+ // the dbg() function itself can call back into WebAssembly to get the
8660
+ // current pthread_self() pointer).
8661
+ Asyncify.state = Asyncify.State.Normal;
8662
+ runtimeKeepalivePush();
8663
+ // Keep the runtime alive so that a re-wind can be done later.
8664
+ runAndAbortIfError(_asyncify_stop_unwind);
8665
+ if (typeof Fibers != 'undefined') {
8666
+ Fibers.trampoline();
8667
+ }
8668
+ }
8669
+ },
8670
+ whenDone() {
8671
+ return new Promise((resolve, reject) => {
8672
+ Asyncify.asyncPromiseHandlers = {
8673
+ resolve,
8674
+ reject,
8675
+ };
8676
+ });
8677
+ },
8678
+ allocateData() {
8679
+ // An asyncify data structure has three fields:
8680
+ // 0 current stack pos
8681
+ // 4 max stack pos
8682
+ // 8 id of function at bottom of the call stack (callStackIdToFunc[id] == wasm func)
8683
+ // The Asyncify ABI only interprets the first two fields, the rest is for the runtime.
8684
+ // We also embed a stack in the same memory region here, right next to the structure.
8685
+ // This struct is also defined as asyncify_data_t in emscripten/fiber.h
8686
+ var ptr = _malloc(12 + Asyncify.StackSize);
8687
+ Asyncify.setDataHeader(ptr, ptr + 12, Asyncify.StackSize);
8688
+ Asyncify.setDataRewindFunc(ptr);
8689
+ return ptr;
8690
+ },
8691
+ setDataHeader(ptr, stack, stackSize) {
8692
+ HEAPU32[ptr >> 2] = stack;
8693
+ HEAPU32[(ptr + 4) >> 2] = stack + stackSize;
8694
+ },
8695
+ setDataRewindFunc(ptr) {
8696
+ var bottomOfCallStack = Asyncify.exportCallStack[0];
8697
+ var rewindId = Asyncify.getCallStackId(bottomOfCallStack);
8698
+ HEAP32[(ptr + 8) >> 2] = rewindId;
8699
+ },
8700
+ getDataRewindFunc(ptr) {
8701
+ var id = HEAP32[(ptr + 8) >> 2];
8702
+ var func = Asyncify.callStackIdToFunc.get(id);
8703
+ return func;
8704
+ },
8705
+ doRewind(ptr) {
8706
+ var original = Asyncify.getDataRewindFunc(ptr);
8707
+ var func = Asyncify.funcWrappers.get(original);
8708
+ // Once we have rewound and the stack we no longer need to artificially
8709
+ // keep the runtime alive.
8710
+ runtimeKeepalivePop();
8711
+ return func();
8712
+ },
8713
+ handleSleep(startAsync) {
8714
+ if (ABORT) return;
8715
+ if (Asyncify.state === Asyncify.State.Normal) {
8716
+ // Prepare to sleep. Call startAsync, and see what happens:
8717
+ // if the code decided to call our callback synchronously,
8718
+ // then no async operation was in fact begun, and we don't
8719
+ // need to do anything.
8720
+ var reachedCallback = false;
8721
+ var reachedAfterCallback = false;
8722
+ startAsync((handleSleepReturnValue = 0) => {
8723
+ if (ABORT) return;
8724
+ Asyncify.handleSleepReturnValue = handleSleepReturnValue;
8725
+ reachedCallback = true;
8726
+ if (!reachedAfterCallback) {
8727
+ // We are happening synchronously, so no need for async.
8728
+ return;
8729
+ }
8730
+ Asyncify.state = Asyncify.State.Rewinding;
8731
+ runAndAbortIfError(() =>
8732
+ _asyncify_start_rewind(Asyncify.currData)
8733
+ );
8734
+ if (typeof MainLoop != 'undefined' && MainLoop.func) {
8735
+ MainLoop.resume();
8736
+ }
8737
+ var asyncWasmReturnValue,
8738
+ isError = false;
8739
+ try {
8740
+ asyncWasmReturnValue = Asyncify.doRewind(
8741
+ Asyncify.currData
8742
+ );
8743
+ } catch (err) {
8744
+ asyncWasmReturnValue = err;
8745
+ isError = true;
8746
+ }
8747
+ // Track whether the return value was handled by any promise handlers.
8748
+ var handled = false;
8749
+ if (!Asyncify.currData) {
8750
+ // All asynchronous execution has finished.
8751
+ // `asyncWasmReturnValue` now contains the final
8752
+ // return value of the exported async WASM function.
8753
+ // Note: `asyncWasmReturnValue` is distinct from
8754
+ // `Asyncify.handleSleepReturnValue`.
8755
+ // `Asyncify.handleSleepReturnValue` contains the return
8756
+ // value of the last C function to have executed
8757
+ // `Asyncify.handleSleep()`, where as `asyncWasmReturnValue`
8758
+ // contains the return value of the exported WASM function
8759
+ // that may have called C functions that
8760
+ // call `Asyncify.handleSleep()`.
8761
+ var asyncPromiseHandlers =
8762
+ Asyncify.asyncPromiseHandlers;
8763
+ if (asyncPromiseHandlers) {
8764
+ Asyncify.asyncPromiseHandlers = null;
8765
+ (isError
8766
+ ? asyncPromiseHandlers.reject
8767
+ : asyncPromiseHandlers.resolve)(
8768
+ asyncWasmReturnValue
8769
+ );
8770
+ handled = true;
8771
+ }
8772
+ }
8773
+ if (isError && !handled) {
8774
+ // If there was an error and it was not handled by now, we have no choice but to
8775
+ // rethrow that error into the global scope where it can be caught only by
8776
+ // `onerror` or `onunhandledpromiserejection`.
8777
+ throw asyncWasmReturnValue;
8778
+ }
8779
+ });
8780
+ reachedAfterCallback = true;
8781
+ if (!reachedCallback) {
8782
+ // A true async operation was begun; start a sleep.
8783
+ Asyncify.state = Asyncify.State.Unwinding;
8784
+ // TODO: reuse, don't alloc/free every sleep
8785
+ if (!Asyncify._cachedData) {
8786
+ Asyncify._cachedData = Asyncify.allocateData();
8787
+ } else {
8788
+ Asyncify.setDataHeader(
8789
+ Asyncify._cachedData,
8790
+ Asyncify._cachedData + 12,
8791
+ Asyncify.StackSize
8792
+ );
8793
+ Asyncify.setDataRewindFunc(Asyncify._cachedData);
8794
+ }
8795
+ Asyncify.currData = Asyncify._cachedData;
8796
+ if (typeof MainLoop != 'undefined' && MainLoop.func) {
8797
+ MainLoop.pause();
8798
+ }
8799
+ runAndAbortIfError(() =>
8800
+ _asyncify_start_unwind(Asyncify.currData)
8801
+ );
8802
+ }
8803
+ } else if (Asyncify.state === Asyncify.State.Rewinding) {
8804
+ // Stop a resume.
8805
+ Asyncify.state = Asyncify.State.Normal;
8806
+ runAndAbortIfError(_asyncify_stop_rewind);
8807
+ Asyncify.currData = null;
8808
+ // Call all sleep callbacks now that the sleep-resume is all done.
8809
+ Asyncify.sleepCallbacks.forEach(callUserCallback);
8810
+ } else {
8811
+ abort(`invalid state: ${Asyncify.state}`);
8812
+ }
8813
+ return Asyncify.handleSleepReturnValue;
8814
+ },
8815
+ handleAsync: (startAsync) =>
8816
+ Asyncify.handleSleep((wakeUp) => {
8817
+ // TODO: add error handling as a second param when handleSleep implements it.
8818
+ startAsync().then(wakeUp);
8819
+ }),
8820
+ };
8821
+
8578
8822
  /** @param {number=} timeout */ var safeSetTimeout = (func, timeout) => {
8579
8823
  runtimeKeepalivePush();
8580
8824
  return setTimeout(() => {
@@ -8583,8 +8827,22 @@ export function init(RuntimeName, PHPLoader) {
8583
8827
  }, timeout);
8584
8828
  };
8585
8829
 
8586
- var _emscripten_sleep = (ms) =>
8587
- Asyncify.handleSleep((wakeUp) => safeSetTimeout(wakeUp, ms));
8830
+ var _emscripten_sleep = function (ms) {
8831
+ return Asyncify.handleSleep((wakeUp) => {
8832
+ // select() yields between socket reads. Nested zero-delay timers are
8833
+ // clamped by browsers, adding seconds to even a local curl download.
8834
+ // Use a task (not a microtask) so network events still get a turn.
8835
+ if (ms === 0 && globalThis.scheduler?.postTask) {
8836
+ runtimeKeepalivePush();
8837
+ globalThis.scheduler.postTask(() => {
8838
+ runtimeKeepalivePop();
8839
+ callUserCallback(wakeUp);
8840
+ });
8841
+ } else {
8842
+ safeSetTimeout(wakeUp, ms);
8843
+ }
8844
+ });
8845
+ };
8588
8846
 
8589
8847
  _emscripten_sleep.sig = 'vi';
8590
8848
 
@@ -9789,400 +10047,156 @@ export function init(RuntimeName, PHPLoader) {
9789
10047
  } else if ((value = getMatch('W'))) {
9790
10048
  // ... and week number (Monday being first day of week)
9791
10049
  // Week number of the year (Monday as the first day of the week) as a decimal number [00,53].
9792
- // All days in a new year preceding the first Monday are considered to be in week 0.
9793
- var weekDayNumber = DAY_NUMBERS_MON_FIRST[weekDay];
9794
- var weekNumber = Number(value);
9795
- // January 1st
9796
- var janFirst = new Date(date.year, 0, 1);
9797
- var endDate;
9798
- if (janFirst.getDay() === 1) {
9799
- // Jan 1st is a Monday, and, hence in the 1st CW
9800
- endDate = addDays(
9801
- janFirst,
9802
- weekDayNumber + 7 * (weekNumber - 1)
9803
- );
9804
- } else {
9805
- // Jan 1st is not a Monday, and, hence still in the 0th CW
9806
- endDate = addDays(
9807
- janFirst,
9808
- 7 -
9809
- janFirst.getDay() +
9810
- 1 +
9811
- weekDayNumber +
9812
- 7 * (weekNumber - 1)
9813
- );
9814
- }
9815
- date.day = endDate.getDate();
9816
- date.month = endDate.getMonth();
9817
- }
9818
- }
9819
- // time zone
9820
- if ((value = getMatch('z'))) {
9821
- // GMT offset as either 'Z' or +-HH:MM or +-HH or +-HHMM
9822
- if (value.toLowerCase() === 'z') {
9823
- date.gmtoff = 0;
9824
- } else {
9825
- var match = value.match(/^((?:\-|\+)\d\d):?(\d\d)?/);
9826
- date.gmtoff = match[1] * 3600;
9827
- if (match[2]) {
9828
- date.gmtoff +=
9829
- date.gmtoff > 0 ? match[2] * 60 : -match[2] * 60;
9830
- }
9831
- }
9832
- }
9833
- /*
9834
- tm_sec int seconds after the minute 0-61*
9835
- tm_min int minutes after the hour 0-59
9836
- tm_hour int hours since midnight 0-23
9837
- tm_mday int day of the month 1-31
9838
- tm_mon int months since January 0-11
9839
- tm_year int years since 1900
9840
- tm_wday int days since Sunday 0-6
9841
- tm_yday int days since January 1 0-365
9842
- tm_isdst int Daylight Saving Time flag
9843
- tm_gmtoff long offset from GMT (seconds)
9844
- */ var fullDate = new Date(
9845
- date.year,
9846
- date.month,
9847
- date.day,
9848
- date.hour,
9849
- date.min,
9850
- date.sec,
9851
- 0
9852
- );
9853
- HEAP32[tm >> 2] = fullDate.getSeconds();
9854
- HEAP32[(tm + 4) >> 2] = fullDate.getMinutes();
9855
- HEAP32[(tm + 8) >> 2] = fullDate.getHours();
9856
- HEAP32[(tm + 12) >> 2] = fullDate.getDate();
9857
- HEAP32[(tm + 16) >> 2] = fullDate.getMonth();
9858
- HEAP32[(tm + 20) >> 2] = fullDate.getFullYear() - 1900;
9859
- HEAP32[(tm + 24) >> 2] = fullDate.getDay();
9860
- HEAP32[(tm + 28) >> 2] =
9861
- arraySum(
9862
- isLeapYear(fullDate.getFullYear())
9863
- ? MONTH_DAYS_LEAP
9864
- : MONTH_DAYS_REGULAR,
9865
- fullDate.getMonth() - 1
9866
- ) +
9867
- fullDate.getDate() -
9868
- 1;
9869
- HEAP32[(tm + 32) >> 2] = 0;
9870
- HEAP32[(tm + 36) >> 2] = date.gmtoff;
9871
- // we need to convert the matched sequence into an integer array to take care of UTF-8 characters > 0x7F
9872
- // TODO: not sure that intArrayFromString handles all unicode characters correctly
9873
- return buf + lengthBytesUTF8(matches[0]);
9874
- }
9875
- return 0;
9876
- };
9877
-
9878
- _strptime.sig = 'pppp';
9879
-
9880
- var _swapcontext = () => abort('missing function: ${name}');
9881
-
9882
- function _wasm_close(socketd) {
9883
- return PHPWASM.shutdownSocket(socketd, 2);
9884
- }
9885
-
9886
- function _wasm_setsockopt(
9887
- socketd,
9888
- level,
9889
- optionName,
9890
- optionValuePtr,
9891
- optionLen
9892
- ) {
9893
- const optionValue = HEAPU8[optionValuePtr];
9894
- const SOL_SOCKET = 1;
9895
- const SO_KEEPALIVE = 9;
9896
- const SO_RCVTIMEO = 66;
9897
- const SO_SNDTIMEO = 67;
9898
- const IPPROTO_TCP = 6;
9899
- const TCP_NODELAY = 1;
9900
- if (
9901
- level === SOL_SOCKET &&
9902
- (optionName === SO_RCVTIMEO || optionName === SO_SNDTIMEO)
9903
- ) {
9904
- const timeoutMs = PHPWASM.parseSocketTimeout(
9905
- optionValuePtr,
9906
- optionLen
9907
- );
9908
- if (timeoutMs === null) {
9909
- return -1;
9910
- }
9911
- const timeouts = PHPWASM.socketTimeouts.get(socketd) || {};
9912
- if (optionName === SO_RCVTIMEO) {
9913
- timeouts.receive = timeoutMs;
9914
- } else {
9915
- timeouts.send = timeoutMs;
9916
- }
9917
- PHPWASM.socketTimeouts.set(socketd, timeouts);
9918
- return 0;
9919
- }
9920
- // Options that we can forward to the WebSocket proxy
9921
- const isForwardable =
9922
- (level === SOL_SOCKET && optionName === SO_KEEPALIVE) ||
9923
- (level === IPPROTO_TCP && optionName === TCP_NODELAY);
9924
- if (!isForwardable) {
9925
- console.warn(
9926
- `Unsupported socket option: ${level}, ${optionName}, ${optionValue}`
9927
- );
9928
- return -1;
9929
- }
9930
- const ws = PHPWASM.getAllWebSockets(socketd)[0];
9931
- if (!ws) {
9932
- return -1;
9933
- }
9934
- ws.setSocketOpt(level, optionName, optionValuePtr);
9935
- return 0;
9936
- }
9937
-
9938
- function _wasm_shutdown(socketd, how) {
9939
- return PHPWASM.shutdownSocket(socketd, how);
9940
- }
9941
-
9942
- var runAndAbortIfError = (func) => {
9943
- try {
9944
- return func();
9945
- } catch (e) {
9946
- abort(e);
9947
- }
9948
- };
9949
-
9950
- var Asyncify = {
9951
- instrumentWasmImports(imports) {
9952
- var importPattern =
9953
- /^(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__.*)$/;
9954
- for (let [x, original] of Object.entries(imports)) {
9955
- if (typeof original == 'function') {
9956
- let isAsyncifyImport =
9957
- original.isAsync || importPattern.test(x);
9958
- }
9959
- }
9960
- },
9961
- instrumentFunction(original) {
9962
- var wrapper = (...args) => {
9963
- Asyncify.exportCallStack.push(original);
9964
- try {
9965
- return original(...args);
9966
- } finally {
9967
- if (!ABORT) {
9968
- var top = Asyncify.exportCallStack.pop();
9969
- Asyncify.maybeStopUnwind();
9970
- }
9971
- }
9972
- };
9973
- Asyncify.funcWrappers.set(original, wrapper);
9974
- wrapper.orig = original;
9975
- return wrapper;
9976
- },
9977
- instrumentWasmExports(exports) {
9978
- var ret = {};
9979
- for (let [x, original] of Object.entries(exports)) {
9980
- if (typeof original == 'function') {
9981
- var wrapper = Asyncify.instrumentFunction(original);
9982
- ret[x] = wrapper;
9983
- } else {
9984
- ret[x] = original;
9985
- }
9986
- }
9987
- return ret;
9988
- },
9989
- State: {
9990
- Normal: 0,
9991
- Unwinding: 1,
9992
- Rewinding: 2,
9993
- Disabled: 3,
9994
- },
9995
- state: 0,
9996
- StackSize: 4096,
9997
- currData: null,
9998
- handleSleepReturnValue: 0,
9999
- exportCallStack: [],
10000
- callstackFuncToId: new Map(),
10001
- callStackIdToFunc: new Map(),
10002
- funcWrappers: new Map(),
10003
- callStackId: 0,
10004
- asyncPromiseHandlers: null,
10005
- sleepCallbacks: [],
10006
- getCallStackId(func) {
10007
- if (!Asyncify.callstackFuncToId.has(func)) {
10008
- var id = Asyncify.callStackId++;
10009
- Asyncify.callstackFuncToId.set(func, id);
10010
- Asyncify.callStackIdToFunc.set(id, func);
10011
- }
10012
- return Asyncify.callstackFuncToId.get(func);
10013
- },
10014
- maybeStopUnwind() {
10015
- if (
10016
- Asyncify.currData &&
10017
- Asyncify.state === Asyncify.State.Unwinding &&
10018
- Asyncify.exportCallStack.length === 0
10019
- ) {
10020
- // We just finished unwinding.
10021
- // Be sure to set the state before calling any other functions to avoid
10022
- // possible infinite recursion here (For example in debug pthread builds
10023
- // the dbg() function itself can call back into WebAssembly to get the
10024
- // current pthread_self() pointer).
10025
- Asyncify.state = Asyncify.State.Normal;
10026
- runtimeKeepalivePush();
10027
- // Keep the runtime alive so that a re-wind can be done later.
10028
- runAndAbortIfError(_asyncify_stop_unwind);
10029
- if (typeof Fibers != 'undefined') {
10030
- Fibers.trampoline();
10031
- }
10032
- }
10033
- },
10034
- whenDone() {
10035
- return new Promise((resolve, reject) => {
10036
- Asyncify.asyncPromiseHandlers = {
10037
- resolve,
10038
- reject,
10039
- };
10040
- });
10041
- },
10042
- allocateData() {
10043
- // An asyncify data structure has three fields:
10044
- // 0 current stack pos
10045
- // 4 max stack pos
10046
- // 8 id of function at bottom of the call stack (callStackIdToFunc[id] == wasm func)
10047
- // The Asyncify ABI only interprets the first two fields, the rest is for the runtime.
10048
- // We also embed a stack in the same memory region here, right next to the structure.
10049
- // This struct is also defined as asyncify_data_t in emscripten/fiber.h
10050
- var ptr = _malloc(12 + Asyncify.StackSize);
10051
- Asyncify.setDataHeader(ptr, ptr + 12, Asyncify.StackSize);
10052
- Asyncify.setDataRewindFunc(ptr);
10053
- return ptr;
10054
- },
10055
- setDataHeader(ptr, stack, stackSize) {
10056
- HEAPU32[ptr >> 2] = stack;
10057
- HEAPU32[(ptr + 4) >> 2] = stack + stackSize;
10058
- },
10059
- setDataRewindFunc(ptr) {
10060
- var bottomOfCallStack = Asyncify.exportCallStack[0];
10061
- var rewindId = Asyncify.getCallStackId(bottomOfCallStack);
10062
- HEAP32[(ptr + 8) >> 2] = rewindId;
10063
- },
10064
- getDataRewindFunc(ptr) {
10065
- var id = HEAP32[(ptr + 8) >> 2];
10066
- var func = Asyncify.callStackIdToFunc.get(id);
10067
- return func;
10068
- },
10069
- doRewind(ptr) {
10070
- var original = Asyncify.getDataRewindFunc(ptr);
10071
- var func = Asyncify.funcWrappers.get(original);
10072
- // Once we have rewound and the stack we no longer need to artificially
10073
- // keep the runtime alive.
10074
- runtimeKeepalivePop();
10075
- return func();
10076
- },
10077
- handleSleep(startAsync) {
10078
- if (ABORT) return;
10079
- if (Asyncify.state === Asyncify.State.Normal) {
10080
- // Prepare to sleep. Call startAsync, and see what happens:
10081
- // if the code decided to call our callback synchronously,
10082
- // then no async operation was in fact begun, and we don't
10083
- // need to do anything.
10084
- var reachedCallback = false;
10085
- var reachedAfterCallback = false;
10086
- startAsync((handleSleepReturnValue = 0) => {
10087
- if (ABORT) return;
10088
- Asyncify.handleSleepReturnValue = handleSleepReturnValue;
10089
- reachedCallback = true;
10090
- if (!reachedAfterCallback) {
10091
- // We are happening synchronously, so no need for async.
10092
- return;
10093
- }
10094
- Asyncify.state = Asyncify.State.Rewinding;
10095
- runAndAbortIfError(() =>
10096
- _asyncify_start_rewind(Asyncify.currData)
10097
- );
10098
- if (typeof MainLoop != 'undefined' && MainLoop.func) {
10099
- MainLoop.resume();
10100
- }
10101
- var asyncWasmReturnValue,
10102
- isError = false;
10103
- try {
10104
- asyncWasmReturnValue = Asyncify.doRewind(
10105
- Asyncify.currData
10106
- );
10107
- } catch (err) {
10108
- asyncWasmReturnValue = err;
10109
- isError = true;
10110
- }
10111
- // Track whether the return value was handled by any promise handlers.
10112
- var handled = false;
10113
- if (!Asyncify.currData) {
10114
- // All asynchronous execution has finished.
10115
- // `asyncWasmReturnValue` now contains the final
10116
- // return value of the exported async WASM function.
10117
- // Note: `asyncWasmReturnValue` is distinct from
10118
- // `Asyncify.handleSleepReturnValue`.
10119
- // `Asyncify.handleSleepReturnValue` contains the return
10120
- // value of the last C function to have executed
10121
- // `Asyncify.handleSleep()`, where as `asyncWasmReturnValue`
10122
- // contains the return value of the exported WASM function
10123
- // that may have called C functions that
10124
- // call `Asyncify.handleSleep()`.
10125
- var asyncPromiseHandlers =
10126
- Asyncify.asyncPromiseHandlers;
10127
- if (asyncPromiseHandlers) {
10128
- Asyncify.asyncPromiseHandlers = null;
10129
- (isError
10130
- ? asyncPromiseHandlers.reject
10131
- : asyncPromiseHandlers.resolve)(
10132
- asyncWasmReturnValue
10133
- );
10134
- handled = true;
10135
- }
10136
- }
10137
- if (isError && !handled) {
10138
- // If there was an error and it was not handled by now, we have no choice but to
10139
- // rethrow that error into the global scope where it can be caught only by
10140
- // `onerror` or `onunhandledpromiserejection`.
10141
- throw asyncWasmReturnValue;
10142
- }
10143
- });
10144
- reachedAfterCallback = true;
10145
- if (!reachedCallback) {
10146
- // A true async operation was begun; start a sleep.
10147
- Asyncify.state = Asyncify.State.Unwinding;
10148
- // TODO: reuse, don't alloc/free every sleep
10149
- if (!Asyncify._cachedData) {
10150
- Asyncify._cachedData = Asyncify.allocateData();
10050
+ // All days in a new year preceding the first Monday are considered to be in week 0.
10051
+ var weekDayNumber = DAY_NUMBERS_MON_FIRST[weekDay];
10052
+ var weekNumber = Number(value);
10053
+ // January 1st
10054
+ var janFirst = new Date(date.year, 0, 1);
10055
+ var endDate;
10056
+ if (janFirst.getDay() === 1) {
10057
+ // Jan 1st is a Monday, and, hence in the 1st CW
10058
+ endDate = addDays(
10059
+ janFirst,
10060
+ weekDayNumber + 7 * (weekNumber - 1)
10061
+ );
10151
10062
  } else {
10152
- Asyncify.setDataHeader(
10153
- Asyncify._cachedData,
10154
- Asyncify._cachedData + 12,
10155
- Asyncify.StackSize
10063
+ // Jan 1st is not a Monday, and, hence still in the 0th CW
10064
+ endDate = addDays(
10065
+ janFirst,
10066
+ 7 -
10067
+ janFirst.getDay() +
10068
+ 1 +
10069
+ weekDayNumber +
10070
+ 7 * (weekNumber - 1)
10156
10071
  );
10157
- Asyncify.setDataRewindFunc(Asyncify._cachedData);
10158
10072
  }
10159
- Asyncify.currData = Asyncify._cachedData;
10160
- if (typeof MainLoop != 'undefined' && MainLoop.func) {
10161
- MainLoop.pause();
10073
+ date.day = endDate.getDate();
10074
+ date.month = endDate.getMonth();
10075
+ }
10076
+ }
10077
+ // time zone
10078
+ if ((value = getMatch('z'))) {
10079
+ // GMT offset as either 'Z' or +-HH:MM or +-HH or +-HHMM
10080
+ if (value.toLowerCase() === 'z') {
10081
+ date.gmtoff = 0;
10082
+ } else {
10083
+ var match = value.match(/^((?:\-|\+)\d\d):?(\d\d)?/);
10084
+ date.gmtoff = match[1] * 3600;
10085
+ if (match[2]) {
10086
+ date.gmtoff +=
10087
+ date.gmtoff > 0 ? match[2] * 60 : -match[2] * 60;
10162
10088
  }
10163
- runAndAbortIfError(() =>
10164
- _asyncify_start_unwind(Asyncify.currData)
10165
- );
10166
10089
  }
10167
- } else if (Asyncify.state === Asyncify.State.Rewinding) {
10168
- // Stop a resume.
10169
- Asyncify.state = Asyncify.State.Normal;
10170
- runAndAbortIfError(_asyncify_stop_rewind);
10171
- Asyncify.currData = null;
10172
- // Call all sleep callbacks now that the sleep-resume is all done.
10173
- Asyncify.sleepCallbacks.forEach(callUserCallback);
10174
- } else {
10175
- abort(`invalid state: ${Asyncify.state}`);
10176
10090
  }
10177
- return Asyncify.handleSleepReturnValue;
10178
- },
10179
- handleAsync: (startAsync) =>
10180
- Asyncify.handleSleep((wakeUp) => {
10181
- // TODO: add error handling as a second param when handleSleep implements it.
10182
- startAsync().then(wakeUp);
10183
- }),
10091
+ /*
10092
+ tm_sec int seconds after the minute 0-61*
10093
+ tm_min int minutes after the hour 0-59
10094
+ tm_hour int hours since midnight 0-23
10095
+ tm_mday int day of the month 1-31
10096
+ tm_mon int months since January 0-11
10097
+ tm_year int years since 1900
10098
+ tm_wday int days since Sunday 0-6
10099
+ tm_yday int days since January 1 0-365
10100
+ tm_isdst int Daylight Saving Time flag
10101
+ tm_gmtoff long offset from GMT (seconds)
10102
+ */ var fullDate = new Date(
10103
+ date.year,
10104
+ date.month,
10105
+ date.day,
10106
+ date.hour,
10107
+ date.min,
10108
+ date.sec,
10109
+ 0
10110
+ );
10111
+ HEAP32[tm >> 2] = fullDate.getSeconds();
10112
+ HEAP32[(tm + 4) >> 2] = fullDate.getMinutes();
10113
+ HEAP32[(tm + 8) >> 2] = fullDate.getHours();
10114
+ HEAP32[(tm + 12) >> 2] = fullDate.getDate();
10115
+ HEAP32[(tm + 16) >> 2] = fullDate.getMonth();
10116
+ HEAP32[(tm + 20) >> 2] = fullDate.getFullYear() - 1900;
10117
+ HEAP32[(tm + 24) >> 2] = fullDate.getDay();
10118
+ HEAP32[(tm + 28) >> 2] =
10119
+ arraySum(
10120
+ isLeapYear(fullDate.getFullYear())
10121
+ ? MONTH_DAYS_LEAP
10122
+ : MONTH_DAYS_REGULAR,
10123
+ fullDate.getMonth() - 1
10124
+ ) +
10125
+ fullDate.getDate() -
10126
+ 1;
10127
+ HEAP32[(tm + 32) >> 2] = 0;
10128
+ HEAP32[(tm + 36) >> 2] = date.gmtoff;
10129
+ // we need to convert the matched sequence into an integer array to take care of UTF-8 characters > 0x7F
10130
+ // TODO: not sure that intArrayFromString handles all unicode characters correctly
10131
+ return buf + lengthBytesUTF8(matches[0]);
10132
+ }
10133
+ return 0;
10184
10134
  };
10185
10135
 
10136
+ _strptime.sig = 'pppp';
10137
+
10138
+ var _swapcontext = () => abort('missing function: ${name}');
10139
+
10140
+ function _wasm_close(socketd) {
10141
+ return PHPWASM.shutdownSocket(socketd, 2);
10142
+ }
10143
+
10144
+ function _wasm_setsockopt(
10145
+ socketd,
10146
+ level,
10147
+ optionName,
10148
+ optionValuePtr,
10149
+ optionLen
10150
+ ) {
10151
+ const optionValue = HEAPU8[optionValuePtr];
10152
+ const SOL_SOCKET = 1;
10153
+ const SO_KEEPALIVE = 9;
10154
+ const SO_RCVTIMEO = 66;
10155
+ const SO_SNDTIMEO = 67;
10156
+ const IPPROTO_TCP = 6;
10157
+ const TCP_NODELAY = 1;
10158
+ if (
10159
+ level === SOL_SOCKET &&
10160
+ (optionName === SO_RCVTIMEO || optionName === SO_SNDTIMEO)
10161
+ ) {
10162
+ const timeoutMs = PHPWASM.parseSocketTimeout(
10163
+ optionValuePtr,
10164
+ optionLen
10165
+ );
10166
+ if (timeoutMs === null) {
10167
+ return -1;
10168
+ }
10169
+ const timeouts = PHPWASM.socketTimeouts.get(socketd) || {};
10170
+ if (optionName === SO_RCVTIMEO) {
10171
+ timeouts.receive = timeoutMs;
10172
+ } else {
10173
+ timeouts.send = timeoutMs;
10174
+ }
10175
+ PHPWASM.socketTimeouts.set(socketd, timeouts);
10176
+ return 0;
10177
+ }
10178
+ // Options that we can forward to the WebSocket proxy
10179
+ const isForwardable =
10180
+ (level === SOL_SOCKET && optionName === SO_KEEPALIVE) ||
10181
+ (level === IPPROTO_TCP && optionName === TCP_NODELAY);
10182
+ if (!isForwardable) {
10183
+ console.warn(
10184
+ `Unsupported socket option: ${level}, ${optionName}, ${optionValue}`
10185
+ );
10186
+ return -1;
10187
+ }
10188
+ const ws = PHPWASM.getAllWebSockets(socketd)[0];
10189
+ if (!ws) {
10190
+ return -1;
10191
+ }
10192
+ ws.setSocketOpt(level, optionName, optionValuePtr);
10193
+ return 0;
10194
+ }
10195
+
10196
+ function _wasm_shutdown(socketd, how) {
10197
+ return PHPWASM.shutdownSocket(socketd, how);
10198
+ }
10199
+
10186
10200
  var getCFunc = (ident) => {
10187
10201
  var func = Module['_' + ident];
10188
10202
  // closure exported function
@@ -10755,6 +10769,7 @@ export function init(RuntimeName, PHPLoader) {
10755
10769
  __php_stream_eof,
10756
10770
  __php_stream_get_line,
10757
10771
  __php_stream_open_wrapper_ex,
10772
+ __efree,
10758
10773
  __emalloc_24,
10759
10774
  __emalloc_32,
10760
10775
  __emalloc_40,
@@ -10766,7 +10781,6 @@ export function init(RuntimeName, PHPLoader) {
10766
10781
  __emalloc_1280,
10767
10782
  __efree_56,
10768
10783
  __emalloc,
10769
- __efree,
10770
10784
  __erealloc,
10771
10785
  __safe_emalloc,
10772
10786
  ___zend_malloc,
@@ -10941,29 +10955,28 @@ export function init(RuntimeName, PHPLoader) {
10941
10955
  _zend_observer_fiber_switch_register,
10942
10956
  _strtoll,
10943
10957
  _strlen,
10944
- _munmap,
10945
- _fiprintf,
10946
- _abort,
10947
- _free,
10948
10958
  _memcmp,
10949
- _malloc,
10950
- _snprintf,
10951
- _strchr,
10959
+ _free,
10960
+ _clock_gettime,
10952
10961
  _mmap,
10953
10962
  ___errno_location,
10954
10963
  _strerror,
10964
+ _munmap,
10955
10965
  _dlopen,
10966
+ _fiprintf,
10956
10967
  _dlsym,
10957
10968
  _dlclose,
10958
10969
  _strcmp,
10959
10970
  _getenv,
10960
10971
  _explicit_bzero,
10972
+ _malloc,
10961
10973
  ___wasm_setjmp,
10962
10974
  ___wasm_setjmp_test,
10963
10975
  _emscripten_longjmp,
10976
+ _snprintf,
10964
10977
  _atoi,
10978
+ _strchr,
10965
10979
  _strtoull,
10966
- _clock_gettime,
10967
10980
  _strrchr,
10968
10981
  _realloc,
10969
10982
  _strcasecmp,
@@ -11040,6 +11053,7 @@ export function init(RuntimeName, PHPLoader) {
11040
11053
  _qsort,
11041
11054
  _calloc,
11042
11055
  _vfprintf,
11056
+ _abort,
11043
11057
  _flock,
11044
11058
  _fgets,
11045
11059
  _initgroups,
@@ -11119,12 +11133,12 @@ export function init(RuntimeName, PHPLoader) {
11119
11133
  ___cxa_can_catch,
11120
11134
  __ZNSt20bad_array_new_lengthD1Ev,
11121
11135
  __ZNSt12length_errorD1Ev,
11122
- dynCall_iiii,
11123
- dynCall_ii,
11124
- dynCall_vi,
11125
11136
  dynCall_vii,
11137
+ dynCall_vi,
11126
11138
  dynCall_viiiii,
11127
11139
  dynCall_iii,
11140
+ dynCall_iiii,
11141
+ dynCall_ii,
11128
11142
  dynCall_iiiii,
11129
11143
  dynCall_iiiiii,
11130
11144
  dynCall_viii,
@@ -11164,6 +11178,7 @@ export function init(RuntimeName, PHPLoader) {
11164
11178
  dynCall_viiij,
11165
11179
  dynCall_viiiiiiiii,
11166
11180
  dynCall_vidi,
11181
+ dynCall_vj,
11167
11182
  dynCall_viijii,
11168
11183
  dynCall_viidii,
11169
11184
  dynCall_jiiji,
@@ -11276,6 +11291,7 @@ export function init(RuntimeName, PHPLoader) {
11276
11291
  wasmExports['_php_stream_get_line'];
11277
11292
  __php_stream_open_wrapper_ex = Module['__php_stream_open_wrapper_ex'] =
11278
11293
  wasmExports['_php_stream_open_wrapper_ex'];
11294
+ __efree = Module['__efree'] = wasmExports['_efree'];
11279
11295
  __emalloc_24 = Module['__emalloc_24'] = wasmExports['_emalloc_24'];
11280
11296
  __emalloc_32 = Module['__emalloc_32'] = wasmExports['_emalloc_32'];
11281
11297
  __emalloc_40 = Module['__emalloc_40'] = wasmExports['_emalloc_40'];
@@ -11288,7 +11304,6 @@ export function init(RuntimeName, PHPLoader) {
11288
11304
  wasmExports['_emalloc_1280'];
11289
11305
  __efree_56 = Module['__efree_56'] = wasmExports['_efree_56'];
11290
11306
  __emalloc = Module['__emalloc'] = wasmExports['_emalloc'];
11291
- __efree = Module['__efree'] = wasmExports['_efree'];
11292
11307
  __erealloc = Module['__erealloc'] = wasmExports['_erealloc'];
11293
11308
  __safe_emalloc = Module['__safe_emalloc'] =
11294
11309
  wasmExports['_safe_emalloc'];
@@ -11652,38 +11667,37 @@ export function init(RuntimeName, PHPLoader) {
11652
11667
  ] = wasmExports['zend_observer_fiber_switch_register'];
11653
11668
  _strtoll = Module['_strtoll'] = wasmExports['strtoll'];
11654
11669
  _strlen = Module['_strlen'] = wasmExports['strlen'];
11655
- _munmap = Module['_munmap'] = wasmExports['munmap'];
11656
- _fiprintf = Module['_fiprintf'] = wasmExports['fiprintf'];
11657
- _abort = Module['_abort'] = wasmExports['abort'];
11658
- _free = Module['_free'] = wasmExports['free'];
11659
11670
  _memcmp = Module['_memcmp'] = wasmExports['memcmp'];
11660
- _malloc =
11661
- PHPLoader['malloc'] =
11662
- Module['_malloc'] =
11663
- wasmExports['malloc'];
11664
- _snprintf = Module['_snprintf'] = wasmExports['snprintf'];
11665
- _strchr = Module['_strchr'] = wasmExports['strchr'];
11671
+ _free = Module['_free'] = wasmExports['free'];
11672
+ _clock_gettime = Module['_clock_gettime'] =
11673
+ wasmExports['clock_gettime'];
11666
11674
  _mmap = Module['_mmap'] = wasmExports['mmap'];
11667
11675
  ___errno_location = Module['___errno_location'] =
11668
11676
  wasmExports['__errno_location'];
11669
11677
  _strerror = Module['_strerror'] = wasmExports['strerror'];
11678
+ _munmap = Module['_munmap'] = wasmExports['munmap'];
11670
11679
  _dlopen = Module['_dlopen'] = wasmExports['dlopen'];
11680
+ _fiprintf = Module['_fiprintf'] = wasmExports['fiprintf'];
11671
11681
  _dlsym = Module['_dlsym'] = wasmExports['dlsym'];
11672
11682
  _dlclose = Module['_dlclose'] = wasmExports['dlclose'];
11673
11683
  _strcmp = Module['_strcmp'] = wasmExports['strcmp'];
11674
11684
  _getenv = Module['_getenv'] = wasmExports['getenv'];
11675
11685
  _explicit_bzero = Module['_explicit_bzero'] =
11676
11686
  wasmExports['explicit_bzero'];
11687
+ _malloc =
11688
+ PHPLoader['malloc'] =
11689
+ Module['_malloc'] =
11690
+ wasmExports['malloc'];
11677
11691
  ___wasm_setjmp = Module['___wasm_setjmp'] =
11678
11692
  wasmExports['__wasm_setjmp'];
11679
11693
  ___wasm_setjmp_test = Module['___wasm_setjmp_test'] =
11680
11694
  wasmExports['__wasm_setjmp_test'];
11681
11695
  _emscripten_longjmp = Module['_emscripten_longjmp'] =
11682
11696
  wasmExports['emscripten_longjmp'];
11697
+ _snprintf = Module['_snprintf'] = wasmExports['snprintf'];
11683
11698
  _atoi = Module['_atoi'] = wasmExports['atoi'];
11699
+ _strchr = Module['_strchr'] = wasmExports['strchr'];
11684
11700
  _strtoull = Module['_strtoull'] = wasmExports['strtoull'];
11685
- _clock_gettime = Module['_clock_gettime'] =
11686
- wasmExports['clock_gettime'];
11687
11701
  _strrchr = Module['_strrchr'] = wasmExports['strrchr'];
11688
11702
  _realloc = Module['_realloc'] = wasmExports['realloc'];
11689
11703
  _strcasecmp = Module['_strcasecmp'] = wasmExports['strcasecmp'];
@@ -11763,6 +11777,7 @@ export function init(RuntimeName, PHPLoader) {
11763
11777
  _qsort = Module['_qsort'] = wasmExports['qsort'];
11764
11778
  _calloc = Module['_calloc'] = wasmExports['calloc'];
11765
11779
  _vfprintf = Module['_vfprintf'] = wasmExports['vfprintf'];
11780
+ _abort = Module['_abort'] = wasmExports['abort'];
11766
11781
  _flock = Module['_flock'] = wasmExports['flock'];
11767
11782
  _fgets = Module['_fgets'] = wasmExports['fgets'];
11768
11783
  _initgroups = Module['_initgroups'] = wasmExports['initgroups'];
@@ -11889,12 +11904,12 @@ export function init(RuntimeName, PHPLoader) {
11889
11904
  ] = wasmExports['_ZNSt20bad_array_new_lengthD1Ev'];
11890
11905
  __ZNSt12length_errorD1Ev = Module['__ZNSt12length_errorD1Ev'] =
11891
11906
  wasmExports['_ZNSt12length_errorD1Ev'];
11892
- dynCall_iiii = dynCalls['iiii'] = wasmExports['dynCall_iiii'];
11893
- dynCall_ii = dynCalls['ii'] = wasmExports['dynCall_ii'];
11894
- dynCall_vi = dynCalls['vi'] = wasmExports['dynCall_vi'];
11895
11907
  dynCall_vii = dynCalls['vii'] = wasmExports['dynCall_vii'];
11908
+ dynCall_vi = dynCalls['vi'] = wasmExports['dynCall_vi'];
11896
11909
  dynCall_viiiii = dynCalls['viiiii'] = wasmExports['dynCall_viiiii'];
11897
11910
  dynCall_iii = dynCalls['iii'] = wasmExports['dynCall_iii'];
11911
+ dynCall_iiii = dynCalls['iiii'] = wasmExports['dynCall_iiii'];
11912
+ dynCall_ii = dynCalls['ii'] = wasmExports['dynCall_ii'];
11898
11913
  dynCall_iiiii = dynCalls['iiiii'] = wasmExports['dynCall_iiiii'];
11899
11914
  dynCall_iiiiii = dynCalls['iiiiii'] = wasmExports['dynCall_iiiiii'];
11900
11915
  dynCall_viii = dynCalls['viii'] = wasmExports['dynCall_viii'];
@@ -11943,6 +11958,7 @@ export function init(RuntimeName, PHPLoader) {
11943
11958
  dynCall_viiiiiiiii = dynCalls['viiiiiiiii'] =
11944
11959
  wasmExports['dynCall_viiiiiiiii'];
11945
11960
  dynCall_vidi = dynCalls['vidi'] = wasmExports['dynCall_vidi'];
11961
+ dynCall_vj = dynCalls['vj'] = wasmExports['dynCall_vj'];
11946
11962
  dynCall_viijii = dynCalls['viijii'] = wasmExports['dynCall_viijii'];
11947
11963
  dynCall_viidii = dynCalls['viidii'] = wasmExports['dynCall_viidii'];
11948
11964
  dynCall_jiiji = dynCalls['jiiji'] = wasmExports['dynCall_jiiji'];
@@ -12003,108 +12019,108 @@ export function init(RuntimeName, PHPLoader) {
12003
12019
  wasmExports['__indirect_function_table'];
12004
12020
  }
12005
12021
 
12006
- var _core_globals = (Module['_core_globals'] = 13825392);
12022
+ var _core_globals = (Module['_core_globals'] = 13824560);
12007
12023
 
12008
- var _php_ini_opened_path = (Module['_php_ini_opened_path'] = 13718352);
12024
+ var _php_ini_opened_path = (Module['_php_ini_opened_path'] = 13717496);
12009
12025
 
12010
- var _php_ini_scanned_path = (Module['_php_ini_scanned_path'] = 13718356);
12026
+ var _php_ini_scanned_path = (Module['_php_ini_scanned_path'] = 13717500);
12011
12027
 
12012
- var _php_ini_scanned_files = (Module['_php_ini_scanned_files'] = 13718360);
12028
+ var _php_ini_scanned_files = (Module['_php_ini_scanned_files'] = 13717504);
12013
12029
 
12014
- var _sapi_module = (Module['_sapi_module'] = 13799544);
12030
+ var _sapi_module = (Module['_sapi_module'] = 13798696);
12015
12031
 
12016
- var _sapi_globals = (Module['_sapi_globals'] = 13799688);
12032
+ var _sapi_globals = (Module['_sapi_globals'] = 13798840);
12017
12033
 
12018
- var _compiler_globals = (Module['_compiler_globals'] = 13828688);
12034
+ var _compiler_globals = (Module['_compiler_globals'] = 13829256);
12019
12035
 
12020
- var _executor_globals = (Module['_executor_globals'] = 13829072);
12036
+ var _executor_globals = (Module['_executor_globals'] = 13829640);
12021
12037
 
12022
- var _zend_compile_file = (Module['_zend_compile_file'] = 13830376);
12038
+ var _zend_compile_file = (Module['_zend_compile_file'] = 13830960);
12023
12039
 
12024
- var _zend_execute_ex = (Module['_zend_execute_ex'] = 13828576);
12040
+ var _zend_execute_ex = (Module['_zend_execute_ex'] = 13829232);
12025
12041
 
12026
- var _zend_execute_internal = (Module['_zend_execute_internal'] = 13828580);
12042
+ var _zend_execute_internal = (Module['_zend_execute_internal'] = 13829236);
12027
12043
 
12028
- var _zend_write = (Module['_zend_write'] = 13828612);
12044
+ var _zend_write = (Module['_zend_write'] = 13828120);
12029
12045
 
12030
- var _zend_error_cb = (Module['_zend_error_cb'] = 13828616);
12046
+ var _zend_error_cb = (Module['_zend_error_cb'] = 13828124);
12031
12047
 
12032
- var _zend_post_startup_cb = (Module['_zend_post_startup_cb'] = 13828596);
12048
+ var _zend_post_startup_cb = (Module['_zend_post_startup_cb'] = 13828104);
12033
12049
 
12034
- var _module_registry = (Module['_module_registry'] = 13827448);
12050
+ var _module_registry = (Module['_module_registry'] = 13826616);
12035
12051
 
12036
- var _zend_extensions = (Module['_zend_extensions'] = 13826216);
12052
+ var _zend_extensions = (Module['_zend_extensions'] = 13825384);
12037
12053
 
12038
- var _zend_pass_function = (Module['_zend_pass_function'] = 13196088);
12054
+ var _zend_pass_function = (Module['_zend_pass_function'] = 13197284);
12039
12055
 
12040
- var _zend_ce_aggregate = (Module['_zend_ce_aggregate'] = 13713232);
12056
+ var _zend_ce_aggregate = (Module['_zend_ce_aggregate'] = 13712672);
12041
12057
 
12042
- var _zend_ce_iterator = (Module['_zend_ce_iterator'] = 13713236);
12058
+ var _zend_ce_iterator = (Module['_zend_ce_iterator'] = 13712676);
12043
12059
 
12044
- var _zend_ce_countable = (Module['_zend_ce_countable'] = 13713248);
12060
+ var _zend_ce_countable = (Module['_zend_ce_countable'] = 13712688);
12045
12061
 
12046
- var _zend_ce_exception = (Module['_zend_ce_exception'] = 13826592);
12062
+ var _zend_ce_exception = (Module['_zend_ce_exception'] = 13825760);
12047
12063
 
12048
- var _zend_ce_error = (Module['_zend_ce_error'] = 13826708);
12064
+ var _zend_ce_error = (Module['_zend_ce_error'] = 13825876);
12049
12065
 
12050
12066
  var _zend_throw_exception_hook = (Module['_zend_throw_exception_hook'] =
12051
- 13826584);
12067
+ 13825752);
12052
12068
 
12053
- var _zend_ce_throwable = (Module['_zend_ce_throwable'] = 13826588);
12069
+ var _zend_ce_throwable = (Module['_zend_ce_throwable'] = 13825756);
12054
12070
 
12055
- var _gc_collect_cycles = (Module['_gc_collect_cycles'] = 13713640);
12071
+ var _gc_collect_cycles = (Module['_gc_collect_cycles'] = 13826976);
12056
12072
 
12057
- var _zend_ce_closure = (Module['_zend_ce_closure'] = 13820044);
12073
+ var _zend_ce_closure = (Module['_zend_ce_closure'] = 13819196);
12058
12074
 
12059
- var _zend_empty_string = (Module['_zend_empty_string'] = 13711696);
12075
+ var _zend_empty_string = (Module['_zend_empty_string'] = 13826980);
12060
12076
 
12061
- var _zend_known_strings = (Module['_zend_known_strings'] = 13711700);
12077
+ var _zend_known_strings = (Module['_zend_known_strings'] = 13826984);
12062
12078
 
12063
12079
  var _zend_string_init_interned = (Module['_zend_string_init_interned'] =
12064
- 13711764);
12080
+ 13827052);
12065
12081
 
12066
- var _std_object_handlers = (Module['_std_object_handlers'] = 13210416);
12082
+ var _std_object_handlers = (Module['_std_object_handlers'] = 12791368);
12067
12083
 
12068
12084
  var ___memory_base = (Module['___memory_base'] = 0);
12069
12085
 
12070
12086
  var ___table_base = (Module['___table_base'] = 1);
12071
12087
 
12072
- var _stderr = (Module['_stderr'] = 13704880);
12088
+ var _stderr = (Module['_stderr'] = 13705424);
12073
12089
 
12074
- var ___THREW__ = (Module['___THREW__'] = 14178740);
12090
+ var ___THREW__ = (Module['___THREW__'] = 14179316);
12075
12091
 
12076
- var ___threwValue = (Module['___threwValue'] = 14178744);
12092
+ var ___threwValue = (Module['___threwValue'] = 14179320);
12077
12093
 
12078
- var _stdout = (Module['_stdout'] = 13705184);
12094
+ var _stdout = (Module['_stdout'] = 13705728);
12079
12095
 
12080
- var _timezone = (Module['_timezone'] = 14165664);
12096
+ var _timezone = (Module['_timezone'] = 14166240);
12081
12097
 
12082
- var _tzname = (Module['_tzname'] = 14165672);
12098
+ var _tzname = (Module['_tzname'] = 14166248);
12083
12099
 
12084
- var ___heap_base = 15227408;
12100
+ var ___heap_base = 15227984;
12085
12101
 
12086
12102
  var __ZNSt3__25ctypeIcE2idE = (Module['__ZNSt3__25ctypeIcE2idE'] =
12087
- 14178820);
12103
+ 14179396);
12088
12104
 
12089
12105
  var __ZTVN10__cxxabiv120__si_class_type_infoE = (Module[
12090
12106
  '__ZTVN10__cxxabiv120__si_class_type_infoE'
12091
- ] = 13705432);
12107
+ ] = 13705976);
12092
12108
 
12093
12109
  var __ZTVN10__cxxabiv117__class_type_infoE = (Module[
12094
12110
  '__ZTVN10__cxxabiv117__class_type_infoE'
12095
- ] = 13705392);
12111
+ ] = 13705936);
12096
12112
 
12097
12113
  var __ZTVN10__cxxabiv121__vmi_class_type_infoE = (Module[
12098
12114
  '__ZTVN10__cxxabiv121__vmi_class_type_infoE'
12099
- ] = 13705484);
12115
+ ] = 13706028);
12100
12116
 
12101
12117
  var __ZTISt20bad_array_new_length = (Module[
12102
12118
  '__ZTISt20bad_array_new_length'
12103
- ] = 13705556);
12119
+ ] = 13706100);
12104
12120
 
12105
- var __ZTVSt12length_error = (Module['__ZTVSt12length_error'] = 13705600);
12121
+ var __ZTVSt12length_error = (Module['__ZTVSt12length_error'] = 13706144);
12106
12122
 
12107
- var __ZTISt12length_error = (Module['__ZTISt12length_error'] = 13705620);
12123
+ var __ZTISt12length_error = (Module['__ZTISt12length_error'] = 13706164);
12108
12124
 
12109
12125
  var wasmImports = {
12110
12126
  /** @export */ __assert_fail: ___assert_fail,
@@ -12240,6 +12256,7 @@ export function init(RuntimeName, PHPLoader) {
12240
12256
  /** @export */ invoke_viijii,
12241
12257
  /** @export */ invoke_vij,
12242
12258
  /** @export */ invoke_vijj,
12259
+ /** @export */ invoke_vj,
12243
12260
  /** @export */ invoke_vji,
12244
12261
  /** @export */ js_fd_read,
12245
12262
  /** @export */ js_flock: _js_flock,
@@ -12464,21 +12481,22 @@ export function init(RuntimeName, PHPLoader) {
12464
12481
  }
12465
12482
  }
12466
12483
 
12467
- function invoke_viijii(index, a1, a2, a3, a4, a5) {
12484
+ function invoke_ji(index, a1) {
12468
12485
  var sp = stackSave();
12469
12486
  try {
12470
- dynCalls['viijii'](index, a1, a2, a3, a4, a5);
12487
+ return dynCalls['ji'](index, a1);
12471
12488
  } catch (e) {
12472
12489
  stackRestore(sp);
12473
12490
  if (e !== e + 0) throw e;
12474
12491
  _setThrew(1, 0);
12492
+ return 0n;
12475
12493
  }
12476
12494
  }
12477
12495
 
12478
- function invoke_viidii(index, a1, a2, a3, a4, a5) {
12496
+ function invoke_vj(index, a1) {
12479
12497
  var sp = stackSave();
12480
12498
  try {
12481
- dynCalls['viidii'](index, a1, a2, a3, a4, a5);
12499
+ dynCalls['vj'](index, a1);
12482
12500
  } catch (e) {
12483
12501
  stackRestore(sp);
12484
12502
  if (e !== e + 0) throw e;
@@ -12486,10 +12504,10 @@ export function init(RuntimeName, PHPLoader) {
12486
12504
  }
12487
12505
  }
12488
12506
 
12489
- function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) {
12507
+ function invoke_viijii(index, a1, a2, a3, a4, a5) {
12490
12508
  var sp = stackSave();
12491
12509
  try {
12492
- dynCalls['viiiiii'](index, a1, a2, a3, a4, a5, a6);
12510
+ dynCalls['viijii'](index, a1, a2, a3, a4, a5);
12493
12511
  } catch (e) {
12494
12512
  stackRestore(sp);
12495
12513
  if (e !== e + 0) throw e;
@@ -12497,22 +12515,32 @@ export function init(RuntimeName, PHPLoader) {
12497
12515
  }
12498
12516
  }
12499
12517
 
12500
- function invoke_jiii(index, a1, a2, a3) {
12518
+ function invoke_viidii(index, a1, a2, a3, a4, a5) {
12501
12519
  var sp = stackSave();
12502
12520
  try {
12503
- return dynCalls['jiii'](index, a1, a2, a3);
12521
+ dynCalls['viidii'](index, a1, a2, a3, a4, a5);
12504
12522
  } catch (e) {
12505
12523
  stackRestore(sp);
12506
12524
  if (e !== e + 0) throw e;
12507
12525
  _setThrew(1, 0);
12508
- return 0n;
12509
12526
  }
12510
12527
  }
12511
12528
 
12512
- function invoke_ji(index, a1) {
12529
+ function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) {
12513
12530
  var sp = stackSave();
12514
12531
  try {
12515
- return dynCalls['ji'](index, a1);
12532
+ dynCalls['viiiiii'](index, a1, a2, a3, a4, a5, a6);
12533
+ } catch (e) {
12534
+ stackRestore(sp);
12535
+ if (e !== e + 0) throw e;
12536
+ _setThrew(1, 0);
12537
+ }
12538
+ }
12539
+
12540
+ function invoke_jiii(index, a1, a2, a3) {
12541
+ var sp = stackSave();
12542
+ try {
12543
+ return dynCalls['jiii'](index, a1, a2, a3);
12516
12544
  } catch (e) {
12517
12545
  stackRestore(sp);
12518
12546
  if (e !== e + 0) throw e;