@php-wasm/node 0.6.15 → 0.6.16

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
@@ -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 = 14212810;
11172
+ dependenciesTotalSize = 14212793;
11173
11173
  }
11174
11174
  });
11175
11175
 
@@ -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 = 13575986;
26427
+ dependenciesTotalSize3 = 13575971;
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 = 13597816;
34025
+ dependenciesTotalSize4 = 13597709;
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 = 14331012;
41608
+ dependenciesTotalSize5 = 14331074;
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 = 14098611;
49186
+ dependenciesTotalSize6 = 14098607;
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 = 13992133;
56632
+ dependenciesTotalSize7 = 13992092;
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 = 13301175;
64063
+ dependenciesTotalSize8 = 13300912;
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 = 12778840;
71508
+ dependenciesTotalSize9 = 12778913;
71509
71509
  }
71510
71510
  });
71511
71511
 
@@ -72472,17 +72472,25 @@ var PHPRequestHandler = class {
72472
72472
  new TextEncoder().encode("404 File not found")
72473
72473
  );
72474
72474
  }
72475
- return await this.php.run({
72476
- relativeUri: ensurePathPrefix(
72477
- toRelativeUrl(requestedUrl),
72478
- this.#PATHNAME
72479
- ),
72480
- protocol: this.#PROTOCOL,
72481
- method: request.method || preferredMethod,
72482
- body,
72483
- scriptPath,
72484
- headers
72485
- });
72475
+ try {
72476
+ return await this.php.run({
72477
+ relativeUri: ensurePathPrefix(
72478
+ toRelativeUrl(requestedUrl),
72479
+ this.#PATHNAME
72480
+ ),
72481
+ protocol: this.#PROTOCOL,
72482
+ method: request.method || preferredMethod,
72483
+ body,
72484
+ scriptPath,
72485
+ headers
72486
+ });
72487
+ } catch (error) {
72488
+ const executionError = error;
72489
+ if (executionError?.response) {
72490
+ return executionError.response;
72491
+ }
72492
+ throw error;
72493
+ }
72486
72494
  } finally {
72487
72495
  release();
72488
72496
  }
@@ -72748,6 +72756,13 @@ var makePromise = () => {
72748
72756
  var STRING = "string";
72749
72757
  var NUMBER = "number";
72750
72758
  var __private__dont__use = Symbol("__private__dont__use");
72759
+ var PHPExecutionFailureError2 = class extends Error {
72760
+ constructor(message, response, source) {
72761
+ super(message);
72762
+ this.response = response;
72763
+ this.source = source;
72764
+ }
72765
+ };
72751
72766
  var BasePHP2 = class {
72752
72767
  /**
72753
72768
  * Initializes a PHP runtime.
@@ -72935,11 +72950,11 @@ var BasePHP2 = class {
72935
72950
  const response = await this.#handleRequest();
72936
72951
  if (response.exitCode !== 0) {
72937
72952
  console.warn(`PHP.run() output was:`, response.text);
72938
- const error = new Error(
72939
- `PHP.run() failed with exit code ${response.exitCode} and the following output: ` + response.errors
72953
+ const error = new PHPExecutionFailureError2(
72954
+ `PHP.run() failed with exit code ${response.exitCode} and the following output: ` + response.errors,
72955
+ response,
72956
+ "request"
72940
72957
  );
72941
- error.response = response;
72942
- error.source = "request";
72943
72958
  console.error(error);
72944
72959
  throw error;
72945
72960
  }
@@ -73248,7 +73263,7 @@ var BasePHP2 = class {
73248
73263
  }
73249
73264
  const { headers, httpStatusCode } = this.#getResponseHeaders();
73250
73265
  return new PHPResponse(
73251
- httpStatusCode,
73266
+ exitCode === 0 ? httpStatusCode : 500,
73252
73267
  headers,
73253
73268
  this.readFileAsBuffer("/internal/stdout"),
73254
73269
  this.readFileAsText("/internal/stderr"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/node",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
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": "e05126da329a26535905b0ab65415d20118f0197",
31
+ "gitHead": "1981567e7eacecbc4a18c870267c20bf489afd8f",
32
32
  "engines": {
33
33
  "node": ">=18.18.0",
34
34
  "npm": ">=8.11.0"
@@ -37,8 +37,8 @@
37
37
  "comlink": "^4.4.1",
38
38
  "ws": "8.13.0",
39
39
  "yargs": "17.7.2",
40
- "@php-wasm/node-polyfills": "0.6.15",
41
- "@php-wasm/universal": "0.6.15",
42
- "@php-wasm/util": "0.6.15"
40
+ "@php-wasm/node-polyfills": "0.6.16",
41
+ "@php-wasm/universal": "0.6.16",
42
+ "@php-wasm/util": "0.6.16"
43
43
  }
44
44
  }
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 = 12778840;
3
+ export const dependenciesTotalSize = 12778913;
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 = 13301175;
3
+ export const dependenciesTotalSize = 13300912;
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 = 13992133;
3
+ export const dependenciesTotalSize = 13992092;
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 = 14098611;
3
+ export const dependenciesTotalSize = 14098607;
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 = 14331012;
3
+ export const dependenciesTotalSize = 14331074;
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 = 13597816;
3
+ export const dependenciesTotalSize = 13597709;
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 = 13575986;
3
+ export const dependenciesTotalSize = 13575971;
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 = 14212810;
3
+ export const dependenciesTotalSize = 14212793;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets