@php-wasm/node 1.2.2 → 2.0.0

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.
Files changed (44) hide show
  1. package/asyncify/7_2_34/php_7_2.wasm +0 -0
  2. package/asyncify/7_3_33/php_7_3.wasm +0 -0
  3. package/asyncify/7_4_33/php_7_4.wasm +0 -0
  4. package/asyncify/8_0_30/php_8_0.wasm +0 -0
  5. package/asyncify/{8_1_23 → 8_1_33}/php_8_1.wasm +0 -0
  6. package/asyncify/{8_2_10 → 8_2_29}/php_8_2.wasm +0 -0
  7. package/asyncify/{8_3_0 → 8_3_23}/php_8_3.wasm +0 -0
  8. package/asyncify/{8_4_0 → 8_4_10}/php_8_4.wasm +0 -0
  9. package/asyncify/extensions/xdebug/7_2/xdebug.so +0 -0
  10. package/asyncify/extensions/xdebug/7_3/xdebug.so +0 -0
  11. package/asyncify/extensions/xdebug/7_4/xdebug.so +0 -0
  12. package/asyncify/extensions/xdebug/8_0/xdebug.so +0 -0
  13. package/asyncify/extensions/xdebug/8_1/xdebug.so +0 -0
  14. package/asyncify/extensions/xdebug/8_2/xdebug.so +0 -0
  15. package/asyncify/extensions/xdebug/8_3/xdebug.so +0 -0
  16. package/asyncify/extensions/xdebug/8_4/xdebug.so +0 -0
  17. package/asyncify/php_7_2.js +61 -51
  18. package/asyncify/php_7_3.js +75 -51
  19. package/asyncify/php_7_4.js +88 -51
  20. package/asyncify/php_8_0.js +79 -56
  21. package/asyncify/php_8_1.js +92 -55
  22. package/asyncify/php_8_2.js +92 -55
  23. package/asyncify/php_8_3.js +92 -55
  24. package/asyncify/php_8_4.js +90 -53
  25. package/index.cjs +906 -562
  26. package/index.js +907 -561
  27. package/jspi/7_2_34/php_7_2.wasm +0 -0
  28. package/jspi/7_3_33/php_7_3.wasm +0 -0
  29. package/jspi/7_4_33/php_7_4.wasm +0 -0
  30. package/jspi/8_0_30/php_8_0.wasm +0 -0
  31. package/jspi/{8_1_23 → 8_1_33}/php_8_1.wasm +0 -0
  32. package/jspi/{8_2_10 → 8_2_29}/php_8_2.wasm +0 -0
  33. package/jspi/{8_3_0 → 8_3_23}/php_8_3.wasm +0 -0
  34. package/jspi/{8_4_0 → 8_4_10}/php_8_4.wasm +0 -0
  35. package/jspi/php_7_2.js +29 -15
  36. package/jspi/php_7_3.js +29 -15
  37. package/jspi/php_7_4.js +29 -15
  38. package/jspi/php_8_0.js +29 -15
  39. package/jspi/php_8_1.js +30 -16
  40. package/jspi/php_8_2.js +30 -16
  41. package/jspi/php_8_3.js +30 -16
  42. package/jspi/php_8_4.js +30 -16
  43. package/lib/node-fs-mount.d.ts +1 -1
  44. package/package.json +7 -7
@@ -6,9 +6,10 @@ const require = createRequire(import.meta.url);
6
6
  // Note: The path module is currently needed by code injected by the php-wasm Dockerfile.
7
7
  import path from 'path';
8
8
 
9
- const dependencyFilename = path.join(__dirname, '8_4_0', 'php_8_4.wasm');
9
+ const dependencyFilename = path.join(__dirname, '8_4_10', 'php_8_4.wasm');
10
10
  export { dependencyFilename };
