@php-wasm/node-8-5 3.1.61 → 3.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asyncify/{8_5_10 → 8_5_12}/php_8_5.wasm +0 -0
- package/asyncify/php_8_5.js +534 -475
- package/jspi/{8_5_10 → 8_5_12}/php_8_5.wasm +0 -0
- package/jspi/php_8_5.js +1145 -1124
- package/package.json +3 -3
package/asyncify/php_8_5.js
CHANGED
|
@@ -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, '
|
|
16
|
+
const dependencyFilename = path.join(currentDirPath, '8_5_12', 'php_8_5.wasm');
|
|
17
17
|
export { dependencyFilename };
|
|
18
|
-
export const dependenciesTotalSize =
|
|
19
|
-
const phpVersionString = '8.5.
|
|
18
|
+
export const dependenciesTotalSize = 26736418;
|
|
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) =>
|
|
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
|
|
|
@@ -9119,13 +9377,11 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
9119
9377
|
envLength
|
|
9120
9378
|
) {
|
|
9121
9379
|
if (!command) {
|
|
9122
|
-
|
|
9123
|
-
return -1;
|
|
9380
|
+
return -ERRNO_CODES.EINVAL;
|
|
9124
9381
|
}
|
|
9125
9382
|
const cmdstr = UTF8ToString(command);
|
|
9126
9383
|
if (!cmdstr.length) {
|
|
9127
|
-
|
|
9128
|
-
return -1;
|
|
9384
|
+
return -ERRNO_CODES.EINVAL;
|
|
9129
9385
|
}
|
|
9130
9386
|
let argsArray = [];
|
|
9131
9387
|
if (argsLength) {
|
|
@@ -9185,13 +9441,11 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
9185
9441
|
}
|
|
9186
9442
|
} catch (e) {
|
|
9187
9443
|
if (e.code === 'SPAWN_UNSUPPORTED') {
|
|
9188
|
-
|
|
9189
|
-
return -1;
|
|
9444
|
+
return -ERRNO_CODES.ENOSYS;
|
|
9190
9445
|
}
|
|
9191
9446
|
if (typeof FS == 'undefined' || !(e.name === 'ErrnoError'))
|
|
9192
9447
|
throw e;
|
|
9193
|
-
|
|
9194
|
-
return -1;
|
|
9448
|
+
return -e.errno;
|
|
9195
9449
|
}
|
|
9196
9450
|
const ProcInfo = {
|
|
9197
9451
|
pid: cp.pid,
|
|
@@ -9205,20 +9459,31 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
9205
9459
|
stderrChildFd = std[2]?.child,
|
|
9206
9460
|
stderrParentFd = std[2]?.parent;
|
|
9207
9461
|
const detachPipeDataListeners = [];
|
|
9208
|
-
|
|
9209
|
-
|
|
9462
|
+
/**
|
|
9463
|
+
* Closes the child ends of the pipes so a blocking fread() on the
|
|
9464
|
+
* parent end sees a broken pipe instead of polling forever. Runs on
|
|
9465
|
+
* 'exit' and when the spawn wait fails, because a failed spawn may
|
|
9466
|
+
* never emit 'exit'.
|
|
9467
|
+
*
|
|
9468
|
+
* Runs at most once. After the first call, PHP may reuse these fd
|
|
9469
|
+
* numbers for unrelated streams that a late 'exit' must not close.
|
|
9470
|
+
*/ let childPipesClosed = false;
|
|
9471
|
+
const closeChildPipes = function () {
|
|
9472
|
+
if (childPipesClosed) {
|
|
9473
|
+
return;
|
|
9474
|
+
}
|
|
9475
|
+
childPipesClosed = true;
|
|
9476
|
+
for (const detach of detachPipeDataListeners) {
|
|
9210
9477
|
detach();
|
|
9211
9478
|
}
|
|
9212
|
-
for (const fd of [
|
|
9213
|
-
// The child process exited. Let's clean up its output streams:
|
|
9214
|
-
stdoutChildFd,
|
|
9215
|
-
stderrChildFd,
|
|
9216
|
-
stdinChildFd,
|
|
9217
|
-
]) {
|
|
9479
|
+
for (const fd of [stdoutChildFd, stderrChildFd, stdinChildFd]) {
|
|
9218
9480
|
if (FS.streams[fd] && !FS.isClosed(FS.streams[fd])) {
|
|
9219
9481
|
FS.close(FS.streams[fd]);
|
|
9220
9482
|
}
|
|
9221
9483
|
}
|
|
9484
|
+
};
|
|
9485
|
+
cp.on('exit', function (code) {
|
|
9486
|
+
closeChildPipes();
|
|
9222
9487
|
ProcInfo.exitCode = code;
|
|
9223
9488
|
ProcInfo.exited = true;
|
|
9224
9489
|
});
|
|
@@ -9326,6 +9591,10 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
9326
9591
|
// Process already started. Even if it exited early, PHP still
|
|
9327
9592
|
// needs to know about the pid and clean up the resources.
|
|
9328
9593
|
console.error(e);
|
|
9594
|
+
closeChildPipes();
|
|
9595
|
+
if (!ProcInfo.pid) {
|
|
9596
|
+
return -(ERRNO_CODES[e.code] ?? ERRNO_CODES.ECHILD);
|
|
9597
|
+
}
|
|
9329
9598
|
return ProcInfo.pid;
|
|
9330
9599
|
}
|
|
9331
9600
|
// Now we want to pass data from the STDIN source supplied by PHP
|
|
@@ -9822,367 +10091,123 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
9822
10091
|
if (value.toLowerCase() === 'z') {
|
|
9823
10092
|
date.gmtoff = 0;
|
|
9824
10093
|
} 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();
|
|
10094
|
+
var match = value.match(/^((?:\-|\+)\d\d):?(\d\d)?/);
|
|
10095
|
+
date.gmtoff = match[1] * 3600;
|
|
10096
|
+
if (match[2]) {
|
|
10097
|
+
date.gmtoff +=
|
|
10098
|
+
date.gmtoff > 0 ? match[2] * 60 : -match[2] * 60;
|
|
10162
10099
|
}
|
|
10163
|
-
runAndAbortIfError(() =>
|
|
10164
|
-
_asyncify_start_unwind(Asyncify.currData)
|
|
10165
|
-
);
|
|
10166
10100
|
}
|
|
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
10101
|
}
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10102
|
+
/*
|
|
10103
|
+
tm_sec int seconds after the minute 0-61*
|
|
10104
|
+
tm_min int minutes after the hour 0-59
|
|
10105
|
+
tm_hour int hours since midnight 0-23
|
|
10106
|
+
tm_mday int day of the month 1-31
|
|
10107
|
+
tm_mon int months since January 0-11
|
|
10108
|
+
tm_year int years since 1900
|
|
10109
|
+
tm_wday int days since Sunday 0-6
|
|
10110
|
+
tm_yday int days since January 1 0-365
|
|
10111
|
+
tm_isdst int Daylight Saving Time flag
|
|
10112
|
+
tm_gmtoff long offset from GMT (seconds)
|
|
10113
|
+
*/ var fullDate = new Date(
|
|
10114
|
+
date.year,
|
|
10115
|
+
date.month,
|
|
10116
|
+
date.day,
|
|
10117
|
+
date.hour,
|
|
10118
|
+
date.min,
|
|
10119
|
+
date.sec,
|
|
10120
|
+
0
|
|
10121
|
+
);
|
|
10122
|
+
HEAP32[tm >> 2] = fullDate.getSeconds();
|
|
10123
|
+
HEAP32[(tm + 4) >> 2] = fullDate.getMinutes();
|
|
10124
|
+
HEAP32[(tm + 8) >> 2] = fullDate.getHours();
|
|
10125
|
+
HEAP32[(tm + 12) >> 2] = fullDate.getDate();
|
|
10126
|
+
HEAP32[(tm + 16) >> 2] = fullDate.getMonth();
|
|
10127
|
+
HEAP32[(tm + 20) >> 2] = fullDate.getFullYear() - 1900;
|
|
10128
|
+
HEAP32[(tm + 24) >> 2] = fullDate.getDay();
|
|
10129
|
+
HEAP32[(tm + 28) >> 2] =
|
|
10130
|
+
arraySum(
|
|
10131
|
+
isLeapYear(fullDate.getFullYear())
|
|
10132
|
+
? MONTH_DAYS_LEAP
|
|
10133
|
+
: MONTH_DAYS_REGULAR,
|
|
10134
|
+
fullDate.getMonth() - 1
|
|
10135
|
+
) +
|
|
10136
|
+
fullDate.getDate() -
|
|
10137
|
+
1;
|
|
10138
|
+
HEAP32[(tm + 32) >> 2] = 0;
|
|
10139
|
+
HEAP32[(tm + 36) >> 2] = date.gmtoff;
|
|
10140
|
+
// we need to convert the matched sequence into an integer array to take care of UTF-8 characters > 0x7F
|
|
10141
|
+
// TODO: not sure that intArrayFromString handles all unicode characters correctly
|
|
10142
|
+
return buf + lengthBytesUTF8(matches[0]);
|
|
10143
|
+
}
|
|
10144
|
+
return 0;
|
|
10184
10145
|
};
|
|
10185
10146
|
|
|
10147
|
+
_strptime.sig = 'pppp';
|
|
10148
|
+
|
|
10149
|
+
var _swapcontext = () => abort('missing function: ${name}');
|
|
10150
|
+
|
|
10151
|
+
function _wasm_close(socketd) {
|
|
10152
|
+
return PHPWASM.shutdownSocket(socketd, 2);
|
|
10153
|
+
}
|
|
10154
|
+
|
|
10155
|
+
function _wasm_setsockopt(
|
|
10156
|
+
socketd,
|
|
10157
|
+
level,
|
|
10158
|
+
optionName,
|
|
10159
|
+
optionValuePtr,
|
|
10160
|
+
optionLen
|
|
10161
|
+
) {
|
|
10162
|
+
const optionValue = HEAPU8[optionValuePtr];
|
|
10163
|
+
const SOL_SOCKET = 1;
|
|
10164
|
+
const SO_KEEPALIVE = 9;
|
|
10165
|
+
const SO_RCVTIMEO = 66;
|
|
10166
|
+
const SO_SNDTIMEO = 67;
|
|
10167
|
+
const IPPROTO_TCP = 6;
|
|
10168
|
+
const TCP_NODELAY = 1;
|
|
10169
|
+
if (
|
|
10170
|
+
level === SOL_SOCKET &&
|
|
10171
|
+
(optionName === SO_RCVTIMEO || optionName === SO_SNDTIMEO)
|
|
10172
|
+
) {
|
|
10173
|
+
const timeoutMs = PHPWASM.parseSocketTimeout(
|
|
10174
|
+
optionValuePtr,
|
|
10175
|
+
optionLen
|
|
10176
|
+
);
|
|
10177
|
+
if (timeoutMs === null) {
|
|
10178
|
+
return -1;
|
|
10179
|
+
}
|
|
10180
|
+
const timeouts = PHPWASM.socketTimeouts.get(socketd) || {};
|
|
10181
|
+
if (optionName === SO_RCVTIMEO) {
|
|
10182
|
+
timeouts.receive = timeoutMs;
|
|
10183
|
+
} else {
|
|
10184
|
+
timeouts.send = timeoutMs;
|
|
10185
|
+
}
|
|
10186
|
+
PHPWASM.socketTimeouts.set(socketd, timeouts);
|
|
10187
|
+
return 0;
|
|
10188
|
+
}
|
|
10189
|
+
// Options that we can forward to the WebSocket proxy
|
|
10190
|
+
const isForwardable =
|
|
10191
|
+
(level === SOL_SOCKET && optionName === SO_KEEPALIVE) ||
|
|
10192
|
+
(level === IPPROTO_TCP && optionName === TCP_NODELAY);
|
|
10193
|
+
if (!isForwardable) {
|
|
10194
|
+
console.warn(
|
|
10195
|
+
`Unsupported socket option: ${level}, ${optionName}, ${optionValue}`
|
|
10196
|
+
);
|
|
10197
|
+
return -1;
|
|
10198
|
+
}
|
|
10199
|
+
const ws = PHPWASM.getAllWebSockets(socketd)[0];
|
|
10200
|
+
if (!ws) {
|
|
10201
|
+
return -1;
|
|
10202
|
+
}
|
|
10203
|
+
ws.setSocketOpt(level, optionName, optionValuePtr);
|
|
10204
|
+
return 0;
|
|
10205
|
+
}
|
|
10206
|
+
|
|
10207
|
+
function _wasm_shutdown(socketd, how) {
|
|
10208
|
+
return PHPWASM.shutdownSocket(socketd, how);
|
|
10209
|
+
}
|
|
10210
|
+
|
|
10186
10211
|
var getCFunc = (ident) => {
|
|
10187
10212
|
var func = Module['_' + ident];
|
|
10188
10213
|
// closure exported function
|
|
@@ -10653,10 +10678,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
10653
10678
|
return ERRNO_CODES.EWOULDBLOCK;
|
|
10654
10679
|
}
|
|
10655
10680
|
return returnCallback(async (wakeUp) => {
|
|
10656
|
-
var retries = 0;
|
|
10657
10681
|
var interval = 50;
|
|
10658
|
-
var timeout = 5e3;
|
|
10659
|
-
var maxRetries = timeout / interval;
|
|
10660
10682
|
while (true) {
|
|
10661
10683
|
var returnCode;
|
|
10662
10684
|
var stream;
|
|
@@ -10680,7 +10702,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
10680
10702
|
return wakeUp(0);
|
|
10681
10703
|
}
|
|
10682
10704
|
if (
|
|
10683
|
-
++retries > maxRetries ||
|
|
10684
10705
|
!stream ||
|
|
10685
10706
|
FS.isClosed(stream) ||
|
|
10686
10707
|
returnCode !== ERRNO_CODES.EWOULDBLOCK ||
|
|
@@ -10759,6 +10780,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
10759
10780
|
__php_stream_eof,
|
|
10760
10781
|
__php_stream_get_line,
|
|
10761
10782
|
__php_stream_open_wrapper_ex,
|
|
10783
|
+
__efree,
|
|
10762
10784
|
__emalloc_24,
|
|
10763
10785
|
__emalloc_32,
|
|
10764
10786
|
__emalloc_40,
|
|
@@ -10768,7 +10790,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
10768
10790
|
__emalloc_160,
|
|
10769
10791
|
__efree_56,
|
|
10770
10792
|
__emalloc,
|
|
10771
|
-
__efree,
|
|
10772
10793
|
__erealloc,
|
|
10773
10794
|
__safe_emalloc,
|
|
10774
10795
|
___zend_malloc,
|
|
@@ -10962,9 +10983,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
10962
10983
|
_memcmp,
|
|
10963
10984
|
_free,
|
|
10964
10985
|
_clock_gettime,
|
|
10965
|
-
_malloc,
|
|
10966
|
-
_snprintf,
|
|
10967
|
-
_strchr,
|
|
10968
10986
|
_dlopen,
|
|
10969
10987
|
_fiprintf,
|
|
10970
10988
|
_dlsym,
|
|
@@ -10972,10 +10990,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
10972
10990
|
_strcmp,
|
|
10973
10991
|
_getenv,
|
|
10974
10992
|
_explicit_bzero,
|
|
10993
|
+
_malloc,
|
|
10975
10994
|
___wasm_setjmp,
|
|
10976
10995
|
___wasm_setjmp_test,
|
|
10977
10996
|
_emscripten_longjmp,
|
|
10997
|
+
_snprintf,
|
|
10978
10998
|
_atoi,
|
|
10999
|
+
_strchr,
|
|
10979
11000
|
___errno_location,
|
|
10980
11001
|
_strtoull,
|
|
10981
11002
|
_strrchr,
|
|
@@ -11158,11 +11179,15 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11158
11179
|
dynCall_jiiiii,
|
|
11159
11180
|
dynCall_jiiii,
|
|
11160
11181
|
dynCall_iiiiiiiiii,
|
|
11182
|
+
dynCall_viiiiiii,
|
|
11183
|
+
dynCall_ji,
|
|
11184
|
+
dynCall_di,
|
|
11185
|
+
dynCall_vij,
|
|
11186
|
+
dynCall_vid,
|
|
11161
11187
|
dynCall_vjiii,
|
|
11162
11188
|
dynCall_iiji,
|
|
11163
11189
|
dynCall_iidddd,
|
|
11164
11190
|
dynCall_iijjjj,
|
|
11165
|
-
dynCall_ji,
|
|
11166
11191
|
dynCall_viji,
|
|
11167
11192
|
dynCall_iiij,
|
|
11168
11193
|
dynCall_iijji,
|
|
@@ -11173,7 +11198,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11173
11198
|
dynCall_iiiiiiii,
|
|
11174
11199
|
dynCall_iiiiiiiiiiii,
|
|
11175
11200
|
dynCall_iiiiiiiii,
|
|
11176
|
-
dynCall_viiiiiii,
|
|
11177
11201
|
dynCall_vji,
|
|
11178
11202
|
dynCall_vijj,
|
|
11179
11203
|
dynCall_iijiji,
|
|
@@ -11182,6 +11206,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11182
11206
|
dynCall_viiiiii,
|
|
11183
11207
|
dynCall_viiiiiiiii,
|
|
11184
11208
|
dynCall_vidi,
|
|
11209
|
+
dynCall_vj,
|
|
11185
11210
|
dynCall_iiijii,
|
|
11186
11211
|
dynCall_iiidii,
|
|
11187
11212
|
dynCall_jiiji,
|
|
@@ -11194,9 +11219,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11194
11219
|
dynCall_iiiiiij,
|
|
11195
11220
|
dynCall_iiid,
|
|
11196
11221
|
dynCall_dii,
|
|
11197
|
-
dynCall_vid,
|
|
11198
|
-
dynCall_vij,
|
|
11199
|
-
dynCall_di,
|
|
11200
11222
|
dynCall_iiiiijii,
|
|
11201
11223
|
dynCall_j,
|
|
11202
11224
|
dynCall_iiiiji,
|
|
@@ -11297,6 +11319,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11297
11319
|
wasmExports['_php_stream_get_line'];
|
|
11298
11320
|
__php_stream_open_wrapper_ex = Module['__php_stream_open_wrapper_ex'] =
|
|
11299
11321
|
wasmExports['_php_stream_open_wrapper_ex'];
|
|
11322
|
+
__efree = Module['__efree'] = wasmExports['_efree'];
|
|
11300
11323
|
__emalloc_24 = Module['__emalloc_24'] = wasmExports['_emalloc_24'];
|
|
11301
11324
|
__emalloc_32 = Module['__emalloc_32'] = wasmExports['_emalloc_32'];
|
|
11302
11325
|
__emalloc_40 = Module['__emalloc_40'] = wasmExports['_emalloc_40'];
|
|
@@ -11306,7 +11329,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11306
11329
|
__emalloc_160 = Module['__emalloc_160'] = wasmExports['_emalloc_160'];
|
|
11307
11330
|
__efree_56 = Module['__efree_56'] = wasmExports['_efree_56'];
|
|
11308
11331
|
__emalloc = Module['__emalloc'] = wasmExports['_emalloc'];
|
|
11309
|
-
__efree = Module['__efree'] = wasmExports['_efree'];
|
|
11310
11332
|
__erealloc = Module['__erealloc'] = wasmExports['_erealloc'];
|
|
11311
11333
|
__safe_emalloc = Module['__safe_emalloc'] =
|
|
11312
11334
|
wasmExports['_safe_emalloc'];
|
|
@@ -11714,12 +11736,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11714
11736
|
_free = Module['_free'] = wasmExports['free'];
|
|
11715
11737
|
_clock_gettime = Module['_clock_gettime'] =
|
|
11716
11738
|
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
11739
|
_dlopen = Module['_dlopen'] = wasmExports['dlopen'];
|
|
11724
11740
|
_fiprintf = Module['_fiprintf'] = wasmExports['fiprintf'];
|
|
11725
11741
|
_dlsym = Module['_dlsym'] = wasmExports['dlsym'];
|
|
@@ -11728,13 +11744,19 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11728
11744
|
_getenv = Module['_getenv'] = wasmExports['getenv'];
|
|
11729
11745
|
_explicit_bzero = Module['_explicit_bzero'] =
|
|
11730
11746
|
wasmExports['explicit_bzero'];
|
|
11747
|
+
_malloc =
|
|
11748
|
+
PHPLoader['malloc'] =
|
|
11749
|
+
Module['_malloc'] =
|
|
11750
|
+
wasmExports['malloc'];
|
|
11731
11751
|
___wasm_setjmp = Module['___wasm_setjmp'] =
|
|
11732
11752
|
wasmExports['__wasm_setjmp'];
|
|
11733
11753
|
___wasm_setjmp_test = Module['___wasm_setjmp_test'] =
|
|
11734
11754
|
wasmExports['__wasm_setjmp_test'];
|
|
11735
11755
|
_emscripten_longjmp = Module['_emscripten_longjmp'] =
|
|
11736
11756
|
wasmExports['emscripten_longjmp'];
|
|
11757
|
+
_snprintf = Module['_snprintf'] = wasmExports['snprintf'];
|
|
11737
11758
|
_atoi = Module['_atoi'] = wasmExports['atoi'];
|
|
11759
|
+
_strchr = Module['_strchr'] = wasmExports['strchr'];
|
|
11738
11760
|
___errno_location = Module['___errno_location'] =
|
|
11739
11761
|
wasmExports['__errno_location'];
|
|
11740
11762
|
_strtoull = Module['_strtoull'] = wasmExports['strtoull'];
|
|
@@ -11970,11 +11992,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11970
11992
|
dynCall_jiiii = dynCalls['jiiii'] = wasmExports['dynCall_jiiii'];
|
|
11971
11993
|
dynCall_iiiiiiiiii = dynCalls['iiiiiiiiii'] =
|
|
11972
11994
|
wasmExports['dynCall_iiiiiiiiii'];
|
|
11995
|
+
dynCall_viiiiiii = dynCalls['viiiiiii'] =
|
|
11996
|
+
wasmExports['dynCall_viiiiiii'];
|
|
11997
|
+
dynCall_ji = dynCalls['ji'] = wasmExports['dynCall_ji'];
|
|
11998
|
+
dynCall_di = dynCalls['di'] = wasmExports['dynCall_di'];
|
|
11999
|
+
dynCall_vij = dynCalls['vij'] = wasmExports['dynCall_vij'];
|
|
12000
|
+
dynCall_vid = dynCalls['vid'] = wasmExports['dynCall_vid'];
|
|
11973
12001
|
dynCall_vjiii = dynCalls['vjiii'] = wasmExports['dynCall_vjiii'];
|
|
11974
12002
|
dynCall_iiji = dynCalls['iiji'] = wasmExports['dynCall_iiji'];
|
|
11975
12003
|
dynCall_iidddd = dynCalls['iidddd'] = wasmExports['dynCall_iidddd'];
|
|
11976
12004
|
dynCall_iijjjj = dynCalls['iijjjj'] = wasmExports['dynCall_iijjjj'];
|
|
11977
|
-
dynCall_ji = dynCalls['ji'] = wasmExports['dynCall_ji'];
|
|
11978
12005
|
dynCall_viji = dynCalls['viji'] = wasmExports['dynCall_viji'];
|
|
11979
12006
|
dynCall_iiij = dynCalls['iiij'] = wasmExports['dynCall_iiij'];
|
|
11980
12007
|
dynCall_iijji = dynCalls['iijji'] = wasmExports['dynCall_iijji'];
|
|
@@ -11990,8 +12017,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
11990
12017
|
wasmExports['dynCall_iiiiiiiiiiii'];
|
|
11991
12018
|
dynCall_iiiiiiiii = dynCalls['iiiiiiiii'] =
|
|
11992
12019
|
wasmExports['dynCall_iiiiiiiii'];
|
|
11993
|
-
dynCall_viiiiiii = dynCalls['viiiiiii'] =
|
|
11994
|
-
wasmExports['dynCall_viiiiiii'];
|
|
11995
12020
|
dynCall_vji = dynCalls['vji'] = wasmExports['dynCall_vji'];
|
|
11996
12021
|
dynCall_vijj = dynCalls['vijj'] = wasmExports['dynCall_vijj'];
|
|
11997
12022
|
dynCall_iijiji = dynCalls['iijiji'] = wasmExports['dynCall_iijiji'];
|
|
@@ -12001,6 +12026,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12001
12026
|
dynCall_viiiiiiiii = dynCalls['viiiiiiiii'] =
|
|
12002
12027
|
wasmExports['dynCall_viiiiiiiii'];
|
|
12003
12028
|
dynCall_vidi = dynCalls['vidi'] = wasmExports['dynCall_vidi'];
|
|
12029
|
+
dynCall_vj = dynCalls['vj'] = wasmExports['dynCall_vj'];
|
|
12004
12030
|
dynCall_iiijii = dynCalls['iiijii'] = wasmExports['dynCall_iiijii'];
|
|
12005
12031
|
dynCall_iiidii = dynCalls['iiidii'] = wasmExports['dynCall_iiidii'];
|
|
12006
12032
|
dynCall_jiiji = dynCalls['jiiji'] = wasmExports['dynCall_jiiji'];
|
|
@@ -12013,9 +12039,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12013
12039
|
dynCall_iiiiiij = dynCalls['iiiiiij'] = wasmExports['dynCall_iiiiiij'];
|
|
12014
12040
|
dynCall_iiid = dynCalls['iiid'] = wasmExports['dynCall_iiid'];
|
|
12015
12041
|
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
12042
|
dynCall_iiiiijii = dynCalls['iiiiijii'] =
|
|
12020
12043
|
wasmExports['dynCall_iiiiijii'];
|
|
12021
12044
|
dynCall_j = dynCalls['j'] = wasmExports['dynCall_j'];
|
|
@@ -12062,110 +12085,110 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12062
12085
|
wasmExports['__indirect_function_table'];
|
|
12063
12086
|
}
|
|
12064
12087
|
|
|
12065
|
-
var _core_globals = (Module['_core_globals'] =
|
|
12088
|
+
var _core_globals = (Module['_core_globals'] = 18176320);
|
|
12066
12089
|
|
|
12067
|
-
var _php_ini_opened_path = (Module['_php_ini_opened_path'] =
|
|
12090
|
+
var _php_ini_opened_path = (Module['_php_ini_opened_path'] = 18064160);
|
|
12068
12091
|
|
|
12069
|
-
var _php_ini_scanned_path = (Module['_php_ini_scanned_path'] =
|
|
12092
|
+
var _php_ini_scanned_path = (Module['_php_ini_scanned_path'] = 18064164);
|
|
12070
12093
|
|
|
12071
|
-
var _php_ini_scanned_files = (Module['_php_ini_scanned_files'] =
|
|
12094
|
+
var _php_ini_scanned_files = (Module['_php_ini_scanned_files'] = 18064168);
|
|
12072
12095
|
|
|
12073
|
-
var _sapi_module = (Module['_sapi_module'] =
|
|
12096
|
+
var _sapi_module = (Module['_sapi_module'] = 18059328);
|
|
12074
12097
|
|
|
12075
|
-
var _sapi_globals = (Module['_sapi_globals'] =
|
|
12098
|
+
var _sapi_globals = (Module['_sapi_globals'] = 18059480);
|
|
12076
12099
|
|
|
12077
|
-
var _module_registry = (Module['_module_registry'] =
|
|
12100
|
+
var _module_registry = (Module['_module_registry'] = 18178208);
|
|
12078
12101
|
|
|
12079
|
-
var _zend_ce_closure = (Module['_zend_ce_closure'] =
|
|
12102
|
+
var _zend_ce_closure = (Module['_zend_ce_closure'] = 18177196);
|
|
12080
12103
|
|
|
12081
|
-
var _compiler_globals = (Module['_compiler_globals'] =
|
|
12104
|
+
var _compiler_globals = (Module['_compiler_globals'] = 18180888);
|
|
12082
12105
|
|
|
12083
|
-
var _executor_globals = (Module['_executor_globals'] =
|
|
12106
|
+
var _executor_globals = (Module['_executor_globals'] = 18181304);
|
|
12084
12107
|
|
|
12085
|
-
var _zend_compile_file = (Module['_zend_compile_file'] =
|
|
12108
|
+
var _zend_compile_file = (Module['_zend_compile_file'] = 18182736);
|
|
12086
12109
|
|
|
12087
|
-
var _zend_ce_exception = (Module['_zend_ce_exception'] =
|
|
12110
|
+
var _zend_ce_exception = (Module['_zend_ce_exception'] = 18177324);
|
|
12088
12111
|
|
|
12089
|
-
var _zend_ce_error = (Module['_zend_ce_error'] =
|
|
12112
|
+
var _zend_ce_error = (Module['_zend_ce_error'] = 18177448);
|
|
12090
12113
|
|
|
12091
12114
|
var _zend_throw_exception_hook = (Module['_zend_throw_exception_hook'] =
|
|
12092
|
-
|
|
12115
|
+
18177320);
|
|
12093
12116
|
|
|
12094
|
-
var _zend_ce_throwable = (Module['_zend_ce_throwable'] =
|
|
12117
|
+
var _zend_ce_throwable = (Module['_zend_ce_throwable'] = 18177328);
|
|
12095
12118
|
|
|
12096
|
-
var _zend_execute_ex = (Module['_zend_execute_ex'] =
|
|
12119
|
+
var _zend_execute_ex = (Module['_zend_execute_ex'] = 18180864);
|
|
12097
12120
|
|
|
12098
|
-
var _zend_execute_internal = (Module['_zend_execute_internal'] =
|
|
12121
|
+
var _zend_execute_internal = (Module['_zend_execute_internal'] = 18180868);
|
|
12099
12122
|
|
|
12100
|
-
var _zend_pass_function = (Module['_zend_pass_function'] =
|
|
12123
|
+
var _zend_pass_function = (Module['_zend_pass_function'] = 17542944);
|
|
12101
12124
|
|
|
12102
|
-
var _zend_extensions = (Module['_zend_extensions'] =
|
|
12125
|
+
var _zend_extensions = (Module['_zend_extensions'] = 18177164);
|
|
12103
12126
|
|
|
12104
|
-
var _gc_collect_cycles = (Module['_gc_collect_cycles'] =
|
|
12127
|
+
var _gc_collect_cycles = (Module['_gc_collect_cycles'] = 18178592);
|
|
12105
12128
|
|
|
12106
|
-
var _zend_empty_array = (Module['_zend_empty_array'] =
|
|
12129
|
+
var _zend_empty_array = (Module['_zend_empty_array'] = 17542064);
|
|
12107
12130
|
|
|
12108
|
-
var _zend_ce_aggregate = (Module['_zend_ce_aggregate'] =
|
|
12131
|
+
var _zend_ce_aggregate = (Module['_zend_ce_aggregate'] = 18058688);
|
|
12109
12132
|
|
|
12110
|
-
var _zend_ce_iterator = (Module['_zend_ce_iterator'] =
|
|
12133
|
+
var _zend_ce_iterator = (Module['_zend_ce_iterator'] = 18058692);
|
|
12111
12134
|
|
|
12112
|
-
var _zend_ce_countable = (Module['_zend_ce_countable'] =
|
|
12135
|
+
var _zend_ce_countable = (Module['_zend_ce_countable'] = 18058704);
|
|
12113
12136
|
|
|
12114
|
-
var _std_object_handlers = (Module['_std_object_handlers'] =
|
|
12137
|
+
var _std_object_handlers = (Module['_std_object_handlers'] = 17539856);
|
|
12115
12138
|
|
|
12116
|
-
var _zend_empty_string = (Module['_zend_empty_string'] =
|
|
12139
|
+
var _zend_empty_string = (Module['_zend_empty_string'] = 18178596);
|
|
12117
12140
|
|
|
12118
|
-
var _zend_known_strings = (Module['_zend_known_strings'] =
|
|
12141
|
+
var _zend_known_strings = (Module['_zend_known_strings'] = 18178600);
|
|
12119
12142
|
|
|
12120
12143
|
var _zend_string_init_interned = (Module['_zend_string_init_interned'] =
|
|
12121
|
-
|
|
12144
|
+
18178668);
|
|
12122
12145
|
|
|
12123
|
-
var _zend_write = (Module['_zend_write'] =
|
|
12146
|
+
var _zend_write = (Module['_zend_write'] = 18179748);
|
|
12124
12147
|
|
|
12125
|
-
var _zend_error_cb = (Module['_zend_error_cb'] =
|
|
12148
|
+
var _zend_error_cb = (Module['_zend_error_cb'] = 18179752);
|
|
12126
12149
|
|
|
12127
|
-
var _zend_post_startup_cb = (Module['_zend_post_startup_cb'] =
|
|
12150
|
+
var _zend_post_startup_cb = (Module['_zend_post_startup_cb'] = 18179720);
|
|
12128
12151
|
|
|
12129
12152
|
var ___memory_base = (Module['___memory_base'] = 0);
|
|
12130
12153
|
|
|
12131
12154
|
var ___table_base = (Module['___table_base'] = 1);
|
|
12132
12155
|
|
|
12133
|
-
var _stderr = (Module['_stderr'] =
|
|
12156
|
+
var _stderr = (Module['_stderr'] = 18051376);
|
|
12134
12157
|
|
|
12135
|
-
var ___THREW__ = (Module['___THREW__'] =
|
|
12158
|
+
var ___THREW__ = (Module['___THREW__'] = 18531092);
|
|
12136
12159
|
|
|
12137
|
-
var ___threwValue = (Module['___threwValue'] =
|
|
12160
|
+
var ___threwValue = (Module['___threwValue'] = 18531096);
|
|
12138
12161
|
|
|
12139
|
-
var _stdout = (Module['_stdout'] =
|
|
12162
|
+
var _stdout = (Module['_stdout'] = 18051680);
|
|
12140
12163
|
|
|
12141
|
-
var _timezone = (Module['_timezone'] =
|
|
12164
|
+
var _timezone = (Module['_timezone'] = 18518016);
|
|
12142
12165
|
|
|
12143
|
-
var _tzname = (Module['_tzname'] =
|
|
12166
|
+
var _tzname = (Module['_tzname'] = 18518024);
|
|
12144
12167
|
|
|
12145
|
-
var ___heap_base =
|
|
12168
|
+
var ___heap_base = 19579760;
|
|
12146
12169
|
|
|
12147
12170
|
var __ZNSt3__25ctypeIcE2idE = (Module['__ZNSt3__25ctypeIcE2idE'] =
|
|
12148
|
-
|
|
12171
|
+
18531172);
|
|
12149
12172
|
|
|
12150
12173
|
var __ZTVN10__cxxabiv120__si_class_type_infoE = (Module[
|
|
12151
12174
|
'__ZTVN10__cxxabiv120__si_class_type_infoE'
|
|
12152
|
-
] =
|
|
12175
|
+
] = 18051928);
|
|
12153
12176
|
|
|
12154
12177
|
var __ZTVN10__cxxabiv117__class_type_infoE = (Module[
|
|
12155
12178
|
'__ZTVN10__cxxabiv117__class_type_infoE'
|
|
12156
|
-
] =
|
|
12179
|
+
] = 18051888);
|
|
12157
12180
|
|
|
12158
12181
|
var __ZTVN10__cxxabiv121__vmi_class_type_infoE = (Module[
|
|
12159
12182
|
'__ZTVN10__cxxabiv121__vmi_class_type_infoE'
|
|
12160
|
-
] =
|
|
12183
|
+
] = 18051980);
|
|
12161
12184
|
|
|
12162
12185
|
var __ZTISt20bad_array_new_length = (Module[
|
|
12163
12186
|
'__ZTISt20bad_array_new_length'
|
|
12164
|
-
] =
|
|
12187
|
+
] = 18052052);
|
|
12165
12188
|
|
|
12166
|
-
var __ZTVSt12length_error = (Module['__ZTVSt12length_error'] =
|
|
12189
|
+
var __ZTVSt12length_error = (Module['__ZTVSt12length_error'] = 18052096);
|
|
12167
12190
|
|
|
12168
|
-
var __ZTISt12length_error = (Module['__ZTISt12length_error'] =
|
|
12191
|
+
var __ZTISt12length_error = (Module['__ZTISt12length_error'] = 18052116);
|
|
12169
12192
|
|
|
12170
12193
|
var wasmImports = {
|
|
12171
12194
|
/** @export */ __assert_fail: ___assert_fail,
|
|
@@ -12254,6 +12277,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12254
12277
|
/** @export */ getnameinfo: _getnameinfo,
|
|
12255
12278
|
/** @export */ getprotobyname: _getprotobyname,
|
|
12256
12279
|
/** @export */ getprotobynumber: _getprotobynumber,
|
|
12280
|
+
/** @export */ invoke_di,
|
|
12257
12281
|
/** @export */ invoke_dii,
|
|
12258
12282
|
/** @export */ invoke_i,
|
|
12259
12283
|
/** @export */ invoke_id,
|
|
@@ -12285,6 +12309,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12285
12309
|
/** @export */ invoke_jiji,
|
|
12286
12310
|
/** @export */ invoke_v,
|
|
12287
12311
|
/** @export */ invoke_vi,
|
|
12312
|
+
/** @export */ invoke_vid,
|
|
12288
12313
|
/** @export */ invoke_vii,
|
|
12289
12314
|
/** @export */ invoke_viid,
|
|
12290
12315
|
/** @export */ invoke_viidddddddd,
|
|
@@ -12301,6 +12326,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12301
12326
|
/** @export */ invoke_viiij,
|
|
12302
12327
|
/** @export */ invoke_vij,
|
|
12303
12328
|
/** @export */ invoke_vijj,
|
|
12329
|
+
/** @export */ invoke_vj,
|
|
12304
12330
|
/** @export */ invoke_vji,
|
|
12305
12331
|
/** @export */ js_fd_read,
|
|
12306
12332
|
/** @export */ js_flock: _js_flock,
|
|
@@ -12481,6 +12507,29 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12481
12507
|
}
|
|
12482
12508
|
}
|
|
12483
12509
|
|
|
12510
|
+
function invoke_ji(index, a1) {
|
|
12511
|
+
var sp = stackSave();
|
|
12512
|
+
try {
|
|
12513
|
+
return dynCalls['ji'](index, a1);
|
|
12514
|
+
} catch (e) {
|
|
12515
|
+
stackRestore(sp);
|
|
12516
|
+
if (e !== e + 0) throw e;
|
|
12517
|
+
_setThrew(1, 0);
|
|
12518
|
+
return 0n;
|
|
12519
|
+
}
|
|
12520
|
+
}
|
|
12521
|
+
|
|
12522
|
+
function invoke_vj(index, a1) {
|
|
12523
|
+
var sp = stackSave();
|
|
12524
|
+
try {
|
|
12525
|
+
dynCalls['vj'](index, a1);
|
|
12526
|
+
} catch (e) {
|
|
12527
|
+
stackRestore(sp);
|
|
12528
|
+
if (e !== e + 0) throw e;
|
|
12529
|
+
_setThrew(1, 0);
|
|
12530
|
+
}
|
|
12531
|
+
}
|
|
12532
|
+
|
|
12484
12533
|
function invoke_iiiiii(index, a1, a2, a3, a4, a5) {
|
|
12485
12534
|
var sp = stackSave();
|
|
12486
12535
|
try {
|
|
@@ -12537,10 +12586,10 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12537
12586
|
}
|
|
12538
12587
|
}
|
|
12539
12588
|
|
|
12540
|
-
function
|
|
12589
|
+
function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
|
|
12541
12590
|
var sp = stackSave();
|
|
12542
12591
|
try {
|
|
12543
|
-
|
|
12592
|
+
dynCalls['viiiiiii'](index, a1, a2, a3, a4, a5, a6, a7);
|
|
12544
12593
|
} catch (e) {
|
|
12545
12594
|
stackRestore(sp);
|
|
12546
12595
|
if (e !== e + 0) throw e;
|
|
@@ -12548,15 +12597,47 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12548
12597
|
}
|
|
12549
12598
|
}
|
|
12550
12599
|
|
|
12551
|
-
function
|
|
12600
|
+
function invoke_di(index, a1) {
|
|
12552
12601
|
var sp = stackSave();
|
|
12553
12602
|
try {
|
|
12554
|
-
return dynCalls['
|
|
12603
|
+
return dynCalls['di'](index, a1);
|
|
12604
|
+
} catch (e) {
|
|
12605
|
+
stackRestore(sp);
|
|
12606
|
+
if (e !== e + 0) throw e;
|
|
12607
|
+
_setThrew(1, 0);
|
|
12608
|
+
}
|
|
12609
|
+
}
|
|
12610
|
+
|
|
12611
|
+
function invoke_vij(index, a1, a2) {
|
|
12612
|
+
var sp = stackSave();
|
|
12613
|
+
try {
|
|
12614
|
+
dynCalls['vij'](index, a1, a2);
|
|
12615
|
+
} catch (e) {
|
|
12616
|
+
stackRestore(sp);
|
|
12617
|
+
if (e !== e + 0) throw e;
|
|
12618
|
+
_setThrew(1, 0);
|
|
12619
|
+
}
|
|
12620
|
+
}
|
|
12621
|
+
|
|
12622
|
+
function invoke_vid(index, a1, a2) {
|
|
12623
|
+
var sp = stackSave();
|
|
12624
|
+
try {
|
|
12625
|
+
dynCalls['vid'](index, a1, a2);
|
|
12626
|
+
} catch (e) {
|
|
12627
|
+
stackRestore(sp);
|
|
12628
|
+
if (e !== e + 0) throw e;
|
|
12629
|
+
_setThrew(1, 0);
|
|
12630
|
+
}
|
|
12631
|
+
}
|
|
12632
|
+
|
|
12633
|
+
function invoke_iiij(index, a1, a2, a3) {
|
|
12634
|
+
var sp = stackSave();
|
|
12635
|
+
try {
|
|
12636
|
+
return dynCalls['iiij'](index, a1, a2, a3);
|
|
12555
12637
|
} catch (e) {
|
|
12556
12638
|
stackRestore(sp);
|
|
12557
12639
|
if (e !== e + 0) throw e;
|
|
12558
12640
|
_setThrew(1, 0);
|
|
12559
|
-
return 0n;
|
|
12560
12641
|
}
|
|
12561
12642
|
}
|
|
12562
12643
|
|
|
@@ -12648,17 +12729,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12648
12729
|
}
|
|
12649
12730
|
}
|
|
12650
12731
|
|
|
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
12732
|
function invoke_iiiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8) {
|
|
12663
12733
|
var sp = stackSave();
|
|
12664
12734
|
try {
|
|
@@ -12943,17 +13013,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
12943
13013
|
}
|
|
12944
13014
|
}
|
|
12945
13015
|
|
|
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
13016
|
function invoke_dii(index, a1, a2) {
|
|
12958
13017
|
var sp = stackSave();
|
|
12959
13018
|
try {
|