@php-wasm/node 0.6.8 → 0.6.10

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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/index.cjs CHANGED
@@ -10578,7 +10578,7 @@ function init(RuntimeName, PHPLoader) {
10578
10578
  La: ___syscall_lstat64,
10579
10579
  Ka: ___syscall_mkdirat,
10580
10580
  Ja: ___syscall_newfstatat,
10581
- x: ___syscall_openat,
10581
+ y: ___syscall_openat,
10582
10582
  Ia: ___syscall_pipe,
10583
10583
  Ha: ___syscall_poll,
10584
10584
  Ga: ___syscall_readlinkat,
@@ -10590,7 +10590,7 @@ function init(RuntimeName, PHPLoader) {
10590
10590
  Ca: ___syscall_stat64,
10591
10591
  Ba: ___syscall_statfs64,
10592
10592
  Aa: ___syscall_symlink,
10593
- E: ___syscall_unlinkat,
10593
+ F: ___syscall_unlinkat,
10594
10594
  za: ___syscall_utimensat,
10595
10595
  ua: __emscripten_get_now_is_monotonic,
10596
10596
  ta: __emscripten_throw_longjmp,
@@ -10602,9 +10602,9 @@ function init(RuntimeName, PHPLoader) {
10602
10602
  L: __setitimer_js,
10603
10603
  sa: __tzset_js,
10604
10604
  g: _abort,
10605
- C: _emscripten_date_now,
10605
+ D: _emscripten_date_now,
10606
10606
  ra: _emscripten_get_heap_max,
10607
- u: _emscripten_get_now,
10607
+ v: _emscripten_get_now,
10608
10608
  qa: _emscripten_memcpy_big,
10609
10609
  pa: _emscripten_resize_heap,
10610
10610
  K: _emscripten_sleep,
@@ -10616,13 +10616,13 @@ function init(RuntimeName, PHPLoader) {
10616
10616
  M: _fd_read,
10617
10617
  aa: _fd_seek,
10618
10618
  wa: _fd_sync,
10619
- D: _fd_write,
10619
+ E: _fd_write,
10620
10620
  oa: _getaddrinfo,
10621
10621
  na: _getcontext,
10622
10622
  ma: _getdtablesize,
10623
10623
  J: _gethostbyname_r,
10624
10624
  la: _getloadavg,
10625
- w: _getnameinfo,
10625
+ x: _getnameinfo,
10626
10626
  ka: _getprotobyname,
10627
10627
  ja: _getprotobynumber,
10628
10628
  k: invoke_i,
@@ -10631,19 +10631,19 @@ function init(RuntimeName, PHPLoader) {
10631
10631
  f: invoke_iiii,
10632
10632
  j: invoke_iiiii,
10633
10633
  o: invoke_iiiiii,
10634
- t: invoke_iiiiiii,
10635
- v: invoke_iiiiiiii,
10634
+ u: invoke_iiiiiii,
10635
+ w: invoke_iiiiiiii,
10636
10636
  I: invoke_iiiiiiiiii,
10637
10637
  e: invoke_v,
10638
10638
  a: invoke_vi,
10639
10639
  d: invoke_vii,
10640
- B: invoke_viidii,
10640
+ C: invoke_viidii,
10641
10641
  i: invoke_viii,
10642
10642
  m: invoke_viiii,
10643
10643
  h: invoke_viiiii,
10644
- A: invoke_viiiiii,
10644
+ B: invoke_viiiiii,
10645
10645
  ia: invoke_viiiiiii,
10646
- z: invoke_viiiiiiiii,
10646
+ A: invoke_viiiiiiiii,
10647
10647
  H: _js_create_input_device,
10648
10648
  ha: _js_fd_read,
10649
10649
  ga: _js_module_onMessage,
@@ -10653,11 +10653,11 @@ function init(RuntimeName, PHPLoader) {
10653
10653
  da: _js_waitpid,
10654
10654
  W: _makecontext,
10655
10655
  va: _proc_exit,
10656
- F: _strftime,
10656
+ t: _strftime,
10657
10657
  V: _strptime,
10658
10658
  U: _swapcontext,
10659
10659
  s: _wasm_close,
10660
- y: _wasm_poll_socket,
10660
+ z: _wasm_poll_socket,
10661
10661
  p: _wasm_setsockopt,
10662
10662
  T: _wasm_shutdown
10663
10663
  };
@@ -11169,7 +11169,7 @@ var init_php_8_3 = __esm({
11169
11169
  "packages/php-wasm/node/public/php_8_3.js"() {
11170
11170
  "use strict";
11171
11171
  dependencyFilename = __dirname + "/8_3_0/php_8_3.wasm";
11172
- dependenciesTotalSize = 11369684;
11172
+ dependenciesTotalSize = 14212801;
11173
11173
  }
11174
11174
  });
11175
11175
 
@@ -18799,7 +18799,7 @@ var init_php_8_2 = __esm({
18799
18799
  "packages/php-wasm/node/public/php_8_2.js"() {
18800
18800
  "use strict";
18801
18801
  dependencyFilename2 = __dirname + "/8_2_10/php_8_2.wasm";
18802
- dependenciesTotalSize2 = 11251126;
18802
+ dependenciesTotalSize2 = 13833034;
18803
18803
  }
18804
18804
  });
18805
18805
 
@@ -26424,7 +26424,7 @@ var init_php_8_1 = __esm({
26424
26424
  "packages/php-wasm/node/public/php_8_1.js"() {
26425
26425
  "use strict";
26426
26426
  dependencyFilename3 = __dirname + "/8_1_23/php_8_1.wasm";
26427
- dependenciesTotalSize3 = 10993622;
26427
+ dependenciesTotalSize3 = 13575975;
26428
26428
  }
26429
26429
  });
26430
26430
 
@@ -34022,7 +34022,7 @@ var init_php_8_0 = __esm({
34022
34022
  "packages/php-wasm/node/public/php_8_0.js"() {
34023
34023
  "use strict";
34024
34024
  dependencyFilename4 = __dirname + "/8_0_30/php_8_0.wasm";
34025
- dependenciesTotalSize4 = 11121733;
34025
+ dependenciesTotalSize4 = 13597807;
34026
34026
  }
34027
34027
  });
34028
34028
 
@@ -41605,7 +41605,7 @@ var init_php_7_4 = __esm({
41605
41605
  "packages/php-wasm/node/public/php_7_4.js"() {
41606
41606
  "use strict";
41607
41607
  dependencyFilename5 = __dirname + "/7_4_33/php_7_4.wasm";
41608
- dependenciesTotalSize5 = 11983001;
41608
+ dependenciesTotalSize5 = 14331003;
41609
41609
  }
41610
41610
  });
41611
41611
 
@@ -49183,7 +49183,7 @@ var init_php_7_3 = __esm({
49183
49183
  "packages/php-wasm/node/public/php_7_3.js"() {
49184
49184
  "use strict";
49185
49185
  dependencyFilename6 = __dirname + "/7_3_33/php_7_3.wasm";
49186
- dependenciesTotalSize6 = 11899856;
49186
+ dependenciesTotalSize6 = 14098602;
49187
49187
  }
49188
49188
  });
49189
49189
 
@@ -56629,7 +56629,7 @@ var init_php_7_2 = __esm({
56629
56629
  "packages/php-wasm/node/public/php_7_2.js"() {
56630
56630
  "use strict";
56631
56631
  dependencyFilename7 = __dirname + "/7_2_34/php_7_2.wasm";
56632
- dependenciesTotalSize7 = 11975898;
56632
+ dependenciesTotalSize7 = 13991791;
56633
56633
  }
56634
56634
  });
56635
56635
 
@@ -64060,7 +64060,7 @@ var init_php_7_1 = __esm({
64060
64060
  "packages/php-wasm/node/public/php_7_1.js"() {
64061
64061
  "use strict";
64062
64062
  dependencyFilename8 = __dirname + "/7_1_30/php_7_1.wasm";
64063
- dependenciesTotalSize8 = 11592292;
64063
+ dependenciesTotalSize8 = 13301166;
64064
64064
  }
64065
64065
  });
64066
64066
 
@@ -71505,7 +71505,7 @@ var init_php_7_0 = __esm({
71505
71505
  "packages/php-wasm/node/public/php_7_0.js"() {
71506
71506
  "use strict";
71507
71507
  dependencyFilename9 = __dirname + "/7_0_33/php_7_0.wasm";
71508
- dependenciesTotalSize9 = 11391249;
71508
+ dependenciesTotalSize9 = 12779191;
71509
71509
  }
71510
71510
  });
71511
71511
 
@@ -72372,7 +72372,8 @@ var PHPRequestHandler = class {
72372
72372
  async request(request) {
72373
72373
  const isAbsolute = request.url.startsWith("http://") || request.url.startsWith("https://");
72374
72374
  const requestedUrl = new URL(
72375
- request.url,
72375
+ // Remove the hash part of the URL as it's not meant for the server.
72376
+ request.url.split("#")[0],
72376
72377
  isAbsolute ? void 0 : DEFAULT_BASE_URL
72377
72378
  );
72378
72379
  const normalizedRequestedPath = applyRewriteRules(
@@ -72927,7 +72928,7 @@ var BasePHP2 = class {
72927
72928
  this.#setEnv(key, env[key]);
72928
72929
  }
72929
72930
  const response = await this.#handleRequest();
72930
- if (request.throwOnError && response.exitCode !== 0) {
72931
+ if (response.exitCode !== 0) {
72931
72932
  const output = {
72932
72933
  stdout: response.text,
72933
72934
  stderr: response.errors
@@ -72937,6 +72938,7 @@ var BasePHP2 = class {
72937
72938
  `PHP.run() failed with exit code ${response.exitCode} and the following output: ` + response.errors
72938
72939
  );
72939
72940
  error.output = output;
72941
+ error.source = "request";
72940
72942
  console.error(error);
72941
72943
  throw error;
72942
72944
  }
@@ -72944,7 +72946,9 @@ var BasePHP2 = class {
72944
72946
  } catch (e) {
72945
72947
  this.dispatchEvent({
72946
72948
  type: "request.error",
72947
- error: e
72949
+ error: e,
72950
+ // Distinguish between PHP request and PHP-wasm errors
72951
+ source: e.source ?? "php-wasm"
72948
72952
  });
72949
72953
  throw e;
72950
72954
  } finally {
package/index.d.ts CHANGED
@@ -59,6 +59,7 @@ export interface PHPRequestEndEvent {
59
59
  export interface PHPRequestErrorEvent {
60
60
  type: "request.error";
61
61
  error: Error;
62
+ source?: "request" | "php-wasm";
62
63
  }
63
64
  /**
64
65
  * Represents a PHP runtime initialization event.
@@ -522,11 +523,6 @@ export interface PHPRunOptions {
522
523
  * The code snippet to eval instead of a php file.
523
524
  */
524
525
  code?: string;
525
- /**
526
- * Whether to throw an error if the PHP process exits with a non-zero code
527
- * or outputs to stderr.
528
- */
529
- throwOnError?: boolean;
530
526
  }
531
527
  export interface RmDirOptions {
532
528
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/node",
3
- "version": "0.6.8",
3
+ "version": "0.6.10",
4
4
  "description": "PHP.wasm for Node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "license": "GPL-2.0-or-later",
29
29
  "main": "index.cjs",
30
30
  "types": "index.d.ts",
31
- "gitHead": "cb7b1af260489022238495a2fc0d96f767a1294a",
31
+ "gitHead": "a678c93cecd1c7fd5c8279ad8454a83225edd2aa",
32
32
  "engines": {
33
33
  "node": ">=18.18.2",
34
34
  "npm": ">=8.11.0"
@@ -38,8 +38,8 @@
38
38
  "express": "4.18.2",
39
39
  "ws": "8.13.0",
40
40
  "yargs": "17.7.2",
41
- "@php-wasm/node-polyfills": "0.6.8",
42
- "@php-wasm/universal": "0.6.8",
43
- "@php-wasm/util": "0.6.8"
41
+ "@php-wasm/node-polyfills": "0.6.10",
42
+ "@php-wasm/universal": "0.6.10",
43
+ "@php-wasm/util": "0.6.10"
44
44
  }
45
45
  }
package/php_7_0.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/7_0_33/php_7_0.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 11391249;
3
+ export const dependenciesTotalSize = 12779191;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
package/php_7_1.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/7_1_30/php_7_1.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 11592292;
3
+ export const dependenciesTotalSize = 13301166;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
package/php_7_2.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/7_2_34/php_7_2.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 11975898;
3
+ export const dependenciesTotalSize = 13991791;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
package/php_7_3.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/7_3_33/php_7_3.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 11899856;
3
+ export const dependenciesTotalSize = 14098602;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
package/php_7_4.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/7_4_33/php_7_4.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 11983001;
3
+ export const dependenciesTotalSize = 14331003;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
package/php_8_0.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/8_0_30/php_8_0.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 11121733;
3
+ export const dependenciesTotalSize = 13597807;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
package/php_8_1.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/8_1_23/php_8_1.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 10993622;
3
+ export const dependenciesTotalSize = 13575975;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
package/php_8_2.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/8_2_10/php_8_2.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 11251126;
3
+ export const dependenciesTotalSize = 13833034;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
package/php_8_3.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const dependencyFilename = __dirname + '/8_3_0/php_8_3.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 11369684;
3
+ export const dependenciesTotalSize = 14212801;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
@@ -7143,7 +7143,7 @@ var wasmImports = {
7143
7143
  La: ___syscall_lstat64,
7144
7144
  Ka: ___syscall_mkdirat,
7145
7145
  Ja: ___syscall_newfstatat,
7146
- x: ___syscall_openat,
7146
+ y: ___syscall_openat,
7147
7147
  Ia: ___syscall_pipe,
7148
7148
  Ha: ___syscall_poll,
7149
7149
  Ga: ___syscall_readlinkat,
@@ -7155,7 +7155,7 @@ var wasmImports = {
7155
7155
  Ca: ___syscall_stat64,
7156
7156
  Ba: ___syscall_statfs64,
7157
7157
  Aa: ___syscall_symlink,
7158
- E: ___syscall_unlinkat,
7158
+ F: ___syscall_unlinkat,
7159
7159
  za: ___syscall_utimensat,
7160
7160
  ua: __emscripten_get_now_is_monotonic,
7161
7161
  ta: __emscripten_throw_longjmp,
@@ -7167,9 +7167,9 @@ var wasmImports = {
7167
7167
  L: __setitimer_js,
7168
7168
  sa: __tzset_js,
7169
7169
  g: _abort,
7170
- C: _emscripten_date_now,
7170
+ D: _emscripten_date_now,
7171
7171
  ra: _emscripten_get_heap_max,
7172
- u: _emscripten_get_now,
7172
+ v: _emscripten_get_now,
7173
7173
  qa: _emscripten_memcpy_big,
7174
7174
  pa: _emscripten_resize_heap,
7175
7175
  K: _emscripten_sleep,
@@ -7181,13 +7181,13 @@ var wasmImports = {
7181
7181
  M: _fd_read,
7182
7182
  aa: _fd_seek,
7183
7183
  wa: _fd_sync,
7184
- D: _fd_write,
7184
+ E: _fd_write,
7185
7185
  oa: _getaddrinfo,
7186
7186
  na: _getcontext,
7187
7187
  ma: _getdtablesize,
7188
7188
  J: _gethostbyname_r,
7189
7189
  la: _getloadavg,
7190
- w: _getnameinfo,
7190
+ x: _getnameinfo,
7191
7191
  ka: _getprotobyname,
7192
7192
  ja: _getprotobynumber,
7193
7193
  k: invoke_i,
@@ -7196,19 +7196,19 @@ var wasmImports = {
7196
7196
  f: invoke_iiii,
7197
7197
  j: invoke_iiiii,
7198
7198
  o: invoke_iiiiii,
7199
- t: invoke_iiiiiii,
7200
- v: invoke_iiiiiiii,
7199
+ u: invoke_iiiiiii,
7200
+ w: invoke_iiiiiiii,
7201
7201
  I: invoke_iiiiiiiiii,
7202
7202
  e: invoke_v,
7203
7203
  a: invoke_vi,
7204
7204
  d: invoke_vii,
7205
- B: invoke_viidii,
7205
+ C: invoke_viidii,
7206
7206
  i: invoke_viii,
7207
7207
  m: invoke_viiii,
7208
7208
  h: invoke_viiiii,
7209
- A: invoke_viiiiii,
7209
+ B: invoke_viiiiii,
7210
7210
  ia: invoke_viiiiiii,
7211
- z: invoke_viiiiiiiii,
7211
+ A: invoke_viiiiiiiii,
7212
7212
  H: _js_create_input_device,
7213
7213
  ha: _js_fd_read,
7214
7214
  ga: _js_module_onMessage,
@@ -7218,11 +7218,11 @@ var wasmImports = {
7218
7218
  da: _js_waitpid,
7219
7219
  W: _makecontext,
7220
7220
  va: _proc_exit,
7221
- F: _strftime,
7221
+ t: _strftime,
7222
7222
  V: _strptime,
7223
7223
  U: _swapcontext,
7224
7224
  s: _wasm_close,
7225
- y: _wasm_poll_socket,
7225
+ z: _wasm_poll_socket,
7226
7226
  p: _wasm_setsockopt,
7227
7227
  T: _wasm_shutdown
7228
7228
  };