@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_2_10', 'php_8_2.wasm');
9
+ const dependencyFilename = path.join(__dirname, '8_2_29', 'php_8_2.wasm');
10
10
  export { dependencyFilename };
11
- export const dependenciesTotalSize = 31860490;
11
+ export const dependenciesTotalSize = 32040568;
12
+ const phpVersionString = '8.2.29';
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 = 13257536;
834
+ var ___heap_base = 14294272;
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: 15952,
998
+ initial: 16087,
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 = 13257536;
1857
+ var ___stack_high = 14294272;
1857
1858
 
1858
- var ___stack_low = 13192000;
1859
+ var ___stack_low = 13245696;
1859
1860
 
1860
1861
  var ___stack_pointer = new WebAssembly.Global(
1861
1862
  { value: 'i32', mutable: true },
1862
- 13257536
1863
+ 14294272
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
- 12264230: ($0) => {
31811
+ 12280477: ($0) => {
31819
31812
  if (!$0) {
31820
31813
  AL.alcErr = 0xa004;
31821
31814
  return 1;
31822
31815
  }
31823
31816
  },
31824
- 12264278: ($0) => {
31817
+ 12280525: ($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,
@@ -34607,6 +34605,8 @@ export function init(RuntimeName, PHPLoader) {
34607
34605
  /** @export */
34608
34606
  invoke_viijii,
34609
34607
  /** @export */
34608
+ invoke_vijj,
34609
+ /** @export */
34610
34610
  invoke_vji,
34611
34611
  /** @export */
34612
34612
  js_fd_read,
@@ -34731,6 +34731,11 @@ export function init(RuntimeName, PHPLoader) {
34731
34731
  var _calloc = (a0, a1) => (_calloc = wasmExports['calloc'])(a0, a1);
34732
34732
  var _flock = (Module['_flock'] = (a0, a1) =>
34733
34733
  (_flock = Module['_flock'] = wasmExports['flock'])(a0, a1));
34734
+ var _initgroups = (Module['_initgroups'] = (a0, a1) =>
34735
+ (_initgroups = Module['_initgroups'] = wasmExports['initgroups'])(
34736
+ a0,
34737
+ a1
34738
+ ));
34734
34739
  var _wasm_read = (Module['_wasm_read'] = (a0, a1, a2) =>
34735
34740
  (_wasm_read = Module['_wasm_read'] = wasmExports['wasm_read'])(
34736
34741
  a0,
@@ -35035,19 +35040,10 @@ export function init(RuntimeName, PHPLoader) {
35035
35040
  }
35036
35041
  }
35037
35042
 
35038
- function invoke_iiiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
35043
+ function invoke_vji(index, a1, a2) {
35039
35044
  var sp = stackSave();
35040
35045
  try {
35041
- return Module['dynCall_iiiiiiii'](
35042
- index,
35043
- a1,
35044
- a2,
35045
- a3,
35046
- a4,
35047
- a5,
35048
- a6,
35049
- a7
35050
- );
35046
+ Module['dynCall_vji'](index, a1, a2);
35051
35047
  } catch (e) {
35052
35048
  stackRestore(sp);
35053
35049
  if (e !== e + 0) throw e;
@@ -35055,21 +35051,22 @@ export function init(RuntimeName, PHPLoader) {
35055
35051
  }
35056
35052
  }
35057
35053
 
35058
- function invoke_iiji(index, a1, a2, a3) {
35054
+ function invoke_jii(index, a1, a2) {
35059
35055
  var sp = stackSave();
35060
35056
  try {
35061
- return Module['dynCall_iiji'](index, a1, a2, a3);
35057
+ return Module['dynCall_jii'](index, a1, a2);
35062
35058
  } catch (e) {
35063
35059
  stackRestore(sp);
35064
35060
  if (e !== e + 0) throw e;
35065
35061
  _setThrew(1, 0);
35062
+ return 0n;
35066
35063
  }
35067
35064
  }
35068
35065
 
35069
- function invoke_iijii(index, a1, a2, a3, a4) {
35066
+ function invoke_v(index) {
35070
35067
  var sp = stackSave();
35071
35068
  try {
35072
- return Module['dynCall_iijii'](index, a1, a2, a3, a4);
35069
+ Module['dynCall_v'](index);
35073
35070
  } catch (e) {
35074
35071
  stackRestore(sp);
35075
35072
  if (e !== e + 0) throw e;
@@ -35077,21 +35074,22 @@ export function init(RuntimeName, PHPLoader) {
35077
35074
  }
35078
35075
  }
35079
35076
 
35080
- function invoke_iijiji(index, a1, a2, a3, a4, a5) {
35077
+ function invoke_ji(index, a1) {
35081
35078
  var sp = stackSave();
35082
35079
  try {
35083
- return Module['dynCall_iijiji'](index, a1, a2, a3, a4, a5);
35080
+ return Module['dynCall_ji'](index, a1);
35084
35081
  } catch (e) {
35085
35082
  stackRestore(sp);
35086
35083
  if (e !== e + 0) throw e;
35087
35084
  _setThrew(1, 0);
35085
+ return 0n;
35088
35086
  }
35089
35087
  }
35090
35088
 
35091
- function invoke_v(index) {
35089
+ function invoke_vijj(index, a1, a2, a3) {
35092
35090
  var sp = stackSave();
35093
35091
  try {
35094
- Module['dynCall_v'](index);
35092
+ Module['dynCall_vijj'](index, a1, a2, a3);
35095
35093
  } catch (e) {
35096
35094
  stackRestore(sp);
35097
35095
  if (e !== e + 0) throw e;
@@ -35099,10 +35097,10 @@ export function init(RuntimeName, PHPLoader) {
35099
35097
  }
35100
35098
  }
35101
35099
 
35102
- function invoke_iiiiiii(index, a1, a2, a3, a4, a5, a6) {
35100
+ function invoke_iij(index, a1, a2) {
35103
35101
  var sp = stackSave();
35104
35102
  try {
35105
- return Module['dynCall_iiiiiii'](index, a1, a2, a3, a4, a5, a6);
35103
+ return Module['dynCall_iij'](index, a1, a2);
35106
35104
  } catch (e) {
35107
35105
  stackRestore(sp);
35108
35106
  if (e !== e + 0) throw e;
@@ -35110,10 +35108,19 @@ export function init(RuntimeName, PHPLoader) {
35110
35108
  }
35111
35109
  }
35112
35110
 
35113
- function invoke_vji(index, a1, a2) {
35111
+ function invoke_iiiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
35114
35112
  var sp = stackSave();
35115
35113
  try {
35116
- Module['dynCall_vji'](index, a1, a2);
35114
+ return Module['dynCall_iiiiiiii'](
35115
+ index,
35116
+ a1,
35117
+ a2,
35118
+ a3,
35119
+ a4,
35120
+ a5,
35121
+ a6,
35122
+ a7
35123
+ );
35117
35124
  } catch (e) {
35118
35125
  stackRestore(sp);
35119
35126
  if (e !== e + 0) throw e;
@@ -35121,10 +35128,10 @@ export function init(RuntimeName, PHPLoader) {
35121
35128
  }
35122
35129
  }
35123
35130
 
35124
- function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) {
35131
+ function invoke_iiji(index, a1, a2, a3) {
35125
35132
  var sp = stackSave();
35126
35133
  try {
35127
- Module['dynCall_viiiiii'](index, a1, a2, a3, a4, a5, a6);
35134
+ return Module['dynCall_iiji'](index, a1, a2, a3);
35128
35135
  } catch (e) {
35129
35136
  stackRestore(sp);
35130
35137
  if (e !== e + 0) throw e;
@@ -35132,10 +35139,10 @@ export function init(RuntimeName, PHPLoader) {
35132
35139
  }
35133
35140
  }
35134
35141
 
35135
- function invoke_viijii(index, a1, a2, a3, a4, a5) {
35142
+ function invoke_iijii(index, a1, a2, a3, a4) {
35136
35143
  var sp = stackSave();
35137
35144
  try {
35138
- Module['dynCall_viijii'](index, a1, a2, a3, a4, a5);
35145
+ return Module['dynCall_iijii'](index, a1, a2, a3, a4);
35139
35146
  } catch (e) {
35140
35147
  stackRestore(sp);
35141
35148
  if (e !== e + 0) throw e;
@@ -35143,10 +35150,10 @@ export function init(RuntimeName, PHPLoader) {
35143
35150
  }
35144
35151
  }
35145
35152
 
35146
- function invoke_viidii(index, a1, a2, a3, a4, a5) {
35153
+ function invoke_iijiji(index, a1, a2, a3, a4, a5) {
35147
35154
  var sp = stackSave();
35148
35155
  try {
35149
- Module['dynCall_viidii'](index, a1, a2, a3, a4, a5);
35156
+ return Module['dynCall_iijiji'](index, a1, a2, a3, a4, a5);
35150
35157
  } catch (e) {
35151
35158
  stackRestore(sp);
35152
35159
  if (e !== e + 0) throw e;
@@ -35154,34 +35161,32 @@ export function init(RuntimeName, PHPLoader) {
35154
35161
  }
35155
35162
  }
35156
35163
 
35157
- function invoke_jiii(index, a1, a2, a3) {
35164
+ function invoke_iiiiiii(index, a1, a2, a3, a4, a5, a6) {
35158
35165
  var sp = stackSave();
35159
35166
  try {
35160
- return Module['dynCall_jiii'](index, a1, a2, a3);
35167
+ return Module['dynCall_iiiiiii'](index, a1, a2, a3, a4, a5, a6);
35161
35168
  } catch (e) {
35162
35169
  stackRestore(sp);
35163
35170
  if (e !== e + 0) throw e;
35164
35171
  _setThrew(1, 0);
35165
- return 0n;
35166
35172
  }
35167
35173
  }
35168
35174
 
35169
- function invoke_jii(index, a1, a2) {
35175
+ function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) {
35170
35176
  var sp = stackSave();
35171
35177
  try {
35172
- return Module['dynCall_jii'](index, a1, a2);
35178
+ Module['dynCall_viiiiii'](index, a1, a2, a3, a4, a5, a6);
35173
35179
  } catch (e) {
35174
35180
  stackRestore(sp);
35175
35181
  if (e !== e + 0) throw e;
35176
35182
  _setThrew(1, 0);
35177
- return 0n;
35178
35183
  }
35179
35184
  }
35180
35185
 
35181
- function invoke_iij(index, a1, a2) {
35186
+ function invoke_viijii(index, a1, a2, a3, a4, a5) {
35182
35187
  var sp = stackSave();
35183
35188
  try {
35184
- return Module['dynCall_iij'](index, a1, a2);
35189
+ Module['dynCall_viijii'](index, a1, a2, a3, a4, a5);
35185
35190
  } catch (e) {
35186
35191
  stackRestore(sp);
35187
35192
  if (e !== e + 0) throw e;
@@ -35189,6 +35194,29 @@ export function init(RuntimeName, PHPLoader) {
35189
35194
  }
35190
35195
  }
35191
35196
 
35197
+ function invoke_viidii(index, a1, a2, a3, a4, a5) {
35198
+ var sp = stackSave();
35199
+ try {
35200
+ Module['dynCall_viidii'](index, a1, a2, a3, a4, a5);
35201
+ } catch (e) {
35202
+ stackRestore(sp);
35203
+ if (e !== e + 0) throw e;
35204
+ _setThrew(1, 0);
35205
+ }
35206
+ }
35207
+
35208
+ function invoke_jiii(index, a1, a2, a3) {
35209
+ var sp = stackSave();
35210
+ try {
35211
+ return Module['dynCall_jiii'](index, a1, a2, a3);
35212
+ } catch (e) {
35213
+ stackRestore(sp);
35214
+ if (e !== e + 0) throw e;
35215
+ _setThrew(1, 0);
35216
+ return 0n;
35217
+ }
35218
+ }
35219
+
35192
35220
  function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
35193
35221
  var sp = stackSave();
35194
35222
  try {
@@ -35385,6 +35413,15 @@ export function init(RuntimeName, PHPLoader) {
35385
35413
  };
35386
35414
  }
35387
35415
 
35416
+ /**
35417
+ * Expose the PHP version so the PHP class can make version-specific
35418
+ * adjustments to `php.ini`.
35419
+ */
35420
+ PHPLoader['phpVersion'] = (() => {
35421
+ const [major, minor, patch] = phpVersionString.split('.').map(Number);
35422
+ return { major, minor, patch };
35423
+ })();
35424
+
35388
35425
  return PHPLoader;
35389
35426
 
35390
35427
  // Close the opening bracket from esm-prefix.js: