@php-wasm/node 0.6.14 → 0.6.15

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 (2) hide show
  1. package/index.cjs +10 -9
  2. package/package.json +6 -7
package/index.cjs CHANGED
@@ -72377,10 +72377,13 @@ var PHPRequestHandler = class {
72377
72377
  isAbsolute ? void 0 : DEFAULT_BASE_URL
72378
72378
  );
72379
72379
  const normalizedRequestedPath = applyRewriteRules(
72380
- removePathPrefix(requestedUrl.pathname, this.#PATHNAME),
72380
+ removePathPrefix(
72381
+ decodeURIComponent(requestedUrl.pathname),
72382
+ this.#PATHNAME
72383
+ ),
72381
72384
  this.rewriteRules
72382
72385
  );
72383
- const fsPath = `${this.#DOCROOT}${normalizedRequestedPath}`;
72386
+ const fsPath = joinPaths(this.#DOCROOT, normalizedRequestedPath);
72384
72387
  if (seemsLikeAPHPRequestHandlerPath(fsPath)) {
72385
72388
  return await this.#dispatchToPHP(request, requestedUrl);
72386
72389
  }
@@ -72459,7 +72462,9 @@ var PHPRequestHandler = class {
72459
72462
  }
72460
72463
  let scriptPath;
72461
72464
  try {
72462
- scriptPath = this.#resolvePHPFilePath(requestedUrl.pathname);
72465
+ scriptPath = this.#resolvePHPFilePath(
72466
+ decodeURIComponent(requestedUrl.pathname)
72467
+ );
72463
72468
  } catch (error) {
72464
72469
  return new PHPResponse(
72465
72470
  404,
@@ -72929,15 +72934,11 @@ var BasePHP2 = class {
72929
72934
  }
72930
72935
  const response = await this.#handleRequest();
72931
72936
  if (response.exitCode !== 0) {
72932
- const output = {
72933
- stdout: response.text,
72934
- stderr: response.errors
72935
- };
72936
- console.warn(`PHP.run() output was:`, output);
72937
+ console.warn(`PHP.run() output was:`, response.text);
72937
72938
  const error = new Error(
72938
72939
  `PHP.run() failed with exit code ${response.exitCode} and the following output: ` + response.errors
72939
72940
  );
72940
- error.output = output;
72941
+ error.response = response;
72941
72942
  error.source = "request";
72942
72943
  console.error(error);
72943
72944
  throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/node",
3
- "version": "0.6.14",
3
+ "version": "0.6.15",
4
4
  "description": "PHP.wasm for Node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,18 +28,17 @@
28
28
  "license": "GPL-2.0-or-later",
29
29
  "main": "index.cjs",
30
30
  "types": "index.d.ts",
31
- "gitHead": "83b6f8542937a9bea9ee6562887a511c20ac9442",
31
+ "gitHead": "e05126da329a26535905b0ab65415d20118f0197",
32
32
  "engines": {
33
- "node": ">=18.18.2",
33
+ "node": ">=18.18.0",
34
34
  "npm": ">=8.11.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "comlink": "^4.4.1",
38
- "express": "4.18.2",
39
38
  "ws": "8.13.0",
40
39
  "yargs": "17.7.2",
41
- "@php-wasm/node-polyfills": "0.6.14",
42
- "@php-wasm/universal": "0.6.14",
43
- "@php-wasm/util": "0.6.14"
40
+ "@php-wasm/node-polyfills": "0.6.15",
41
+ "@php-wasm/universal": "0.6.15",
42
+ "@php-wasm/util": "0.6.15"
44
43
  }
45
44
  }