@php-wasm/node-8-5 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_5_10', 'php_8_5.wasm');
16
+ const dependencyFilename = path.join(currentDirPath, '8_5_12', 'php_8_5.wasm');
17
17
  export { dependencyFilename };
18
- export const dependenciesTotalSize = 26704381;
19
- const phpVersionString = '8.5.10';
18
+ export const dependenciesTotalSize = 26736411;
19
+ const phpVersionString = '8.5.12';
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
 
@@ -9822,367 +10080,123 @@ export function init(RuntimeName, PHPLoader) {
9822
10080
  if (value.toLowerCase() === 'z') {
9823
10081
  date.gmtoff = 0;
9824
10082
  } 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();
10151
- } else {
10152
- Asyncify.setDataHeader(
10153
- Asyncify._cachedData,
10154
- Asyncify._cachedData + 12,
10155
- Asyncify.StackSize
10156
- );
10157
- Asyncify.setDataRewindFunc(Asyncify._cachedData);
10158
- }
10159
- Asyncify.currData = Asyncify._cachedData;
10160
- if (typeof MainLoop != 'undefined' && MainLoop.func) {
10161
- MainLoop.pause();
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
@@ -10759,6 +10773,7 @@ export function init(RuntimeName, PHPLoader) {
10759
10773
  __php_stream_eof,
10760
10774
  __php_stream_get_line,
10761
10775
  __php_stream_open_wrapper_ex,
10776
+ __efree,
10762
10777
  __emalloc_24,
10763
10778
  __emalloc_32,
10764
10779
  __emalloc_40,
@@ -10768,7 +10783,6 @@ export function init(RuntimeName, PHPLoader) {
10768
10783
  __emalloc_160,
10769
10784
  __efree_56,
10770
10785
  __emalloc,
10771
- __efree,
10772
10786
  __erealloc,
10773
10787
  __safe_emalloc,
10774
10788
  ___zend_malloc,
@@ -10962,9 +10976,6 @@ export function init(RuntimeName, PHPLoader) {
10962
10976
  _memcmp,
10963
10977
  _free,
10964
10978
  _clock_gettime,
10965
- _malloc,
10966
- _snprintf,
10967
- _strchr,
10968
10979
  _dlopen,
10969
10980
  _fiprintf,
10970
10981
  _dlsym,
@@ -10972,10 +10983,13 @@ export function init(RuntimeName, PHPLoader) {
10972
10983
  _strcmp,
10973
10984
  _getenv,
10974
10985
  _explicit_bzero,
10986
+ _malloc,
10975
10987
  ___wasm_setjmp,
10976
10988
  ___wasm_setjmp_test,
10977
10989
  _emscripten_longjmp,
10990
+ _snprintf,
10978
10991
  _atoi,
10992
+ _strchr,
10979
10993
  ___errno_location,
10980
10994
  _strtoull,
10981
10995
  _strrchr,
@@ -11158,11 +11172,15 @@ export function init(RuntimeName, PHPLoader) {
11158
11172
  dynCall_jiiiii,
11159
11173
  dynCall_jiiii,
11160
11174
  dynCall_iiiiiiiiii,
11175
+ dynCall_viiiiiii,
11176
+ dynCall_ji,
11177
+ dynCall_di,
11178
+ dynCall_vij,
11179
+ dynCall_vid,
11161
11180
  dynCall_vjiii,
11162
11181
  dynCall_iiji,
11163
11182
  dynCall_iidddd,
11164
11183
  dynCall_iijjjj,
11165
- dynCall_ji,
11166
11184
  dynCall_viji,
11167
11185
  dynCall_iiij,
11168
11186
  dynCall_iijji,
@@ -11173,7 +11191,6 @@ export function init(RuntimeName, PHPLoader) {
11173
11191
  dynCall_iiiiiiii,
11174
11192
  dynCall_iiiiiiiiiiii,
11175
11193
  dynCall_iiiiiiiii,
11176
- dynCall_viiiiiii,
11177
11194
  dynCall_vji,
11178
11195
  dynCall_vijj,
11179
11196
  dynCall_iijiji,
@@ -11182,6 +11199,7 @@ export function init(RuntimeName, PHPLoader) {
11182
11199
  dynCall_viiiiii,
11183
11200
  dynCall_viiiiiiiii,
11184
11201
  dynCall_vidi,
11202
+ dynCall_vj,
11185
11203
  dynCall_iiijii,
11186
11204
  dynCall_iiidii,
11187
11205
  dynCall_jiiji,
@@ -11194,9 +11212,6 @@ export function init(RuntimeName, PHPLoader) {
11194
11212
  dynCall_iiiiiij,
11195
11213
  dynCall_iiid,
11196
11214
  dynCall_dii,
11197
- dynCall_vid,
11198
- dynCall_vij,
11199
- dynCall_di,
11200
11215
  dynCall_iiiiijii,
11201
11216
  dynCall_j,
11202
11217
  dynCall_iiiiji,
@@ -11297,6 +11312,7 @@ export function init(RuntimeName, PHPLoader) {
11297
11312
  wasmExports['_php_stream_get_line'];
11298
11313
  __php_stream_open_wrapper_ex = Module['__php_stream_open_wrapper_ex'] =
11299
11314
  wasmExports['_php_stream_open_wrapper_ex'];
11315
+ __efree = Module['__efree'] = wasmExports['_efree'];
11300
11316
  __emalloc_24 = Module['__emalloc_24'] = wasmExports['_emalloc_24'];
11301
11317
  __emalloc_32 = Module['__emalloc_32'] = wasmExports['_emalloc_32'];
11302
11318
  __emalloc_40 = Module['__emalloc_40'] = wasmExports['_emalloc_40'];
@@ -11306,7 +11322,6 @@ export function init(RuntimeName, PHPLoader) {
11306
11322
  __emalloc_160 = Module['__emalloc_160'] = wasmExports['_emalloc_160'];
11307
11323
  __efree_56 = Module['__efree_56'] = wasmExports['_efree_56'];
11308
11324
  __emalloc = Module['__emalloc'] = wasmExports['_emalloc'];
11309
- __efree = Module['__efree'] = wasmExports['_efree'];
11310
11325
  __erealloc = Module['__erealloc'] = wasmExports['_erealloc'];
11311
11326
  __safe_emalloc = Module['__safe_emalloc'] =
11312
11327
  wasmExports['_safe_emalloc'];
@@ -11714,12 +11729,6 @@ export function init(RuntimeName, PHPLoader) {
11714
11729
  _free = Module['_free'] = wasmExports['free'];
11715
11730
  _clock_gettime = Module['_clock_gettime'] =
11716
11731
  wasmExports['clock_gettime'];
11717
- _malloc =
11718
- PHPLoader['malloc'] =
11719
- Module['_malloc'] =
11720
- wasmExports['malloc'];
11721
- _snprintf = Module['_snprintf'] = wasmExports['snprintf'];
11722
- _strchr = Module['_strchr'] = wasmExports['strchr'];
11723
11732
  _dlopen = Module['_dlopen'] = wasmExports['dlopen'];
11724
11733
  _fiprintf = Module['_fiprintf'] = wasmExports['fiprintf'];
11725
11734
  _dlsym = Module['_dlsym'] = wasmExports['dlsym'];
@@ -11728,13 +11737,19 @@ export function init(RuntimeName, PHPLoader) {
11728
11737
  _getenv = Module['_getenv'] = wasmExports['getenv'];
11729
11738
  _explicit_bzero = Module['_explicit_bzero'] =
11730
11739
  wasmExports['explicit_bzero'];
11740
+ _malloc =
11741
+ PHPLoader['malloc'] =
11742
+ Module['_malloc'] =
11743
+ wasmExports['malloc'];
11731
11744
  ___wasm_setjmp = Module['___wasm_setjmp'] =
11732
11745
  wasmExports['__wasm_setjmp'];
11733
11746
  ___wasm_setjmp_test = Module['___wasm_setjmp_test'] =
11734
11747
  wasmExports['__wasm_setjmp_test'];
11735
11748
  _emscripten_longjmp = Module['_emscripten_longjmp'] =
11736
11749
  wasmExports['emscripten_longjmp'];
11750
+ _snprintf = Module['_snprintf'] = wasmExports['snprintf'];
11737
11751
  _atoi = Module['_atoi'] = wasmExports['atoi'];
11752
+ _strchr = Module['_strchr'] = wasmExports['strchr'];
11738
11753
  ___errno_location = Module['___errno_location'] =
11739
11754
  wasmExports['__errno_location'];
11740
11755
  _strtoull = Module['_strtoull'] = wasmExports['strtoull'];
@@ -11970,11 +11985,16 @@ export function init(RuntimeName, PHPLoader) {
11970
11985
  dynCall_jiiii = dynCalls['jiiii'] = wasmExports['dynCall_jiiii'];
11971
11986
  dynCall_iiiiiiiiii = dynCalls['iiiiiiiiii'] =
11972
11987
  wasmExports['dynCall_iiiiiiiiii'];
11988
+ dynCall_viiiiiii = dynCalls['viiiiiii'] =
11989
+ wasmExports['dynCall_viiiiiii'];
11990
+ dynCall_ji = dynCalls['ji'] = wasmExports['dynCall_ji'];
11991
+ dynCall_di = dynCalls['di'] = wasmExports['dynCall_di'];
11992
+ dynCall_vij = dynCalls['vij'] = wasmExports['dynCall_vij'];
11993
+ dynCall_vid = dynCalls['vid'] = wasmExports['dynCall_vid'];
11973
11994
  dynCall_vjiii = dynCalls['vjiii'] = wasmExports['dynCall_vjiii'];
11974
11995
  dynCall_iiji = dynCalls['iiji'] = wasmExports['dynCall_iiji'];
11975
11996
  dynCall_iidddd = dynCalls['iidddd'] = wasmExports['dynCall_iidddd'];
11976
11997
  dynCall_iijjjj = dynCalls['iijjjj'] = wasmExports['dynCall_iijjjj'];
11977
- dynCall_ji = dynCalls['ji'] = wasmExports['dynCall_ji'];
11978
11998
  dynCall_viji = dynCalls['viji'] = wasmExports['dynCall_viji'];
11979
11999
  dynCall_iiij = dynCalls['iiij'] = wasmExports['dynCall_iiij'];
11980
12000
  dynCall_iijji = dynCalls['iijji'] = wasmExports['dynCall_iijji'];
@@ -11990,8 +12010,6 @@ export function init(RuntimeName, PHPLoader) {
11990
12010
  wasmExports['dynCall_iiiiiiiiiiii'];
11991
12011
  dynCall_iiiiiiiii = dynCalls['iiiiiiiii'] =
11992
12012
  wasmExports['dynCall_iiiiiiiii'];
11993
- dynCall_viiiiiii = dynCalls['viiiiiii'] =
11994
- wasmExports['dynCall_viiiiiii'];
11995
12013
  dynCall_vji = dynCalls['vji'] = wasmExports['dynCall_vji'];
11996
12014
  dynCall_vijj = dynCalls['vijj'] = wasmExports['dynCall_vijj'];
11997
12015
  dynCall_iijiji = dynCalls['iijiji'] = wasmExports['dynCall_iijiji'];
@@ -12001,6 +12019,7 @@ export function init(RuntimeName, PHPLoader) {
12001
12019
  dynCall_viiiiiiiii = dynCalls['viiiiiiiii'] =
12002
12020
  wasmExports['dynCall_viiiiiiiii'];
12003
12021
  dynCall_vidi = dynCalls['vidi'] = wasmExports['dynCall_vidi'];
12022
+ dynCall_vj = dynCalls['vj'] = wasmExports['dynCall_vj'];
12004
12023
  dynCall_iiijii = dynCalls['iiijii'] = wasmExports['dynCall_iiijii'];
12005
12024
  dynCall_iiidii = dynCalls['iiidii'] = wasmExports['dynCall_iiidii'];
12006
12025
  dynCall_jiiji = dynCalls['jiiji'] = wasmExports['dynCall_jiiji'];
@@ -12013,9 +12032,6 @@ export function init(RuntimeName, PHPLoader) {
12013
12032
  dynCall_iiiiiij = dynCalls['iiiiiij'] = wasmExports['dynCall_iiiiiij'];
12014
12033
  dynCall_iiid = dynCalls['iiid'] = wasmExports['dynCall_iiid'];
12015
12034
  dynCall_dii = dynCalls['dii'] = wasmExports['dynCall_dii'];
12016
- dynCall_vid = dynCalls['vid'] = wasmExports['dynCall_vid'];
12017
- dynCall_vij = dynCalls['vij'] = wasmExports['dynCall_vij'];
12018
- dynCall_di = dynCalls['di'] = wasmExports['dynCall_di'];
12019
12035
  dynCall_iiiiijii = dynCalls['iiiiijii'] =
12020
12036
  wasmExports['dynCall_iiiiijii'];
12021
12037
  dynCall_j = dynCalls['j'] = wasmExports['dynCall_j'];
@@ -12062,110 +12078,110 @@ export function init(RuntimeName, PHPLoader) {
12062
12078
  wasmExports['__indirect_function_table'];
12063
12079
  }
12064
12080
 
12065
- var _core_globals = (Module['_core_globals'] = 18175880);
12081
+ var _core_globals = (Module['_core_globals'] = 18176416);
12066
12082
 
12067
- var _php_ini_opened_path = (Module['_php_ini_opened_path'] = 18063728);
12083
+ var _php_ini_opened_path = (Module['_php_ini_opened_path'] = 18064256);
12068
12084
 
12069
- var _php_ini_scanned_path = (Module['_php_ini_scanned_path'] = 18063732);
12085
+ var _php_ini_scanned_path = (Module['_php_ini_scanned_path'] = 18064260);
12070
12086
 
12071
- var _php_ini_scanned_files = (Module['_php_ini_scanned_files'] = 18063736);
12087
+ var _php_ini_scanned_files = (Module['_php_ini_scanned_files'] = 18064264);
12072
12088
 
12073
- var _sapi_module = (Module['_sapi_module'] = 18058896);
12089
+ var _sapi_module = (Module['_sapi_module'] = 18059424);
12074
12090
 
12075
- var _sapi_globals = (Module['_sapi_globals'] = 18059048);
12091
+ var _sapi_globals = (Module['_sapi_globals'] = 18059576);
12076
12092
 
12077
- var _module_registry = (Module['_module_registry'] = 18178816);
12093
+ var _module_registry = (Module['_module_registry'] = 18178304);
12078
12094
 
12079
- var _zend_ce_closure = (Module['_zend_ce_closure'] = 18176748);
12095
+ var _zend_ce_closure = (Module['_zend_ce_closure'] = 18177292);
12080
12096
 
12081
- var _compiler_globals = (Module['_compiler_globals'] = 18180440);
12097
+ var _compiler_globals = (Module['_compiler_globals'] = 18180984);
12082
12098
 
12083
- var _executor_globals = (Module['_executor_globals'] = 18180856);
12099
+ var _executor_globals = (Module['_executor_globals'] = 18181400);
12084
12100
 
12085
- var _zend_compile_file = (Module['_zend_compile_file'] = 18182272);
12101
+ var _zend_compile_file = (Module['_zend_compile_file'] = 18182832);
12086
12102
 
12087
- var _zend_ce_exception = (Module['_zend_ce_exception'] = 18176876);
12103
+ var _zend_ce_exception = (Module['_zend_ce_exception'] = 18177420);
12088
12104
 
12089
- var _zend_ce_error = (Module['_zend_ce_error'] = 18177e3);
12105
+ var _zend_ce_error = (Module['_zend_ce_error'] = 18177544);
12090
12106
 
12091
12107
  var _zend_throw_exception_hook = (Module['_zend_throw_exception_hook'] =
12092
- 18176872);
12108
+ 18177416);
12093
12109
 
12094
- var _zend_ce_throwable = (Module['_zend_ce_throwable'] = 18176880);
12110
+ var _zend_ce_throwable = (Module['_zend_ce_throwable'] = 18177424);
12095
12111
 
12096
- var _zend_execute_ex = (Module['_zend_execute_ex'] = 18178800);
12112
+ var _zend_execute_ex = (Module['_zend_execute_ex'] = 18180960);
12097
12113
 
12098
- var _zend_execute_internal = (Module['_zend_execute_internal'] = 18178804);
12114
+ var _zend_execute_internal = (Module['_zend_execute_internal'] = 18180964);
12099
12115
 
12100
- var _zend_pass_function = (Module['_zend_pass_function'] = 17540640);
12116
+ var _zend_pass_function = (Module['_zend_pass_function'] = 17542944);
12101
12117
 
12102
- var _zend_extensions = (Module['_zend_extensions'] = 18176716);
12118
+ var _zend_extensions = (Module['_zend_extensions'] = 18177260);
12103
12119
 
12104
- var _gc_collect_cycles = (Module['_gc_collect_cycles'] = 18179200);
12120
+ var _gc_collect_cycles = (Module['_gc_collect_cycles'] = 18178688);
12105
12121
 
12106
- var _zend_empty_array = (Module['_zend_empty_array'] = 17555952);
12122
+ var _zend_empty_array = (Module['_zend_empty_array'] = 17542064);
12107
12123
 
12108
- var _zend_ce_aggregate = (Module['_zend_ce_aggregate'] = 18058256);
12124
+ var _zend_ce_aggregate = (Module['_zend_ce_aggregate'] = 18058784);
12109
12125
 
12110
- var _zend_ce_iterator = (Module['_zend_ce_iterator'] = 18058260);
12126
+ var _zend_ce_iterator = (Module['_zend_ce_iterator'] = 18058788);
12111
12127
 
12112
- var _zend_ce_countable = (Module['_zend_ce_countable'] = 18058272);
12128
+ var _zend_ce_countable = (Module['_zend_ce_countable'] = 18058800);
12113
12129
 
12114
- var _std_object_handlers = (Module['_std_object_handlers'] = 17539344);
12130
+ var _std_object_handlers = (Module['_std_object_handlers'] = 17539856);
12115
12131
 
12116
- var _zend_empty_string = (Module['_zend_empty_string'] = 18179204);
12132
+ var _zend_empty_string = (Module['_zend_empty_string'] = 18178692);
12117
12133
 
12118
- var _zend_known_strings = (Module['_zend_known_strings'] = 18179208);
12134
+ var _zend_known_strings = (Module['_zend_known_strings'] = 18178696);
12119
12135
 
12120
12136
  var _zend_string_init_interned = (Module['_zend_string_init_interned'] =
12121
- 18179276);
12137
+ 18178764);
12122
12138
 
12123
- var _zend_write = (Module['_zend_write'] = 18180356);
12139
+ var _zend_write = (Module['_zend_write'] = 18179844);
12124
12140
 
12125
- var _zend_error_cb = (Module['_zend_error_cb'] = 18180360);
12141
+ var _zend_error_cb = (Module['_zend_error_cb'] = 18179848);
12126
12142
 
12127
- var _zend_post_startup_cb = (Module['_zend_post_startup_cb'] = 18180328);
12143
+ var _zend_post_startup_cb = (Module['_zend_post_startup_cb'] = 18179816);
12128
12144
 
12129
12145
  var ___memory_base = (Module['___memory_base'] = 0);
12130
12146
 
12131
12147
  var ___table_base = (Module['___table_base'] = 1);
12132
12148
 
12133
- var _stderr = (Module['_stderr'] = 18050848);
12149
+ var _stderr = (Module['_stderr'] = 18051376);
12134
12150
 
12135
- var ___THREW__ = (Module['___THREW__'] = 18530628);
12151
+ var ___THREW__ = (Module['___THREW__'] = 18531188);
12136
12152
 
12137
- var ___threwValue = (Module['___threwValue'] = 18530632);
12153
+ var ___threwValue = (Module['___threwValue'] = 18531192);
12138
12154
 
12139
- var _stdout = (Module['_stdout'] = 18051152);
12155
+ var _stdout = (Module['_stdout'] = 18051680);
12140
12156
 
12141
- var _timezone = (Module['_timezone'] = 18517552);
12157
+ var _timezone = (Module['_timezone'] = 18518112);
12142
12158
 
12143
- var _tzname = (Module['_tzname'] = 18517560);
12159
+ var _tzname = (Module['_tzname'] = 18518120);
12144
12160
 
12145
- var ___heap_base = 19579296;
12161
+ var ___heap_base = 19579856;
12146
12162
 
12147
12163
  var __ZNSt3__25ctypeIcE2idE = (Module['__ZNSt3__25ctypeIcE2idE'] =
12148
- 18530708);
12164
+ 18531268);
12149
12165
 
12150
12166
  var __ZTVN10__cxxabiv120__si_class_type_infoE = (Module[
12151
12167
  '__ZTVN10__cxxabiv120__si_class_type_infoE'
12152
- ] = 18051400);
12168
+ ] = 18051928);
12153
12169
 
12154
12170
  var __ZTVN10__cxxabiv117__class_type_infoE = (Module[
12155
12171
  '__ZTVN10__cxxabiv117__class_type_infoE'
12156
- ] = 18051360);
12172
+ ] = 18051888);
12157
12173
 
12158
12174
  var __ZTVN10__cxxabiv121__vmi_class_type_infoE = (Module[
12159
12175
  '__ZTVN10__cxxabiv121__vmi_class_type_infoE'
12160
- ] = 18051452);
12176
+ ] = 18051980);
12161
12177
 
12162
12178
  var __ZTISt20bad_array_new_length = (Module[
12163
12179
  '__ZTISt20bad_array_new_length'
12164
- ] = 18051524);
12180
+ ] = 18052052);
12165
12181
 
12166
- var __ZTVSt12length_error = (Module['__ZTVSt12length_error'] = 18051568);
12182
+ var __ZTVSt12length_error = (Module['__ZTVSt12length_error'] = 18052096);
12167
12183
 
12168
- var __ZTISt12length_error = (Module['__ZTISt12length_error'] = 18051588);
12184
+ var __ZTISt12length_error = (Module['__ZTISt12length_error'] = 18052116);
12169
12185
 
12170
12186
  var wasmImports = {
12171
12187
  /** @export */ __assert_fail: ___assert_fail,
@@ -12254,6 +12270,7 @@ export function init(RuntimeName, PHPLoader) {
12254
12270
  /** @export */ getnameinfo: _getnameinfo,
12255
12271
  /** @export */ getprotobyname: _getprotobyname,
12256
12272
  /** @export */ getprotobynumber: _getprotobynumber,
12273
+ /** @export */ invoke_di,
12257
12274
  /** @export */ invoke_dii,
12258
12275
  /** @export */ invoke_i,
12259
12276
  /** @export */ invoke_id,
@@ -12285,6 +12302,7 @@ export function init(RuntimeName, PHPLoader) {
12285
12302
  /** @export */ invoke_jiji,
12286
12303
  /** @export */ invoke_v,
12287
12304
  /** @export */ invoke_vi,
12305
+ /** @export */ invoke_vid,
12288
12306
  /** @export */ invoke_vii,
12289
12307
  /** @export */ invoke_viid,
12290
12308
  /** @export */ invoke_viidddddddd,
@@ -12301,6 +12319,7 @@ export function init(RuntimeName, PHPLoader) {
12301
12319
  /** @export */ invoke_viiij,
12302
12320
  /** @export */ invoke_vij,
12303
12321
  /** @export */ invoke_vijj,
12322
+ /** @export */ invoke_vj,
12304
12323
  /** @export */ invoke_vji,
12305
12324
  /** @export */ js_fd_read,
12306
12325
  /** @export */ js_flock: _js_flock,
@@ -12481,6 +12500,29 @@ export function init(RuntimeName, PHPLoader) {
12481
12500
  }
12482
12501
  }
12483
12502
 
12503
+ function invoke_ji(index, a1) {
12504
+ var sp = stackSave();
12505
+ try {
12506
+ return dynCalls['ji'](index, a1);
12507
+ } catch (e) {
12508
+ stackRestore(sp);
12509
+ if (e !== e + 0) throw e;
12510
+ _setThrew(1, 0);
12511
+ return 0n;
12512
+ }
12513
+ }
12514
+
12515
+ function invoke_vj(index, a1) {
12516
+ var sp = stackSave();
12517
+ try {
12518
+ dynCalls['vj'](index, a1);
12519
+ } catch (e) {
12520
+ stackRestore(sp);
12521
+ if (e !== e + 0) throw e;
12522
+ _setThrew(1, 0);
12523
+ }
12524
+ }
12525
+
12484
12526
  function invoke_iiiiii(index, a1, a2, a3, a4, a5) {
12485
12527
  var sp = stackSave();
12486
12528
  try {
@@ -12537,10 +12579,10 @@ export function init(RuntimeName, PHPLoader) {
12537
12579
  }
12538
12580
  }
12539
12581
 
12540
- function invoke_iiij(index, a1, a2, a3) {
12582
+ function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
12541
12583
  var sp = stackSave();
12542
12584
  try {
12543
- return dynCalls['iiij'](index, a1, a2, a3);
12585
+ dynCalls['viiiiiii'](index, a1, a2, a3, a4, a5, a6, a7);
12544
12586
  } catch (e) {
12545
12587
  stackRestore(sp);
12546
12588
  if (e !== e + 0) throw e;
@@ -12548,15 +12590,47 @@ export function init(RuntimeName, PHPLoader) {
12548
12590
  }
12549
12591
  }
12550
12592
 
12551
- function invoke_ji(index, a1) {
12593
+ function invoke_di(index, a1) {
12552
12594
  var sp = stackSave();
12553
12595
  try {
12554
- return dynCalls['ji'](index, a1);
12596
+ return dynCalls['di'](index, a1);
12597
+ } catch (e) {
12598
+ stackRestore(sp);
12599
+ if (e !== e + 0) throw e;
12600
+ _setThrew(1, 0);
12601
+ }
12602
+ }
12603
+
12604
+ function invoke_vij(index, a1, a2) {
12605
+ var sp = stackSave();
12606
+ try {
12607
+ dynCalls['vij'](index, a1, a2);
12608
+ } catch (e) {
12609
+ stackRestore(sp);
12610
+ if (e !== e + 0) throw e;
12611
+ _setThrew(1, 0);
12612
+ }
12613
+ }
12614
+
12615
+ function invoke_vid(index, a1, a2) {
12616
+ var sp = stackSave();
12617
+ try {
12618
+ dynCalls['vid'](index, a1, a2);
12619
+ } catch (e) {
12620
+ stackRestore(sp);
12621
+ if (e !== e + 0) throw e;
12622
+ _setThrew(1, 0);
12623
+ }
12624
+ }
12625
+
12626
+ function invoke_iiij(index, a1, a2, a3) {
12627
+ var sp = stackSave();
12628
+ try {
12629
+ return dynCalls['iiij'](index, a1, a2, a3);
12555
12630
  } catch (e) {
12556
12631
  stackRestore(sp);
12557
12632
  if (e !== e + 0) throw e;
12558
12633
  _setThrew(1, 0);
12559
- return 0n;
12560
12634
  }
12561
12635
  }
12562
12636
 
@@ -12648,17 +12722,6 @@ export function init(RuntimeName, PHPLoader) {
12648
12722
  }
12649
12723
  }
12650
12724
 
12651
- function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
12652
- var sp = stackSave();
12653
- try {
12654
- dynCalls['viiiiiii'](index, a1, a2, a3, a4, a5, a6, a7);
12655
- } catch (e) {
12656
- stackRestore(sp);
12657
- if (e !== e + 0) throw e;
12658
- _setThrew(1, 0);
12659
- }
12660
- }
12661
-
12662
12725
  function invoke_iiiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8) {
12663
12726
  var sp = stackSave();
12664
12727
  try {
@@ -12943,17 +13006,6 @@ export function init(RuntimeName, PHPLoader) {
12943
13006
  }
12944
13007
  }
12945
13008
 
12946
- function invoke_vij(index, a1, a2) {
12947
- var sp = stackSave();
12948
- try {
12949
- dynCalls['vij'](index, a1, a2);
12950
- } catch (e) {
12951
- stackRestore(sp);
12952
- if (e !== e + 0) throw e;
12953
- _setThrew(1, 0);
12954
- }
12955
- }
12956
-
12957
13009
  function invoke_dii(index, a1, a2) {
12958
13010
  var sp = stackSave();
12959
13011
  try {