@php-wasm/web-8-0 3.1.2 → 3.1.4

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.
Binary file
@@ -1,6 +1,6 @@
1
1
  import dependencyFilename from './8_0_30/php_8_0.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 20682519;
3
+ export const dependenciesTotalSize = 20696339;
4
4
  const phpVersionString = '8.0.30';
5
5
  export function init(RuntimeName, PHPLoader) {
6
6
  // The rest of the code comes from the built php.js file and esm-suffix.js
@@ -4930,6 +4930,8 @@ export function init(RuntimeName, PHPLoader) {
4930
4930
  }
4931
4931
  ___syscall_chmod.sig = 'ipi';
4932
4932
  var allocateUTF8OnStack = (...args) => stringToUTF8OnStack(...args);
4933
+ var onInits = [];
4934
+ var addOnInit = (cb) => onInits.push(cb);
4933
4935
  function _js_getpid() {
4934
4936
  return PHPLoader.processId ?? 42;
4935
4937
  }
@@ -4946,8 +4948,13 @@ export function init(RuntimeName, PHPLoader) {
4946
4948
  init: function () {
4947
4949
  if (PHPLoader.bindUserSpace) {
4948
4950
  addOnInit(() => {
4951
+ if (typeof PHPLoader.processId !== 'number') {
4952
+ throw new Error(
4953
+ 'PHPLoader.processId must be set before init'
4954
+ );
4955
+ }
4949
4956
  Module['userSpace'] = PHPLoader.bindUserSpace({
4950
- pid: PHPLoader.processId ?? 42,
4957
+ pid: PHPLoader.processId,
4951
4958
  constants: {
4952
4959
  F_GETFL: Number('3'),
4953
4960
  O_ACCMODE: Number('2097155'),
@@ -4985,18 +4992,97 @@ export function init(RuntimeName, PHPLoader) {
4985
4992
  },
4986
4993
  errnoCodes: ERRNO_CODES,
4987
4994
  memory: {
4988
- HEAP8,
4989
- HEAPU8,
4990
- HEAP16,
4991
- HEAPU16,
4992
- HEAP32,
4993
- HEAPU32,
4994
- HEAPF32,
4995
- HEAP64,
4996
- HEAPU64,
4997
- HEAPF64,
4995
+ HEAP8: {
4996
+ get(offset) {
4997
+ return HEAP8[offset];
4998
+ },
4999
+ set(offset, value) {
5000
+ HEAP8[offset] = value;
5001
+ },
5002
+ },
5003
+ HEAPU8: {
5004
+ get(offset) {
5005
+ return HEAPU8[offset];
5006
+ },
5007
+ set(offset, value) {
5008
+ HEAPU8[offset] = value;
5009
+ },
5010
+ },
5011
+ HEAP16: {
5012
+ get(offset) {
5013
+ return HEAP16[offset];
5014
+ },
5015
+ set(offset, value) {
5016
+ HEAP16[offset] = value;
5017
+ },
5018
+ },
5019
+ HEAPU16: {
5020
+ get(offset) {
5021
+ return HEAPU16[offset];
5022
+ },
5023
+ set(offset, value) {
5024
+ HEAPU16[offset] = value;
5025
+ },
5026
+ },
5027
+ HEAP32: {
5028
+ get(offset) {
5029
+ return HEAP32[offset];
5030
+ },
5031
+ set(offset, value) {
5032
+ HEAP32[offset] = value;
5033
+ },
5034
+ },
5035
+ HEAPU32: {
5036
+ get(offset) {
5037
+ return HEAPU32[offset];
5038
+ },
5039
+ set(offset, value) {
5040
+ HEAPU32[offset] = value;
5041
+ },
5042
+ },
5043
+ HEAPF32: {
5044
+ get(offset) {
5045
+ return HEAPF32[offset];
5046
+ },
5047
+ set(offset, value) {
5048
+ HEAPF32[offset] = value;
5049
+ },
5050
+ },
5051
+ HEAP64: {
5052
+ get(offset) {
5053
+ return HEAP64[offset];
5054
+ },
5055
+ set(offset, value) {
5056
+ HEAP64[offset] = value;
5057
+ },
5058
+ },
5059
+ HEAPU64: {
5060
+ get(offset) {
5061
+ return HEAPU64[offset];
5062
+ },
5063
+ set(offset, value) {
5064
+ HEAPU64[offset] = value;
5065
+ },
5066
+ },
5067
+ HEAPF64: {
5068
+ get(offset) {
5069
+ return HEAPF64[offset];
5070
+ },
5071
+ set(offset, value) {
5072
+ HEAPF64[offset] = value;
5073
+ },
5074
+ },
4998
5075
  },
4999
- wasmImports,
5076
+ wasmImports: Object.assign(
5077
+ {},
5078
+ wasmImports,
5079
+ typeof _builtin_fd_close === 'function'
5080
+ ? { builtin_fd_close: _builtin_fd_close }
5081
+ : {},
5082
+ typeof _builtin_fcntl64 === 'function'
5083
+ ? { builtin_fcntl64: _builtin_fcntl64 }
5084
+ : {}
5085
+ ),
5000
5086
  wasmExports,
5001
5087
  syscalls: SYSCALLS,
5002
5088
  FS,
@@ -13700,9 +13786,9 @@ export function init(RuntimeName, PHPLoader) {
13700
13786
  if (!cp.stdin.closed) {
13701
13787
  cp.stdin.end();
13702
13788
  }
13703
- _free(buffer);
13704
- _free(iov);
13705
- _free(pnum);
13789
+ _wasm_free(buffer);
13790
+ _wasm_free(iov);
13791
+ _wasm_free(pnum);
13706
13792
  }
13707
13793
  const interval = setInterval(pump, 20);
13708
13794
  pump();
@@ -14246,7 +14332,17 @@ export function init(RuntimeName, PHPLoader) {
14246
14332
  reachedAfterCallback = true;
14247
14333
  if (!reachedCallback) {
14248
14334
  Asyncify.state = Asyncify.State.Unwinding;
14249
- Asyncify.currData = Asyncify.allocateData();
14335
+ if (!Asyncify._cachedData) {
14336
+ Asyncify._cachedData = Asyncify.allocateData();
14337
+ } else {
14338
+ Asyncify.setDataHeader(
14339
+ Asyncify._cachedData,
14340
+ Asyncify._cachedData + 12,
14341
+ Asyncify.StackSize
14342
+ );
14343
+ Asyncify.setDataRewindFunc(Asyncify._cachedData);
14344
+ }
14345
+ Asyncify.currData = Asyncify._cachedData;
14250
14346
  if (typeof MainLoop != 'undefined' && MainLoop.func) {
14251
14347
  MainLoop.pause();
14252
14348
  }
@@ -14257,7 +14353,6 @@ export function init(RuntimeName, PHPLoader) {
14257
14353
  } else if (Asyncify.state === Asyncify.State.Rewinding) {
14258
14354
  Asyncify.state = Asyncify.State.Normal;
14259
14355
  runAndAbortIfError(_asyncify_stop_rewind);
14260
- _free(Asyncify.currData);
14261
14356
  Asyncify.currData = null;
14262
14357
  Asyncify.sleepCallbacks.forEach(callUserCallback);
14263
14358
  } else {
@@ -14585,8 +14680,6 @@ export function init(RuntimeName, PHPLoader) {
14585
14680
  } while (HEAPU32[ptr >> 2]);
14586
14681
  };
14587
14682
  __emscripten_fs_load_embedded_files.sig = 'vp';
14588
- var onInits = [];
14589
- var addOnInit = (cb) => onInits.push(cb);
14590
14683
  var onMains = [];
14591
14684
  var addOnPreMain = (cb) => onMains.push(cb);
14592
14685
  var onExits = [];
@@ -24493,24 +24586,6 @@ export function init(RuntimeName, PHPLoader) {
24493
24586
  poll();
24494
24587
  });
24495
24588
  };
24496
- function _recv(sockfd, buffer, size, flags) {
24497
- return _wasm_recv(sockfd, buffer, size, flags);
24498
- }
24499
- function _setsockopt(
24500
- socketd,
24501
- level,
24502
- optionName,
24503
- optionValuePtr,
24504
- optionLen
24505
- ) {
24506
- return _wasm_setsockopt(
24507
- socketd,
24508
- level,
24509
- optionName,
24510
- optionValuePtr,
24511
- optionLen
24512
- );
24513
- }
24514
24589
  var _getcontext = () => abort('missing function: ${name}');
24515
24590
  var _makecontext = () => abort('missing function: ${name}');
24516
24591
  var _swapcontext = () => abort('missing function: ${name}');
@@ -24887,16 +24962,14 @@ export function init(RuntimeName, PHPLoader) {
24887
24962
  Module['___cxa_rethrow_primary_exception'] =
24888
24963
  ___cxa_rethrow_primary_exception;
24889
24964
  Module['___syscall_shutdown'] = ___syscall_shutdown;
24890
- Module['_recv'] = _recv;
24891
- Module['_setsockopt'] = _setsockopt;
24892
24965
  var ASM_CONSTS = {
24893
- 12292609: ($0) => {
24966
+ 12292545: ($0) => {
24894
24967
  if (!$0) {
24895
24968
  AL.alcErr = 40964;
24896
24969
  return 1;
24897
24970
  }
24898
24971
  },
24899
- 12292657: ($0) => {
24972
+ 12292593: ($0) => {
24900
24973
  if (!AL.currentCtx) {
24901
24974
  err('alGetProcAddress() called without a valid context');
24902
24975
  return 1;
@@ -25370,7 +25443,7 @@ export function init(RuntimeName, PHPLoader) {
25370
25443
  __indirect_function_table = wasmTable =
25371
25444
  wasmExports['__indirect_function_table'];
25372
25445
  }
25373
- var ___heap_base = 13572672;
25446
+ var ___heap_base = 13572608;
25374
25447
  var wasmImports = {
25375
25448
  IMG_Init: _IMG_Init,
25376
25449
  IMG_Load: _IMG_Load,
@@ -26721,11 +26794,7 @@ export function init(RuntimeName, PHPLoader) {
26721
26794
  wasm_connect: _wasm_connect,
26722
26795
  wasm_poll_socket,
26723
26796
  wasm_recv: _wasm_recv,
26724
- /** */
26725
- recv: _recv,
26726
26797
  wasm_setsockopt: _wasm_setsockopt,
26727
- /** */
26728
- setsockopt: _setsockopt,
26729
26798
  wasm_shutdown: _wasm_shutdown,
26730
26799
  zoomSurface: _zoomSurface,
26731
26800
  };
package/index.cjs CHANGED
@@ -44,8 +44,8 @@ async function getPHPLoaderModule() {
44
44
  }
45
45
  async function getIntlExtensionPath() {
46
46
  if (await (0, import_wasm_feature_detect.jspi)()) {
47
- return (await import("./jspi/extensions/intl/8_0/intl.so?url")).default;
47
+ return (await import("./jspi/extensions/intl/intl.so?url")).default;
48
48
  } else {
49
- return (await import("./asyncify/extensions/intl/8_0/intl.so?url")).default;
49
+ return (await import("./asyncify/extensions/intl/intl.so?url")).default;
50
50
  }
51
51
  }
package/index.js CHANGED
@@ -9,9 +9,9 @@ async function getPHPLoaderModule() {
9
9
  }
10
10
  async function getIntlExtensionPath() {
11
11
  if (await jspi()) {
12
- return (await import("./jspi/extensions/intl/8_0/intl.so?url")).default;
12
+ return (await import("./jspi/extensions/intl/intl.so?url")).default;
13
13
  } else {
14
- return (await import("./asyncify/extensions/intl/8_0/intl.so?url")).default;
14
+ return (await import("./asyncify/extensions/intl/intl.so?url")).default;
15
15
  }
16
16
  }
17
17
  export {
Binary file