11
- export const dependenciesTotalSize = 36763254;
11
+ export const dependenciesTotalSize = 36942485;
12
+ const phpVersionString = '8.4.10';
12
13
  export function init(RuntimeName, PHPLoader) {
13
14
  // The rest of the code comes from the built php.js file and esm-suffix.js
14
15
  // include: shell.js
@@ -830,7 +831,7 @@ export function init(RuntimeName, PHPLoader) {
830
831
  },
831
832
  };
832
833
 
833
- var ___heap_base = 17316672;
834
+ var ___heap_base = 18313280;
834
835
 
835
836
  var alignMemory = (size, alignment) => {
836
837
  return Math.ceil(size / alignment) * alignment;
@@ -994,7 +995,7 @@ export function init(RuntimeName, PHPLoader) {
994
995
 
995
996
  /** @type {WebAssembly.Table} */
996
997
  var wasmTable = new WebAssembly.Table({
997
- initial: 16834,
998
+ initial: 16954,
998
999
  element: 'anyfunc',
999
1000
  });
1000
1001
  var getWasmTableEntry = (funcPtr) => {
@@ -1853,13 +1854,13 @@ export function init(RuntimeName, PHPLoader) {
1853
1854
  1024
1854
1855
  );
1855
1856
 
1856
- var ___stack_high = 17316672;
1857
+ var ___stack_high = 18313280;
1857
1858
 
1858
- var ___stack_low = 17251136;
1859
+ var ___stack_low = 17264704;
1859
1860
 
1860
1861
  var ___stack_pointer = new WebAssembly.Global(
1861
1862
  { value: 'i32', mutable: true },
1862
- 17316672
1863
+ 18313280
1863
1864
  );
1864
1865
 
1865
1866
  var PATH = {
@@ -3913,10 +3914,6 @@ export function init(RuntimeName, PHPLoader) {
3913
3914
  if (FS.isMountpoint(node)) {
3914
3915
  throw new FS.ErrnoError(10);
3915
3916
  }
3916
-
3917
- if (!FS.isDir(node.mode)) {
3918
- throw new FS.ErrnoError(54);
3919
- }
3920
3917
  }
3921
3918
 
3922
3919
  var mount = {
@@ -17746,10 +17743,6 @@ export function init(RuntimeName, PHPLoader) {
17746
17743
  HEAPU32[iov >> 2] = buffer; // iov_base
17747
17744
  HEAPU32[(iov + 4) >> 2] = CHUNK_SIZE; // iov_len
17748
17745
 
17749
- if (typeof js_fd_read === 'undefined') {
17750
- globalThis.js_fd_read = __asyncjs__js_fd_read;
17751
- }
17752
-
17753
17746
  function pump() {
17754
17747
  try {
17755
17748
  while (true) {
@@ -19611,7 +19604,7 @@ export function init(RuntimeName, PHPLoader) {
19611
19604
 
19612
19605
  var addOnExit = (cb) => onExits.unshift(cb);
19613
19606
 
19614
- var STACK_SIZE = 65536;
19607
+ var STACK_SIZE = 1048576;
19615
19608
 
19616
19609
  var STACK_ALIGN = 16;
19617
19610
 
@@ -31815,13 +31808,13 @@ export function init(RuntimeName, PHPLoader) {
31815
31808
  // End JS library code
31816
31809
 
31817
31810
  var ASM_CONSTS = {
31818
- 16318662: ($0) => {
31811
+ 16327533: ($0) => {
31819
31812
  if (!$0) {
31820
31813
  AL.alcErr = 0xa004;
31821
31814
  return 1;
31822
31815
  }
31823
31816
  },
31824
- 16318710: ($0) => {
31817
+ 16327581: ($0) => {
31825
31818
  if (!AL.currentCtx) {
31826
31819
  err('alGetProcAddress() called without a valid context');
31827
31820
  return 1;
@@ -31943,6 +31936,9 @@ export function init(RuntimeName, PHPLoader) {
31943
31936
  while (true) {
31944
31937
  var mask = POLLNVAL;
31945
31938
  mask = SYSCALLS.DEFAULT_POLLMASK;
31939
+ if (FS.isClosed(stream)) {
31940
+ return ERRNO_CODES.EBADF;
31941
+ }
31946
31942
  if (stream.stream_ops?.poll) {
31947
31943
  mask = stream.stream_ops.poll(stream, -1);
31948
31944
  }
@@ -34581,6 +34577,8 @@ export function init(RuntimeName, PHPLoader) {
34581
34577
  /** @export */
34582
34578
  invoke_iijiji,
34583
34579
  /** @export */
34580
+ invoke_ji,
34581
+ /** @export */
34584
34582
  invoke_jii,
34585
34583
  /** @export */
34586
34584
  invoke_jiii,
@@ -34605,6 +34603,8 @@ export function init(RuntimeName, PHPLoader) {
34605
34603
  /** @export */
34606
34604
  invoke_viijii,
34607
34605
  /** @export */
34606
+ invoke_vijj,
34607
+ /** @export */
34608
34608
  invoke_vji,
34609
34609
  /** @export */
34610
34610
  js_fd_read,
@@ -34729,6 +34729,11 @@ export function init(RuntimeName, PHPLoader) {
34729
34729
  var _calloc = (a0, a1) => (_calloc = wasmExports['calloc'])(a0, a1);
34730
34730
  var _flock = (Module['_flock'] = (a0, a1) =>
34731
34731
  (_flock = Module['_flock'] = wasmExports['flock'])(a0, a1));
34732
+ var _initgroups = (Module['_initgroups'] = (a0, a1) =>
34733
+ (_initgroups = Module['_initgroups'] = wasmExports['initgroups'])(
34734
+ a0,
34735
+ a1
34736
+ ));
34732
34737
  var _wasm_read = (Module['_wasm_read'] = (a0, a1, a2) =>
34733
34738
  (_wasm_read = Module['_wasm_read'] = wasmExports['wasm_read'])(
34734
34739
  a0,
@@ -35033,21 +35038,22 @@ export function init(RuntimeName, PHPLoader) {
35033
35038
  }
35034
35039
  }
35035
35040
 
35036
- function invoke_iijii(index, a1, a2, a3, a4) {
35041
+ function invoke_jii(index, a1, a2) {
35037
35042
  var sp = stackSave();
35038
35043
  try {
35039
- return Module['dynCall_iijii'](index, a1, a2, a3, a4);
35044
+ return Module['dynCall_jii'](index, a1, a2);
35040
35045
  } catch (e) {
35041
35046
  stackRestore(sp);
35042
35047
  if (e !== e + 0) throw e;
35043
35048
  _setThrew(1, 0);
35049
+ return 0n;
35044
35050
  }
35045
35051
  }
35046
35052
 
35047
- function invoke_iijiji(index, a1, a2, a3, a4, a5) {
35053
+ function invoke_v(index) {
35048
35054
  var sp = stackSave();
35049
35055
  try {
35050
- return Module['dynCall_iijiji'](index, a1, a2, a3, a4, a5);
35056
+ Module['dynCall_v'](index);
35051
35057
  } catch (e) {
35052
35058
  stackRestore(sp);
35053
35059
  if (e !== e + 0) throw e;
@@ -35055,19 +35061,10 @@ export function init(RuntimeName, PHPLoader) {
35055
35061
  }
35056
35062
  }
35057
35063
 
35058
- function invoke_iiiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
35064
+ function invoke_vji(index, a1, a2) {
35059
35065
  var sp = stackSave();
35060
35066
  try {
35061
- return Module['dynCall_iiiiiiii'](
35062
- index,
35063
- a1,
35064
- a2,
35065
- a3,
35066
- a4,
35067
- a5,
35068
- a6,
35069
- a7
35070
- );
35067
+ Module['dynCall_vji'](index, a1, a2);
35071
35068
  } catch (e) {
35072
35069
  stackRestore(sp);
35073
35070
  if (e !== e + 0) throw e;
@@ -35075,21 +35072,22 @@ export function init(RuntimeName, PHPLoader) {
35075
35072
  }
35076
35073
  }
35077
35074
 
35078
- function invoke_iiji(index, a1, a2, a3) {
35075
+ function invoke_ji(index, a1) {
35079
35076
  var sp = stackSave();
35080
35077
  try {
35081
- return Module['dynCall_iiji'](index, a1, a2, a3);
35078
+ return Module['dynCall_ji'](index, a1);
35082
35079
  } catch (e) {
35083
35080
  stackRestore(sp);
35084
35081
  if (e !== e + 0) throw e;
35085
35082
  _setThrew(1, 0);
35083
+ return 0n;
35086
35084
  }
35087
35085
  }
35088
35086
 
35089
- function invoke_v(index) {
35087
+ function invoke_vijj(index, a1, a2, a3) {
35090
35088
  var sp = stackSave();
35091
35089
  try {
35092
- Module['dynCall_v'](index);
35090
+ Module['dynCall_vijj'](index, a1, a2, a3);
35093
35091
  } catch (e) {
35094
35092
  stackRestore(sp);
35095
35093
  if (e !== e + 0) throw e;
@@ -35097,10 +35095,10 @@ export function init(RuntimeName, PHPLoader) {
35097
35095
  }
35098
35096
  }
35099
35097
 
35100
- function invoke_iiiiiii(index, a1, a2, a3, a4, a5, a6) {
35098
+ function invoke_iij(index, a1, a2) {
35101
35099
  var sp = stackSave();
35102
35100
  try {
35103
- return Module['dynCall_iiiiiii'](index, a1, a2, a3, a4, a5, a6);
35101
+ return Module['dynCall_iij'](index, a1, a2);
35104
35102
  } catch (e) {
35105
35103
  stackRestore(sp);
35106
35104
  if (e !== e + 0) throw e;
@@ -35108,10 +35106,10 @@ export function init(RuntimeName, PHPLoader) {
35108
35106
  }
35109
35107
  }
35110
35108
 
35111
- function invoke_vji(index, a1, a2) {
35109
+ function invoke_iijii(index, a1, a2, a3, a4) {
35112
35110
  var sp = stackSave();
35113
35111
  try {
35114
- Module['dynCall_vji'](index, a1, a2);
35112
+ return Module['dynCall_iijii'](index, a1, a2, a3, a4);
35115
35113
  } catch (e) {
35116
35114
  stackRestore(sp);
35117
35115
  if (e !== e + 0) throw e;
@@ -35119,10 +35117,10 @@ export function init(RuntimeName, PHPLoader) {
35119
35117
  }
35120
35118
  }
35121
35119
 
35122
- function invoke_viijii(index, a1, a2, a3, a4, a5) {
35120
+ function invoke_iijiji(index, a1, a2, a3, a4, a5) {
35123
35121
  var sp = stackSave();
35124
35122
  try {
35125
- Module['dynCall_viijii'](index, a1, a2, a3, a4, a5);
35123
+ return Module['dynCall_iijiji'](index, a1, a2, a3, a4, a5);
35126
35124
  } catch (e) {
35127
35125
  stackRestore(sp);
35128
35126
  if (e !== e + 0) throw e;
@@ -35130,10 +35128,19 @@ export function init(RuntimeName, PHPLoader) {
35130
35128
  }
35131
35129
  }
35132
35130
 
35133
- function invoke_viidii(index, a1, a2, a3, a4, a5) {
35131
+ function invoke_iiiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
35134
35132
  var sp = stackSave();
35135
35133
  try {
35136
- Module['dynCall_viidii'](index, a1, a2, a3, a4, a5);
35134
+ return Module['dynCall_iiiiiiii'](
35135
+ index,
35136
+ a1,
35137
+ a2,
35138
+ a3,
35139
+ a4,
35140
+ a5,
35141
+ a6,
35142
+ a7
35143
+ );
35137
35144
  } catch (e) {
35138
35145
  stackRestore(sp);
35139
35146
  if (e !== e + 0) throw e;
@@ -35141,34 +35148,32 @@ export function init(RuntimeName, PHPLoader) {
35141
35148
  }
35142
35149
  }
35143
35150
 
35144
- function invoke_jiii(index, a1, a2, a3) {
35151
+ function invoke_iiji(index, a1, a2, a3) {
35145
35152
  var sp = stackSave();
35146
35153
  try {
35147
- return Module['dynCall_jiii'](index, a1, a2, a3);
35154
+ return Module['dynCall_iiji'](index, a1, a2, a3);
35148
35155
  } catch (e) {
35149
35156
  stackRestore(sp);
35150
35157
  if (e !== e + 0) throw e;
35151
35158
  _setThrew(1, 0);
35152
- return 0n;
35153
35159
  }
35154
35160
  }
35155
35161
 
35156
- function invoke_jii(index, a1, a2) {
35162
+ function invoke_iiiiiii(index, a1, a2, a3, a4, a5, a6) {
35157
35163
  var sp = stackSave();
35158
35164
  try {
35159
- return Module['dynCall_jii'](index, a1, a2);
35165
+ return Module['dynCall_iiiiiii'](index, a1, a2, a3, a4, a5, a6);
35160
35166
  } catch (e) {
35161
35167
  stackRestore(sp);
35162
35168
  if (e !== e + 0) throw e;
35163
35169
  _setThrew(1, 0);
35164
- return 0n;
35165
35170
  }
35166
35171
  }
35167
35172
 
35168
- function invoke_iij(index, a1, a2) {
35173
+ function invoke_viijii(index, a1, a2, a3, a4, a5) {
35169
35174
  var sp = stackSave();
35170
35175
  try {
35171
- return Module['dynCall_iij'](index, a1, a2);
35176
+ Module['dynCall_viijii'](index, a1, a2, a3, a4, a5);
35172
35177
  } catch (e) {
35173
35178
  stackRestore(sp);
35174
35179
  if (e !== e + 0) throw e;
@@ -35176,6 +35181,29 @@ export function init(RuntimeName, PHPLoader) {
35176
35181
  }
35177
35182
  }
35178
35183
 
35184
+ function invoke_viidii(index, a1, a2, a3, a4, a5) {
35185
+ var sp = stackSave();
35186
+ try {
35187
+ Module['dynCall_viidii'](index, a1, a2, a3, a4, a5);
35188
+ } catch (e) {
35189
+ stackRestore(sp);
35190
+ if (e !== e + 0) throw e;
35191
+ _setThrew(1, 0);
35192
+ }
35193
+ }
35194
+
35195
+ function invoke_jiii(index, a1, a2, a3) {
35196
+ var sp = stackSave();
35197
+ try {
35198
+ return Module['dynCall_jiii'](index, a1, a2, a3);
35199
+ } catch (e) {
35200
+ stackRestore(sp);
35201
+ if (e !== e + 0) throw e;
35202
+ _setThrew(1, 0);
35203
+ return 0n;
35204
+ }
35205
+ }
35206
+
35179
35207
  function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
35180
35208
  var sp = stackSave();
35181
35209
  try {
@@ -35372,6 +35400,15 @@ export function init(RuntimeName, PHPLoader) {
35372
35400
  };
35373
35401
  }
35374
35402
 
35403
+ /**
35404
+ * Expose the PHP version so the PHP class can make version-specific
35405
+ * adjustments to `php.ini`.
35406
+ */
35407
+ PHPLoader['phpVersion'] = (() => {
35408
+ const [major, minor, patch] = phpVersionString.split('.').map(Number);
35409
+ return { major, minor, patch };
35410
+ })();
35411
+
35375
35412
  return PHPLoader;
35376
35413
 
35377
35414
  // Close the opening bracket from esm-prefix.js: