@php-wasm/universal 3.1.29 → 3.1.30

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.
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- var Z = (r) => {
1
+ var ue = (r) => {
2
2
  throw TypeError(r);
3
3
  };
4
- var G = (r, e, t) => e.has(r) || Z("Cannot " + t);
5
- var p = (r, e, t) => (G(r, e, "read from private field"), t ? t.call(r) : e.get(r)), P = (r, e, t) => e.has(r) ? Z("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), _ = (r, e, t, s) => (G(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), w = (r, e, t) => (G(r, e, "access private method"), t);
4
+ var ae = (r, e, t) => e.has(r) || ue("Cannot " + t);
5
+ var u = (r, e, t) => (ae(r, e, "read from private field"), t ? t.call(r) : e.get(r)), _ = (r, e, t) => e.has(r) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), v = (r, e, t, s) => (ae(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), P = (r, e, t) => (ae(r, e, "access private method"), t);
6
6
  import { logger } from "@php-wasm/logger";
7
7
  import { dirname, joinPaths, Semaphore, createSpawnHandler, basename, normalizePath, AcquireTimeoutError, splitShellCommand } from "@php-wasm/util";
8
8
  import { parse, stringify } from "ini";
@@ -371,12 +371,12 @@ FSHelpers.mkdir = rethrowFileSystemError('Could not create directory "{path}"')(
371
371
  FSHelpers.mkdir
372
372
  );
373
373
  const _private = /* @__PURE__ */ new WeakMap();
374
- var F;
374
+ var O;
375
375
  class PHPWorker {
376
376
  /** @inheritDoc */
377
377
  constructor(e, t) {
378
- P(this, F);
379
- this.absoluteUrl = "", this.documentRoot = "", this.chroot = null, _(this, F, /* @__PURE__ */ new Map()), this.onMessageListeners = [], _private.set(this, {
378
+ _(this, O);
379
+ this.absoluteUrl = "", this.documentRoot = "", this.chroot = null, v(this, O, /* @__PURE__ */ new Map()), this.onMessageListeners = [], _private.set(this, {
380
380
  monitor: t
381
381
  }), e && this.__internal_setRequestHandler(e);
382
382
  }
@@ -551,7 +551,7 @@ class PHPWorker {
551
551
  }
552
552
  /** @inheritDoc @php-wasm/universal!/PHP.addEventListener */
553
553
  addEventListener(e, t) {
554
- p(this, F).has(e) || p(this, F).set(e, /* @__PURE__ */ new Set()), p(this, F).get(e).add(t);
554
+ u(this, O).has(e) || u(this, O).set(e, /* @__PURE__ */ new Set()), u(this, O).get(e).add(t);
555
555
  }
556
556
  /**
557
557
  * Removes an event listener for a PHP event.
@@ -560,10 +560,10 @@ class PHPWorker {
560
560
  */
561
561
  removeEventListener(e, t) {
562
562
  var s;
563
- (s = p(this, F).get(e)) == null || s.delete(t);
563
+ (s = u(this, O).get(e)) == null || s.delete(t);
564
564
  }
565
565
  dispatchEvent(e) {
566
- const t = p(this, F).get(e.type);
566
+ const t = u(this, O).get(e.type);
567
567
  if (t)
568
568
  for (const s of t)
569
569
  s(e);
@@ -595,7 +595,7 @@ class PHPWorker {
595
595
  throw new Error("PHPWorker is not connected to a request handler.");
596
596
  }
597
597
  }
598
- F = new WeakMap();
598
+ O = new WeakMap();
599
599
  function isExitCode(r) {
600
600
  return r instanceof Error ? (r == null ? void 0 : r.name) === "ExitStatus" && "status" in r : !1;
601
601
  }
@@ -662,8 +662,8 @@ const currentJsRuntime = function() {
662
662
  201: "Created",
663
663
  200: "OK"
664
664
  };
665
- var B, q;
666
- const V = class V {
665
+ var K, Z;
666
+ const se = class se {
667
667
  constructor(e, t, s, n) {
668
668
  /**
669
669
  * Headers stream that doesn't get locked when the consumer
@@ -672,14 +672,14 @@ const V = class V {
672
672
  * Both streams must be readable when the StreamedPHPResponse is transferred
673
673
  * from the worker thread into the service worker.
674
674
  */
675
- P(this, B);
675
+ _(this, K);
676
676
  /**
677
677
  * Headers stream reserved for internal parsing.
678
678
  */
679
- P(this, q);
679
+ _(this, Z);
680
680
  this.cachedParsedHeaders = null, this.cachedStdoutBytes = null, this.cachedStderrText = null;
681
681
  const [i, o] = e.tee();
682
- _(this, B, i), _(this, q, o), this.stdout = t, this.stderr = s, this.exitCode = n;
682
+ v(this, K, i), v(this, Z, o), this.stdout = t, this.stderr = s, this.exitCode = n;
683
683
  }
684
684
  /**
685
685
  * Creates a StreamedPHPResponse from a buffered PHPResponse.
@@ -708,7 +708,7 @@ const V = class V {
708
708
  ), a.close();
709
709
  }
710
710
  });
711
- return new V(
711
+ return new se(
712
712
  i,
713
713
  t,
714
714
  o,
@@ -720,7 +720,7 @@ const V = class V {
720
720
  * Shorthand for `StreamedPHPResponse.fromPHPResponse(PHPResponse.forHttpCode(...))`.
721
721
  */
722
722
  static forHttpCode(e, t = "") {
723
- return V.fromPHPResponse(
723
+ return se.fromPHPResponse(
724
724
  PHPResponse.forHttpCode(e, t)
725
725
  );
726
726
  }
@@ -729,7 +729,7 @@ const V = class V {
729
729
  * For parsed headers, use the `headers` property instead.
730
730
  */
731
731
  getHeadersStream() {
732
- return p(this, B);
732
+ return u(this, K);
733
733
  }
734
734
  /**
735
735
  * True if the response is successful (HTTP status code 200-399),
@@ -790,12 +790,12 @@ const V = class V {
790
790
  }
791
791
  async getParsedHeaders() {
792
792
  return this.cachedParsedHeaders || (this.cachedParsedHeaders = parseHeadersStream(
793
- p(this, q)
793
+ u(this, Z)
794
794
  )), await this.cachedParsedHeaders;
795
795
  }
796
796
  };
797
- B = new WeakMap(), q = new WeakMap();
798
- let StreamedPHPResponse = V;
797
+ K = new WeakMap(), Z = new WeakMap();
798
+ let StreamedPHPResponse = se;
799
799
  async function parseHeadersStream(r) {
800
800
  const e = await streamToText(r);
801
801
  let t;
@@ -1069,7 +1069,7 @@ class PHPExecutionFailureError extends Error {
1069
1069
  }
1070
1070
  }
1071
1071
  const PHP_INI_PATH = "/internal/shared/php.ini", AUTO_PREPEND_SCRIPT = "/internal/shared/auto_prepend_file.php", OPCACHE_FILE_FOLDER = "/internal/shared/opcache";
1072
- var N, T, L, R, I, C, E, f, ee, te, re, se, ne, ie, oe, ae, Y, ce, J, X;
1072
+ var G, B, q, U, W, $, x, y, pe, he, fe, me, ye, ge, Pe, we, ce, _e, le, de;
1073
1073
  class PHP {
1074
1074
  /**
1075
1075
  * Initializes a PHP runtime.
@@ -1079,17 +1079,17 @@ class PHP {
1079
1079
  * @param requestHandlerOptions - Optional. Options for the PHPRequestHandler. If undefined, no request handler will be initialized.
1080
1080
  */
1081
1081
  constructor(r) {
1082
- P(this, f);
1083
- P(this, N);
1084
- P(this, T, !1);
1085
- P(this, L, null);
1086
- P(this, R, /* @__PURE__ */ new Map([
1082
+ _(this, y);
1083
+ _(this, G);
1084
+ _(this, B, !1);
1085
+ _(this, q, null);
1086
+ _(this, U, /* @__PURE__ */ new Map([
1087
1087
  // Listen to all events
1088
1088
  ["*", /* @__PURE__ */ new Set()]
1089
1089
  ]));
1090
- P(this, I, []);
1091
- P(this, C, {});
1092
- P(this, E, {
1090
+ _(this, W, []);
1091
+ _(this, $, {});
1092
+ _(this, x, {
1093
1093
  enabled: !1,
1094
1094
  recreateRuntime: () => 0,
1095
1095
  needsRotating: !1,
@@ -1097,7 +1097,7 @@ class PHP {
1097
1097
  requestsMade: 0
1098
1098
  });
1099
1099
  this.semaphore = new Semaphore({ concurrency: 1 }), r !== void 0 && this.initializeRuntime(r), this.addEventListener("request.error", (e) => {
1100
- e.source === "php-wasm" && (p(this, E).needsRotating = !0);
1100
+ e.source === "php-wasm" && (u(this, x).needsRotating = !0);
1101
1101
  });
1102
1102
  }
1103
1103
  /**
@@ -1106,7 +1106,7 @@ class PHP {
1106
1106
  * @param listener - The listener function to be called when the event is triggered.
1107
1107
  */
1108
1108
  addEventListener(r, e) {
1109
- p(this, R).has(r) || p(this, R).set(r, /* @__PURE__ */ new Set()), p(this, R).get(r).add(e);
1109
+ u(this, U).has(r) || u(this, U).set(r, /* @__PURE__ */ new Set()), u(this, U).get(r).add(e);
1110
1110
  }
1111
1111
  /**
1112
1112
  * Removes an event listener for a PHP event.
@@ -1115,12 +1115,12 @@ class PHP {
1115
1115
  */
1116
1116
  removeEventListener(r, e) {
1117
1117
  var t;
1118
- (t = p(this, R).get(r)) == null || t.delete(e);
1118
+ (t = u(this, U).get(r)) == null || t.delete(e);
1119
1119
  }
1120
1120
  dispatchEvent(r) {
1121
1121
  const e = [
1122
- ...p(this, R).get(r.type) || [],
1123
- ...p(this, R).get("*") || []
1122
+ ...u(this, U).get(r.type) || [],
1123
+ ...u(this, U).get("*") || []
1124
1124
  ];
1125
1125
  if (e)
1126
1126
  for (const t of e)
@@ -1166,8 +1166,8 @@ class PHP {
1166
1166
  * @param listener Callback function to handle the message.
1167
1167
  */
1168
1168
  onMessage(r) {
1169
- return p(this, I).push(r), async () => {
1170
- _(this, I, p(this, I).filter(
1169
+ return u(this, W).push(r), async () => {
1170
+ v(this, W, u(this, W).filter(
1171
1171
  (e) => e !== r
1172
1172
  ));
1173
1173
  };
@@ -1261,13 +1261,13 @@ class PHP {
1261
1261
  }
1262
1262
  `
1263
1263
  ), e.onMessage = async (t) => {
1264
- for (const s of p(this, I)) {
1264
+ for (const s of u(this, W)) {
1265
1265
  const n = await s(t);
1266
1266
  if (n)
1267
1267
  return n;
1268
1268
  }
1269
1269
  return "";
1270
- }, _(this, L, improveWASMErrorReporting(e)), this.dispatchEvent({
1270
+ }, v(this, q, improveWASMErrorReporting(e)), this.dispatchEvent({
1271
1271
  type: "runtime.initialized"
1272
1272
  });
1273
1273
  }
@@ -1282,7 +1282,7 @@ class PHP {
1282
1282
  throw new Error(
1283
1283
  "Could not set SAPI name. This can only be done before the PHP WASM module is initialized.Did you already dispatch any requests?"
1284
1284
  );
1285
- _(this, N, r);
1285
+ v(this, G, r);
1286
1286
  }
1287
1287
  /**
1288
1288
  * Changes the current working directory in the PHP filesystem.
@@ -1504,8 +1504,8 @@ class PHP {
1504
1504
  async runStream(r) {
1505
1505
  const e = await this.semaphore.acquire();
1506
1506
  let t;
1507
- const s = w(this, f, X).call(this, async () => {
1508
- if (p(this, T) || (await this[__private__dont__use].ccall(
1507
+ const s = P(this, y, de).call(this, async () => {
1508
+ if (u(this, B) || (await this[__private__dont__use].ccall(
1509
1509
  "php_wasm_init",
1510
1510
  null,
1511
1511
  [],
@@ -1513,26 +1513,26 @@ class PHP {
1513
1513
  {
1514
1514
  isAsync: !0
1515
1515
  }
1516
- ), _(this, T, !0)), r.scriptPath && !this.fileExists(r.scriptPath))
1516
+ ), v(this, B, !0)), r.scriptPath && !this.fileExists(r.scriptPath))
1517
1517
  throw new Error(
1518
1518
  `The script path "${r.scriptPath}" does not exist.`
1519
1519
  );
1520
- w(this, f, te).call(this, r.relativeUri || ""), w(this, f, ie).call(this, r.method || "GET");
1521
- const i = normalizeHeaders(r.headers || {}), o = i.host || "example.com:443", a = w(this, f, ne).call(this, o, r.protocol || "http");
1522
- if (w(this, f, re).call(this, o), w(this, f, se).call(this, a), w(this, f, oe).call(this, i), r.body && (t = w(this, f, ae).call(this, r.body)), typeof r.code == "string")
1523
- this.writeFile("/internal/eval.php", r.code), w(this, f, Y).call(this, "/internal/eval.php");
1520
+ P(this, y, he).call(this, r.relativeUri || ""), P(this, y, ge).call(this, r.method || "GET");
1521
+ const i = normalizeHeaders(r.headers || {}), o = i.host || "example.com:443", a = P(this, y, ye).call(this, o, r.protocol || "http");
1522
+ if (P(this, y, fe).call(this, o), P(this, y, me).call(this, a), P(this, y, Pe).call(this, i), r.body && (t = P(this, y, we).call(this, r.body)), typeof r.code == "string")
1523
+ this.writeFile("/internal/eval.php", r.code), P(this, y, ce).call(this, "/internal/eval.php");
1524
1524
  else if (typeof r.scriptPath == "string")
1525
- w(this, f, Y).call(this, r.scriptPath || "");
1525
+ P(this, y, ce).call(this, r.scriptPath || "");
1526
1526
  else
1527
1527
  throw new TypeError(
1528
1528
  "The request object must have either a `code` or a `scriptPath` property."
1529
1529
  );
1530
- const c = w(this, f, ee).call(this, r.$_SERVER, i, a);
1531
- for (const u in c)
1532
- w(this, f, ce).call(this, u, c[u]);
1530
+ const c = P(this, y, pe).call(this, r.$_SERVER, i, a);
1531
+ for (const d in c)
1532
+ P(this, y, _e).call(this, d, c[d]);
1533
1533
  const l = r.env || {};
1534
- for (const u in l)
1535
- w(this, f, J).call(this, u, l[u]);
1534
+ for (const d in l)
1535
+ P(this, y, le).call(this, d, l[d]);
1536
1536
  return await this[__private__dont__use].ccall(
1537
1537
  "wasm_sapi_handle_request",
1538
1538
  NUMBER,
@@ -1770,21 +1770,21 @@ class PHP {
1770
1770
  * or an internal crash.
1771
1771
  */
1772
1772
  enableRuntimeRotation(r) {
1773
- _(this, E, {
1774
- ...p(this, E),
1773
+ v(this, x, {
1774
+ ...u(this, x),
1775
1775
  enabled: !0,
1776
1776
  recreateRuntime: r.recreateRuntime,
1777
1777
  maxRequests: r.maxRequests ?? 400
1778
1778
  });
1779
1779
  }
1780
1780
  async rotateRuntime() {
1781
- if (!p(this, E).enabled)
1781
+ if (!u(this, x).enabled)
1782
1782
  throw new Error(
1783
1783
  "Runtime rotation is not enabled. Call enableRuntimeRotation() first."
1784
1784
  );
1785
1785
  await this.hotSwapPHPRuntime(
1786
- await p(this, E).recreateRuntime()
1787
- ), p(this, E).requestsMade = 0, p(this, E).needsRotating = !1;
1786
+ await u(this, x).recreateRuntime()
1787
+ ), u(this, x).requestsMade = 0, u(this, x).needsRotating = !1;
1788
1788
  }
1789
1789
  /**
1790
1790
  * Hot-swaps the PHP runtime for a new one without
@@ -1795,13 +1795,13 @@ class PHP {
1795
1795
  async hotSwapPHPRuntime(r) {
1796
1796
  const e = this[__private__dont__use].FS, t = this.listFiles("/").map((c) => `/${c}`), s = this[__private__dont__use].spawnProcess, n = e.cwd();
1797
1797
  e.chdir("/");
1798
- const i = Object.entries(p(this, C)).map(
1798
+ const i = Object.entries(u(this, $)).map(
1799
1799
  ([c, l]) => ({
1800
1800
  mountHandler: l.mountHandler,
1801
1801
  vfsPath: c
1802
1802
  })
1803
1803
  ), o = Object.values(
1804
- p(this, C)
1804
+ u(this, $)
1805
1805
  ).reverse();
1806
1806
  for (const c of o)
1807
1807
  await c.unmount();
@@ -1809,7 +1809,7 @@ class PHP {
1809
1809
  this.exit();
1810
1810
  } catch {
1811
1811
  }
1812
- this.initializeRuntime(r), s && (this[__private__dont__use].spawnProcess = s), p(this, N) && this.setSapiName(p(this, N));
1812
+ this.initializeRuntime(r), s && (this[__private__dont__use].spawnProcess = s), u(this, G) && this.setSapiName(u(this, G));
1813
1813
  const a = this[__private__dont__use].FS;
1814
1814
  for (const c of t)
1815
1815
  c && c !== "/request" && copyMEMFSNodes(e, a, c);
@@ -1844,11 +1844,11 @@ class PHP {
1844
1844
  try {
1845
1845
  await t();
1846
1846
  } finally {
1847
- delete p(this, C)[r];
1847
+ delete u(this, $)[r];
1848
1848
  }
1849
1849
  }
1850
1850
  };
1851
- return p(this, C)[r] = s, () => s.unmount();
1851
+ return u(this, $)[r] = s, () => s.unmount();
1852
1852
  }
1853
1853
  /**
1854
1854
  * Starts a PHP CLI session with given arguments.
@@ -1866,12 +1866,12 @@ class PHP {
1866
1866
  async cli(r, e = {}) {
1867
1867
  if (basename(r[0] ?? "") !== "php")
1868
1868
  return this.subProcess(r, e);
1869
- p(this, T) && (p(this, E).needsRotating = !0);
1869
+ u(this, B) && (u(this, x).needsRotating = !0);
1870
1870
  const t = await this.semaphore.acquire();
1871
- return await w(this, f, X).call(this, () => {
1871
+ return await P(this, y, de).call(this, () => {
1872
1872
  const s = e.env || {};
1873
1873
  for (const [n, i] of Object.entries(s))
1874
- w(this, f, J).call(this, n, i);
1874
+ P(this, y, le).call(this, n, i);
1875
1875
  r = [r[0], "-c", PHP_INI_PATH, ...r.slice(1)];
1876
1876
  for (const n of r)
1877
1877
  this[__private__dont__use].ccall(
@@ -1884,7 +1884,7 @@ class PHP {
1884
1884
  async: !0
1885
1885
  });
1886
1886
  }).then((s) => (s.exitCode.finally(t), s)).finally(() => {
1887
- p(this, E).needsRotating = !0;
1887
+ u(this, x).needsRotating = !0;
1888
1888
  });
1889
1889
  }
1890
1890
  /**
@@ -1966,13 +1966,13 @@ class PHP {
1966
1966
  this[__private__dont__use]._exit(r);
1967
1967
  } catch {
1968
1968
  }
1969
- _(this, T, !1), _(this, L, null), this[__private__dont__use] && (delete this[__private__dont__use].onMessage, delete this[__private__dont__use]);
1969
+ v(this, B, !1), v(this, q, null), this[__private__dont__use] && (delete this[__private__dont__use].onMessage, delete this[__private__dont__use]);
1970
1970
  }
1971
1971
  [Symbol.dispose]() {
1972
1972
  this.exit(0);
1973
1973
  }
1974
1974
  }
1975
- N = new WeakMap(), T = new WeakMap(), L = new WeakMap(), R = new WeakMap(), I = new WeakMap(), C = new WeakMap(), E = new WeakMap(), f = new WeakSet(), /**
1975
+ G = new WeakMap(), B = new WeakMap(), q = new WeakMap(), U = new WeakMap(), W = new WeakMap(), $ = new WeakMap(), x = new WeakMap(), y = new WeakSet(), /**
1976
1976
  * Prepares the $_SERVER entries for the PHP runtime.
1977
1977
  *
1978
1978
  * @param defaults Default entries to include in $_SERVER.
@@ -1981,7 +1981,7 @@ N = new WeakMap(), T = new WeakMap(), L = new WeakMap(), R = new WeakMap(), I =
1981
1981
  * was provided.
1982
1982
  * @returns Computed $_SERVER entries.
1983
1983
  */
1984
- ee = function(r, e, t) {
1984
+ pe = function(r, e, t) {
1985
1985
  const s = {
1986
1986
  ...r || {}
1987
1987
  };
@@ -1991,7 +1991,7 @@ ee = function(r, e, t) {
1991
1991
  ["content-type", "content-length"].includes(n.toLowerCase()) && (i = ""), s[`${i}${n.toUpperCase().replace(/-/g, "_")}`] = e[n];
1992
1992
  }
1993
1993
  return s;
1994
- }, te = function(r) {
1994
+ }, he = function(r) {
1995
1995
  this[__private__dont__use].ccall(
1996
1996
  "wasm_set_request_uri",
1997
1997
  null,
@@ -2005,35 +2005,35 @@ ee = function(r, e, t) {
2005
2005
  [STRING],
2006
2006
  [e]
2007
2007
  );
2008
- }, re = function(r) {
2008
+ }, fe = function(r) {
2009
2009
  this[__private__dont__use].ccall(
2010
2010
  "wasm_set_request_host",
2011
2011
  null,
2012
2012
  [STRING],
2013
2013
  [r]
2014
2014
  );
2015
- }, se = function(r) {
2015
+ }, me = function(r) {
2016
2016
  this[__private__dont__use].ccall(
2017
2017
  "wasm_set_request_port",
2018
2018
  null,
2019
2019
  [NUMBER],
2020
2020
  [r]
2021
2021
  );
2022
- }, ne = function(r, e) {
2022
+ }, ye = function(r, e) {
2023
2023
  let t;
2024
2024
  try {
2025
2025
  t = parseInt(new URL(r).port, 10);
2026
2026
  } catch {
2027
2027
  }
2028
2028
  return (!t || isNaN(t) || t === 80) && (t = e === "https" ? 443 : 80), t;
2029
- }, ie = function(r) {
2029
+ }, ge = function(r) {
2030
2030
  this[__private__dont__use].ccall(
2031
2031
  "wasm_set_request_method",
2032
2032
  null,
2033
2033
  [STRING],
2034
2034
  [r]
2035
2035
  );
2036
- }, oe = function(r) {
2036
+ }, Pe = function(r) {
2037
2037
  r.cookie && this[__private__dont__use].ccall(
2038
2038
  "wasm_set_cookies",
2039
2039
  null,
@@ -2050,7 +2050,7 @@ ee = function(r, e, t) {
2050
2050
  [NUMBER],
2051
2051
  [parseInt(r["content-length"], 10)]
2052
2052
  );
2053
- }, ae = function(r) {
2053
+ }, we = function(r) {
2054
2054
  let e, t;
2055
2055
  typeof r == "string" ? (logger.warn(
2056
2056
  "Passing a string as the request body is deprecated. Please use a Uint8Array instead. See https://github.com/WordPress/wordpress-playground/issues/997 for more details"
@@ -2073,55 +2073,55 @@ ee = function(r, e, t) {
2073
2073
  [NUMBER],
2074
2074
  [t]
2075
2075
  ), s;
2076
- }, Y = function(r) {
2076
+ }, ce = function(r) {
2077
2077
  this[__private__dont__use].ccall(
2078
2078
  "wasm_set_path_translated",
2079
2079
  null,
2080
2080
  [STRING],
2081
2081
  [r]
2082
2082
  );
2083
- }, ce = function(r, e) {
2083
+ }, _e = function(r, e) {
2084
2084
  this[__private__dont__use].ccall(
2085
2085
  "wasm_add_SERVER_entry",
2086
2086
  null,
2087
2087
  [STRING, STRING],
2088
2088
  [r, e]
2089
2089
  );
2090
- }, J = function(r, e) {
2090
+ }, le = function(r, e) {
2091
2091
  this[__private__dont__use].ccall(
2092
2092
  "wasm_add_ENV_entry",
2093
2093
  null,
2094
2094
  [STRING, STRING],
2095
2095
  [r, e]
2096
2096
  );
2097
- }, X = async function(r) {
2098
- p(this, E).enabled && p(this, E).needsRotating && await this.rotateRuntime(), ++p(this, E).requestsMade, p(this, E).requestsMade >= p(this, E).maxRequests && (p(this, E).needsRotating = !0);
2097
+ }, de = async function(r) {
2098
+ u(this, x).enabled && u(this, x).needsRotating && await this.rotateRuntime(), ++u(this, x).requestsMade, u(this, x).requestsMade >= u(this, x).maxRequests && (u(this, x).needsRotating = !0);
2099
2099
  const e = this[__private__dont__use], t = await createInvertedReadableStream();
2100
- e.onHeaders = (d) => {
2101
- a || s || t.controller.enqueue(d.slice());
2100
+ e.onHeaders = (p) => {
2101
+ a || s || t.controller.enqueue(p.slice());
2102
2102
  };
2103
2103
  let s = !1;
2104
2104
  const n = () => {
2105
2105
  s || (s = !0, t.controller.close());
2106
2106
  }, i = await createInvertedReadableStream();
2107
- e.onStdout = (d) => {
2108
- n(), !a && i.controller.enqueue(d.slice());
2107
+ e.onStdout = (p) => {
2108
+ n(), !a && i.controller.enqueue(p.slice());
2109
2109
  };
2110
2110
  const o = await createInvertedReadableStream();
2111
- e.onStderr = (d) => {
2112
- a || o.controller.enqueue(d.slice());
2111
+ e.onStderr = (p) => {
2112
+ a || o.controller.enqueue(p.slice());
2113
2113
  };
2114
2114
  let a = !1, c;
2115
- const u = (async () => {
2116
- var d;
2115
+ const d = (async () => {
2116
+ var p;
2117
2117
  try {
2118
2118
  return await Promise.race([
2119
2119
  r(),
2120
- new Promise((m, y) => {
2121
- var g;
2122
- c = (b) => {
2123
- isExitCode(b.error) || y(b.error);
2124
- }, (g = p(this, L)) == null || g.addEventListener(
2120
+ new Promise((f, k) => {
2121
+ var R;
2122
+ c = (N) => {
2123
+ isExitCode(N.error) || k(N.error);
2124
+ }, (R = u(this, q)) == null || R.addEventListener(
2125
2125
  "error",
2126
2126
  c,
2127
2127
  { once: !0 }
@@ -2132,42 +2132,42 @@ ee = function(r, e, t) {
2132
2132
  if (isExitCode(h))
2133
2133
  return h.status;
2134
2134
  safeStreamError$1(i.controller, h), safeStreamError$1(o.controller, h), safeStreamError$1(t.controller, h), a = !0;
2135
- for (const m in this)
2136
- typeof this[m] == "function" && (this[m] = () => {
2135
+ for (const f in this)
2136
+ typeof this[f] == "function" && (this[f] = () => {
2137
2137
  throw new Error(
2138
2138
  "PHP runtime has crashed – see the earlier error for details."
2139
2139
  );
2140
2140
  });
2141
2141
  throw this.functionsMaybeMissingFromAsyncify = getFunctionsMaybeMissingFromAsyncify(), h;
2142
2142
  } finally {
2143
- a || (safeStreamClose$1(i.controller), safeStreamClose$1(o.controller), n(), a = !0), (d = p(this, L)) == null || d.removeEventListener(
2143
+ a || (safeStreamClose$1(i.controller), safeStreamClose$1(o.controller), n(), a = !0), (p = u(this, q)) == null || p.removeEventListener(
2144
2144
  "error",
2145
2145
  c
2146
2146
  );
2147
2147
  }
2148
2148
  })().then(
2149
- (d) => (d !== 0 && this.dispatchEvent({
2149
+ (p) => (p !== 0 && this.dispatchEvent({
2150
2150
  type: "request.error",
2151
2151
  error: new Error(
2152
- `PHP.run() failed with exit code ${d}.`
2152
+ `PHP.run() failed with exit code ${p}.`
2153
2153
  ),
2154
2154
  // Distinguish between PHP request and PHP-wasm errors
2155
2155
  source: "php-wasm"
2156
- }), d),
2157
- (d) => {
2158
- const h = d.source ?? "php-wasm";
2156
+ }), p),
2157
+ (p) => {
2158
+ const h = p.source ?? "php-wasm";
2159
2159
  throw this.dispatchEvent({
2160
2160
  type: "request.error",
2161
- error: d,
2161
+ error: p,
2162
2162
  source: h
2163
- }), d;
2163
+ }), p;
2164
2164
  }
2165
2165
  );
2166
2166
  return new StreamedPHPResponse(
2167
2167
  t.stream,
2168
2168
  i.stream,
2169
2169
  o.stream,
2170
- u
2170
+ d
2171
2171
  );
2172
2172
  };
2173
2173
  function normalizeHeaders(r) {
@@ -2658,7 +2658,7 @@ const _default = "application/octet-stream", asx = "video/x-ms-asf", atom = "app
2658
2658
  xspf,
2659
2659
  zip
2660
2660
  };
2661
- var k, O, W, M, U, S, j, H, $, x, le, z, ue, de, pe;
2661
+ var A, Y, ee, z, J, M, X, j, te, H, ve, re, Ee, xe, Se;
2662
2662
  class PHPRequestHandler {
2663
2663
  /**
2664
2664
  * The request handler needs to decide whether to serve a static asset or
@@ -2672,24 +2672,24 @@ class PHPRequestHandler {
2672
2672
  * @param config - Request Handler configuration.
2673
2673
  */
2674
2674
  constructor(e) {
2675
- P(this, x);
2676
- P(this, k);
2677
- P(this, O);
2678
- P(this, W);
2679
- P(this, M);
2680
- P(this, U);
2681
- P(this, S);
2682
- P(this, j);
2683
- P(this, H);
2684
- P(this, $);
2675
+ _(this, H);
2676
+ _(this, A);
2677
+ _(this, Y);
2678
+ _(this, ee);
2679
+ _(this, z);
2680
+ _(this, J);
2681
+ _(this, M);
2682
+ _(this, X);
2683
+ _(this, j);
2684
+ _(this, te);
2685
2685
  const {
2686
2686
  documentRoot: t = "/www/",
2687
2687
  absoluteUrl: s = typeof location == "object" ? location.href : DEFAULT_BASE_URL,
2688
2688
  rewriteRules: n = [],
2689
2689
  pathAliases: i = [],
2690
2690
  getFileNotFoundAction: o = () => ({ type: "404" })
2691
- } = e, a = (u) => {
2692
- u.isDir(t) || u.mkdir(t), u.chdir(t), u.requestHandler = this;
2691
+ } = e, a = (d) => {
2692
+ d.isDir(t) || d.mkdir(t), d.chdir(t), d.requestHandler = this;
2693
2693
  };
2694
2694
  if (e.php)
2695
2695
  a(e.php), this.instanceManager = new SinglePHPInstanceManager({
@@ -2697,12 +2697,12 @@ class PHPRequestHandler {
2697
2697
  });
2698
2698
  else if (e.phpFactory)
2699
2699
  this.instanceManager = new PHPProcessManager({
2700
- phpFactory: async (u) => {
2701
- const d = await e.phpFactory({
2702
- ...u,
2700
+ phpFactory: async (d) => {
2701
+ const p = await e.phpFactory({
2702
+ ...d,
2703
2703
  requestHandler: this
2704
2704
  });
2705
- return a(d), d;
2705
+ return a(p), p;
2706
2706
  },
2707
2707
  maxPhpInstances: e.maxPhpInstances
2708
2708
  });
@@ -2710,18 +2710,18 @@ class PHPRequestHandler {
2710
2710
  throw new Error(
2711
2711
  "Either php or phpFactory must be provided in the configuration."
2712
2712
  );
2713
- _(this, H, e.cookieStore === void 0 ? new HttpCookieStore() : e.cookieStore), _(this, k, t);
2713
+ v(this, j, e.cookieStore === void 0 ? new HttpCookieStore() : e.cookieStore), v(this, A, t);
2714
2714
  const c = new URL(s);
2715
- _(this, W, c.hostname), _(this, M, c.port ? Number(c.port) : c.protocol === "https:" ? 443 : 80), _(this, O, (c.protocol || "").replace(":", ""));
2716
- const l = p(this, M) !== 443 && p(this, M) !== 80;
2717
- _(this, U, [
2718
- p(this, W),
2719
- l ? `:${p(this, M)}` : ""
2720
- ].join("")), _(this, S, c.pathname.replace(/\/+$/, "")), _(this, j, [
2721
- `${p(this, O)}://`,
2722
- p(this, U),
2723
- p(this, S)
2724
- ].join("")), this.rewriteRules = n, _(this, $, i), this.getFileNotFoundAction = o;
2715
+ v(this, ee, c.hostname), v(this, z, c.port ? Number(c.port) : c.protocol === "https:" ? 443 : 80), v(this, Y, (c.protocol || "").replace(":", ""));
2716
+ const l = u(this, z) !== 443 && u(this, z) !== 80;
2717
+ v(this, J, [
2718
+ u(this, ee),
2719
+ l ? `:${u(this, z)}` : ""
2720
+ ].join("")), v(this, M, c.pathname.replace(/\/+$/, "")), v(this, X, [
2721
+ `${u(this, Y)}://`,
2722
+ u(this, J),
2723
+ u(this, M)
2724
+ ].join("")), this.rewriteRules = n, v(this, te, i), this.getFileNotFoundAction = o;
2725
2725
  }
2726
2726
  async getPrimaryPhp() {
2727
2727
  return await this.instanceManager.getPrimaryPhp();
@@ -2745,20 +2745,20 @@ class PHPRequestHandler {
2745
2745
  */
2746
2746
  internalUrlToPath(e) {
2747
2747
  const t = new URL(e, "https://playground.internal");
2748
- return t.pathname.startsWith(p(this, S)) && (t.pathname = t.pathname.slice(p(this, S).length)), toRelativeUrl(t);
2748
+ return t.pathname.startsWith(u(this, M)) && (t.pathname = t.pathname.slice(u(this, M).length)), toRelativeUrl(t);
2749
2749
  }
2750
2750
  /**
2751
2751
  * The absolute URL of this PHPRequestHandler instance.
2752
2752
  */
2753
2753
  get absoluteUrl() {
2754
- return p(this, j);
2754
+ return u(this, X);
2755
2755
  }
2756
2756
  /**
2757
2757
  * The directory in the PHP filesystem where the server will look
2758
2758
  * for the files to serve. Default: `/var/www`.
2759
2759
  */
2760
2760
  get documentRoot() {
2761
- return p(this, k);
2761
+ return u(this, A);
2762
2762
  }
2763
2763
  /**
2764
2764
  * Serves the request – either by serving a static file, or by
@@ -2834,15 +2834,15 @@ class PHPRequestHandler {
2834
2834
  // Remove the hash part of the URL as it's not meant for the server.
2835
2835
  e.url.split("#")[0],
2836
2836
  t ? void 0 : DEFAULT_BASE_URL
2837
- ), n = w(this, x, le).call(this, s), i = await this.getPrimaryPhp(), o = removePathPrefix(
2837
+ ), n = P(this, H, ve).call(this, s), i = await this.getPrimaryPhp(), o = removePathPrefix(
2838
2838
  /**
2839
2839
  * URL.pathname returns a URL-encoded path. We need to decode it
2840
2840
  * before using it as a filesystem path.
2841
2841
  */
2842
2842
  decodeURIComponent(n.pathname),
2843
- p(this, S)
2843
+ u(this, M)
2844
2844
  );
2845
- let a = w(this, x, z).call(this, o);
2845
+ let a = P(this, H, re).call(this, o);
2846
2846
  if (i.isDir(a)) {
2847
2847
  if (!o.endsWith("/"))
2848
2848
  return StreamedPHPResponse.fromPHPResponse(
@@ -2867,10 +2867,10 @@ class PHPRequestHandler {
2867
2867
  let c = o;
2868
2868
  for (; c.startsWith("/") && c !== dirname(c); ) {
2869
2869
  c = dirname(c);
2870
- const l = w(this, x, z).call(this, c);
2870
+ const l = P(this, H, re).call(this, c);
2871
2871
  if (i.isFile(l) && // Only run partial path resolution for PHP files.
2872
2872
  l.endsWith(".php")) {
2873
- a = w(this, x, z).call(this, c);
2873
+ a = P(this, H, re).call(this, c);
2874
2874
  break;
2875
2875
  }
2876
2876
  }
@@ -2885,7 +2885,7 @@ class PHPRequestHandler {
2885
2885
  c.response
2886
2886
  );
2887
2887
  case "internal-redirect":
2888
- a = joinPaths(p(this, k), c.uri);
2888
+ a = joinPaths(u(this, A), c.uri);
2889
2889
  break;
2890
2890
  case "404":
2891
2891
  return StreamedPHPResponse.forHttpCode(404);
@@ -2895,8 +2895,8 @@ class PHPRequestHandler {
2895
2895
  );
2896
2896
  }
2897
2897
  }
2898
- return i.isFile(a) ? a.endsWith(".php") ? await w(this, x, de).call(this, e, s, n, a) : StreamedPHPResponse.fromPHPResponse(
2899
- w(this, x, ue).call(this, i, a)
2898
+ return i.isFile(a) ? a.endsWith(".php") ? await P(this, H, xe).call(this, e, s, n, a) : StreamedPHPResponse.fromPHPResponse(
2899
+ P(this, H, Ee).call(this, i, a)
2900
2900
  ) : StreamedPHPResponse.forHttpCode(404);
2901
2901
  }
2902
2902
  /**
@@ -2990,11 +2990,11 @@ class PHPRequestHandler {
2990
2990
  prepare_$_SERVER_superglobal(e, t, s) {
2991
2991
  const n = {
2992
2992
  REMOTE_ADDR: "127.0.0.1",
2993
- DOCUMENT_ROOT: p(this, k),
2994
- HTTPS: p(this, j).startsWith("https://") ? "on" : ""
2993
+ DOCUMENT_ROOT: u(this, A),
2994
+ HTTPS: u(this, X).startsWith("https://") ? "on" : ""
2995
2995
  };
2996
- return n.REQUEST_URI = e.pathname + e.search, s.startsWith(p(this, k)) && (n.SCRIPT_NAME = s.substring(
2997
- p(this, k).length
2996
+ return n.REQUEST_URI = e.pathname + e.search, s.startsWith(u(this, A)) && (n.SCRIPT_NAME = s.substring(
2997
+ u(this, A).length
2998
2998
  ), n.PHP_SELF = t.pathname, n.REQUEST_URI.startsWith(n.SCRIPT_NAME) && (n.PATH_INFO = n.REQUEST_URI.substring(
2999
2999
  n.SCRIPT_NAME.length
3000
3000
  ), n.PATH_INFO.includes("?") && (n.PATH_INFO = n.PATH_INFO.substring(
@@ -3006,21 +3006,21 @@ class PHPRequestHandler {
3006
3006
  await this.instanceManager[Symbol.asyncDispose]();
3007
3007
  }
3008
3008
  }
3009
- k = new WeakMap(), O = new WeakMap(), W = new WeakMap(), M = new WeakMap(), U = new WeakMap(), S = new WeakMap(), j = new WeakMap(), H = new WeakMap(), $ = new WeakMap(), x = new WeakSet(), /**
3009
+ A = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), z = new WeakMap(), J = new WeakMap(), M = new WeakMap(), X = new WeakMap(), j = new WeakMap(), te = new WeakMap(), H = new WeakSet(), /**
3010
3010
  * Apply the rewrite rules to the original request URL.
3011
3011
  *
3012
3012
  * @param originalRequestUrl - The original request URL.
3013
3013
  * @returns The rewritten request URL.
3014
3014
  */
3015
- le = function(e) {
3015
+ ve = function(e) {
3016
3016
  const t = removePathPrefix(
3017
3017
  decodeURIComponent(e.pathname),
3018
- p(this, S)
3018
+ u(this, M)
3019
3019
  ), s = applyRewriteRules(
3020
3020
  t,
3021
3021
  this.rewriteRules
3022
3022
  ), n = new URL(
3023
- joinPaths(p(this, S), s),
3023
+ joinPaths(u(this, M), s),
3024
3024
  e.toString()
3025
3025
  );
3026
3026
  for (const [i, o] of e.searchParams.entries())
@@ -3035,20 +3035,20 @@ le = function(e) {
3035
3035
  * @param urlPath - The URL path to resolve (e.g., '/phpmyadmin/index.php')
3036
3036
  * @returns The resolved filesystem path
3037
3037
  */
3038
- z = function(e) {
3039
- for (const t of p(this, $))
3038
+ re = function(e) {
3039
+ for (const t of u(this, te))
3040
3040
  if (e === t.urlPrefix || e.startsWith(t.urlPrefix + "/")) {
3041
3041
  const s = e.slice(t.urlPrefix.length);
3042
3042
  return joinPaths(t.fsPath, s);
3043
3043
  }
3044
- return joinPaths(p(this, k), e);
3044
+ return joinPaths(u(this, A), e);
3045
3045
  }, /**
3046
3046
  * Serves a static file from the PHP filesystem.
3047
3047
  *
3048
3048
  * @param fsPath - Absolute path of the static file to serve.
3049
3049
  * @returns The response.
3050
3050
  */
3051
- ue = function(e, t) {
3051
+ Ee = function(e, t) {
3052
3052
  const s = e.readFileAsBuffer(t);
3053
3053
  return new PHPResponse(
3054
3054
  200,
@@ -3063,7 +3063,7 @@ ue = function(e, t) {
3063
3063
  },
3064
3064
  s
3065
3065
  );
3066
- }, de = async function(e, t, s, n) {
3066
+ }, xe = async function(e, t, s, n) {
3067
3067
  let i;
3068
3068
  try {
3069
3069
  i = await this.instanceManager.acquirePHPInstance();
@@ -3072,32 +3072,32 @@ ue = function(e, t) {
3072
3072
  }
3073
3073
  let o;
3074
3074
  try {
3075
- o = await w(this, x, pe).call(this, i.php, e, t, s, n);
3075
+ o = await P(this, H, Se).call(this, i.php, e, t, s, n);
3076
3076
  } catch (a) {
3077
3077
  throw i.reap(), a;
3078
3078
  }
3079
3079
  return o.finished.finally(() => {
3080
3080
  i == null || i.reap();
3081
3081
  }), o;
3082
- }, pe = async function(e, t, s, n, i) {
3082
+ }, Se = async function(e, t, s, n, i) {
3083
3083
  let o = "GET";
3084
3084
  const a = {
3085
- host: p(this, U),
3085
+ host: u(this, J),
3086
3086
  ...normalizeHeaders(t.headers || {})
3087
3087
  };
3088
- p(this, H) && (a.cookie = p(this, H).getCookieRequestHeader());
3088
+ u(this, j) && (a.cookie = u(this, j).getCookieRequestHeader());
3089
3089
  let c = t.body;
3090
3090
  if (typeof c == "object" && !(c instanceof Uint8Array)) {
3091
3091
  o = "POST";
3092
- const { bytes: u, contentType: d } = await encodeAsMultipart(c);
3093
- c = u, a["content-type"] = d;
3092
+ const { bytes: d, contentType: p } = await encodeAsMultipart(c);
3093
+ c = d, a["content-type"] = p;
3094
3094
  }
3095
3095
  const l = await e.runStream({
3096
3096
  relativeUri: ensurePathPrefix(
3097
3097
  toRelativeUrl(new URL(n.toString())),
3098
- p(this, S)
3098
+ u(this, M)
3099
3099
  ),
3100
- protocol: p(this, O),
3100
+ protocol: u(this, Y),
3101
3101
  method: t.method || o,
3102
3102
  $_SERVER: this.prepare_$_SERVER_superglobal(
3103
3103
  s,
@@ -3108,10 +3108,10 @@ ue = function(e, t) {
3108
3108
  scriptPath: i,
3109
3109
  headers: a
3110
3110
  });
3111
- if (p(this, H)) {
3112
- const u = await l.headers;
3113
- p(this, H).rememberCookiesFromResponseHeaders(
3114
- u
3111
+ if (u(this, j)) {
3112
+ const d = await l.headers;
3113
+ u(this, j).rememberCookiesFromResponseHeaders(
3114
+ d
3115
3115
  );
3116
3116
  }
3117
3117
  return l;
@@ -3152,137 +3152,150 @@ async function writeFiles(r, e, t, { rmRoot: s = !1 } = {}) {
3152
3152
  await r.fileExists(dirname(o)) || await r.mkdir(dirname(o)), i instanceof Uint8Array || typeof i == "string" ? await r.writeFile(o, i) : await writeFiles(r, o, i);
3153
3153
  }
3154
3154
  }
3155
- const schema15 = {
3155
+ const schema13 = {
3156
3156
  properties: {
3157
- type: {
3158
- enum: ["file", "directory"]
3157
+ nodes: {
3158
+ items: {
3159
+ properties: {
3160
+ type: {
3161
+ enum: ["file", "directory"]
3162
+ }
3163
+ }
3164
+ }
3159
3165
  }
3160
3166
  }
3161
3167
  };
3162
- function validate13(r, { instancePath: e = "", parentData: t, parentDataProperty: s, rootData: n = r } = {}) {
3168
+ function validate11(r, { instancePath: e = "", parentData: t, parentDataProperty: s, rootData: n = r } = {}) {
3163
3169
  let i = null, o = 0;
3164
3170
  if (r && typeof r == "object" && !Array.isArray(r)) {
3165
- for (const u in r)
3166
- if (!(u === "vfsRoot" || u === "nodes"))
3167
- return validate13.errors = [
3171
+ let N;
3172
+ if (r.name === void 0 && (N = "name") || r.artifacts === void 0 && (N = "artifacts"))
3173
+ return validate11.errors = [
3174
+ {
3175
+ instancePath: e,
3176
+ schemaPath: "#/required",
3177
+ keyword: "required",
3178
+ params: { missingProperty: N },
3179
+ message: "must have required property '" + N + "'"
3180
+ }
3181
+ ], !1;
3182
+ for (const m in r)
3183
+ if (!(m === "name" || m === "version" || m === "mode" || m === "artifacts" || m === "extraFiles"))
3184
+ return validate11.errors = [
3168
3185
  {
3169
3186
  instancePath: e,
3170
3187
  schemaPath: "#/additionalProperties",
3171
3188
  keyword: "additionalProperties",
3172
- params: { additionalProperty: u },
3189
+ params: { additionalProperty: m },
3173
3190
  message: "must NOT have additional properties"
3174
3191
  }
3175
3192
  ], !1;
3176
3193
  {
3177
- if (r.vfsRoot !== void 0) {
3178
- const u = o;
3179
- if (typeof r.vfsRoot != "string")
3180
- return validate13.errors = [
3194
+ if (r.name !== void 0) {
3195
+ const m = o;
3196
+ if (typeof r.name != "string")
3197
+ return validate11.errors = [
3181
3198
  {
3182
- instancePath: e + "/vfsRoot",
3183
- schemaPath: "#/properties/vfsRoot/type",
3199
+ instancePath: e + "/name",
3200
+ schemaPath: "#/properties/name/type",
3184
3201
  keyword: "type",
3185
3202
  params: { type: "string" },
3186
3203
  message: "must be string"
3187
3204
  }
3188
3205
  ], !1;
3189
- var a = u === o;
3206
+ var a = m === o;
3190
3207
  } else
3191
3208
  var a = !0;
3192
- if (a)
3193
- if (r.nodes !== void 0) {
3194
- let u = r.nodes;
3195
- const d = o;
3196
- if (Array.isArray(u)) {
3197
- var c = !0;
3198
- const m = u.length;
3199
- for (let y = 0; y < m; y++) {
3200
- let g = u[y];
3201
- const b = o;
3202
- if (g && typeof g == "object" && !Array.isArray(g)) {
3203
- let D;
3204
- if (g.vfsPath === void 0 && (D = "vfsPath"))
3205
- return validate13.errors = [
3206
- {
3207
- instancePath: e + "/nodes/" + y,
3208
- schemaPath: "#/definitions/PHPExtensionManifestExtraFile/required",
3209
- keyword: "required",
3210
- params: {
3211
- missingProperty: D
3212
- },
3213
- message: "must have required property '" + D + "'"
3214
- }
3215
- ], !1;
3216
- for (const v in g)
3217
- if (!(v === "vfsPath" || v === "type" || v === "sourcePath"))
3218
- return validate13.errors = [
3219
- {
3220
- instancePath: e + "/nodes/" + y,
3221
- schemaPath: "#/definitions/PHPExtensionManifestExtraFile/additionalProperties",
3222
- keyword: "additionalProperties",
3223
- params: {
3224
- additionalProperty: v
3225
- },
3226
- message: "must NOT have additional properties"
3227
- }
3228
- ], !1;
3209
+ if (a) {
3210
+ if (r.version !== void 0) {
3211
+ const m = o;
3212
+ if (typeof r.version != "string")
3213
+ return validate11.errors = [
3214
+ {
3215
+ instancePath: e + "/version",
3216
+ schemaPath: "#/properties/version/type",
3217
+ keyword: "type",
3218
+ params: { type: "string" },
3219
+ message: "must be string"
3220
+ }
3221
+ ], !1;
3222
+ var a = m === o;
3223
+ } else
3224
+ var a = !0;
3225
+ if (a) {
3226
+ if (r.mode !== void 0) {
3227
+ let m = r.mode;
3228
+ const D = o;
3229
+ if (typeof m != "string")
3230
+ return validate11.errors = [
3229
3231
  {
3230
- if (g.vfsPath !== void 0) {
3231
- const v = o;
3232
- if (typeof g.vfsPath != "string")
3233
- return validate13.errors = [
3232
+ instancePath: e + "/mode",
3233
+ schemaPath: "#/properties/mode/type",
3234
+ keyword: "type",
3235
+ params: { type: "string" },
3236
+ message: "must be string"
3237
+ }
3238
+ ], !1;
3239
+ if (m !== "php-extension")
3240
+ return validate11.errors = [
3241
+ {
3242
+ instancePath: e + "/mode",
3243
+ schemaPath: "#/properties/mode/const",
3244
+ keyword: "const",
3245
+ params: {
3246
+ allowedValue: "php-extension"
3247
+ },
3248
+ message: "must be equal to constant"
3249
+ }
3250
+ ], !1;
3251
+ var a = D === o;
3252
+ } else
3253
+ var a = !0;
3254
+ if (a) {
3255
+ if (r.artifacts !== void 0) {
3256
+ let m = r.artifacts;
3257
+ const D = o;
3258
+ if (Array.isArray(m)) {
3259
+ var c = !0;
3260
+ const S = m.length;
3261
+ for (let g = 0; g < S; g++) {
3262
+ let b = m[g];
3263
+ const Q = o;
3264
+ if (b && typeof b == "object" && !Array.isArray(b)) {
3265
+ let F;
3266
+ if (b.phpVersion === void 0 && (F = "phpVersion") || b.sourcePath === void 0 && (F = "sourcePath"))
3267
+ return validate11.errors = [
3234
3268
  {
3235
- instancePath: e + "/nodes/" + y + "/vfsPath",
3236
- schemaPath: "#/definitions/PHPExtensionManifestExtraFile/properties/vfsPath/type",
3237
- keyword: "type",
3269
+ instancePath: e + "/artifacts/" + g,
3270
+ schemaPath: "#/properties/artifacts/items/required",
3271
+ keyword: "required",
3238
3272
  params: {
3239
- type: "string"
3273
+ missingProperty: F
3240
3274
  },
3241
- message: "must be string"
3275
+ message: "must have required property '" + F + "'"
3242
3276
  }
3243
3277
  ], !1;
3244
- var l = v === o;
3245
- } else
3246
- var l = !0;
3247
- if (l) {
3248
- if (g.type !== void 0) {
3249
- let v = g.type;
3250
- const A = o;
3251
- if (typeof v != "string")
3252
- return validate13.errors = [
3253
- {
3254
- instancePath: e + "/nodes/" + y + "/type",
3255
- schemaPath: "#/definitions/PHPExtensionManifestExtraFile/properties/type/type",
3256
- keyword: "type",
3257
- params: {
3258
- type: "string"
3259
- },
3260
- message: "must be string"
3261
- }
3262
- ], !1;
3263
- if (!(v === "file" || v === "directory"))
3264
- return validate13.errors = [
3278
+ for (const E in b)
3279
+ if (!(E === "phpVersion" || E === "sourcePath" || E === "extraFiles"))
3280
+ return validate11.errors = [
3265
3281
  {
3266
- instancePath: e + "/nodes/" + y + "/type",
3267
- schemaPath: "#/definitions/PHPExtensionManifestExtraFile/properties/type/enum",
3268
- keyword: "enum",
3282
+ instancePath: e + "/artifacts/" + g,
3283
+ schemaPath: "#/properties/artifacts/items/additionalProperties",
3284
+ keyword: "additionalProperties",
3269
3285
  params: {
3270
- allowedValues: schema15.properties.type.enum
3286
+ additionalProperty: E
3271
3287
  },
3272
- message: "must be equal to one of the allowed values"
3288
+ message: "must NOT have additional properties"
3273
3289
  }
3274
3290
  ], !1;
3275
- var l = A === o;
3276
- } else
3277
- var l = !0;
3278
- if (l)
3279
- if (g.sourcePath !== void 0) {
3280
- const v = o;
3281
- if (typeof g.sourcePath != "string")
3282
- return validate13.errors = [
3291
+ {
3292
+ if (b.phpVersion !== void 0) {
3293
+ const E = o;
3294
+ if (typeof b.phpVersion != "string")
3295
+ return validate11.errors = [
3283
3296
  {
3284
- instancePath: e + "/nodes/" + y + "/sourcePath",
3285
- schemaPath: "#/definitions/PHPExtensionManifestExtraFile/properties/sourcePath/type",
3297
+ instancePath: e + "/artifacts/" + g + "/phpVersion",
3298
+ schemaPath: "#/properties/artifacts/items/properties/phpVersion/type",
3286
3299
  keyword: "type",
3287
3300
  params: {
3288
3301
  type: "string"
@@ -3290,291 +3303,460 @@ function validate13(r, { instancePath: e = "", parentData: t, parentDataProperty
3290
3303
  message: "must be string"
3291
3304
  }
3292
3305
  ], !1;
3293
- var l = v === o;
3306
+ var l = E === o;
3294
3307
  } else
3295
3308
  var l = !0;
3296
- }
3309
+ if (l) {
3310
+ if (b.sourcePath !== void 0) {
3311
+ const E = o;
3312
+ if (typeof b.sourcePath != "string")
3313
+ return validate11.errors = [
3314
+ {
3315
+ instancePath: e + "/artifacts/" + g + "/sourcePath",
3316
+ schemaPath: "#/properties/artifacts/items/properties/sourcePath/type",
3317
+ keyword: "type",
3318
+ params: {
3319
+ type: "string"
3320
+ },
3321
+ message: "must be string"
3322
+ }
3323
+ ], !1;
3324
+ var l = E === o;
3325
+ } else
3326
+ var l = !0;
3327
+ if (l)
3328
+ if (b.extraFiles !== void 0) {
3329
+ let E = b.extraFiles;
3330
+ const Fe = o;
3331
+ if (E && typeof E == "object" && !Array.isArray(
3332
+ E
3333
+ )) {
3334
+ for (const w in E)
3335
+ if (!(w === "vfsRoot" || w === "nodes"))
3336
+ return validate11.errors = [
3337
+ {
3338
+ instancePath: e + "/artifacts/" + g + "/extraFiles",
3339
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/additionalProperties",
3340
+ keyword: "additionalProperties",
3341
+ params: {
3342
+ additionalProperty: w
3343
+ },
3344
+ message: "must NOT have additional properties"
3345
+ }
3346
+ ], !1;
3347
+ {
3348
+ if (E.vfsRoot !== void 0) {
3349
+ const w = o;
3350
+ if (typeof E.vfsRoot != "string")
3351
+ return validate11.errors = [
3352
+ {
3353
+ instancePath: e + "/artifacts/" + g + "/extraFiles/vfsRoot",
3354
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/vfsRoot/type",
3355
+ keyword: "type",
3356
+ params: {
3357
+ type: "string"
3358
+ },
3359
+ message: "must be string"
3360
+ }
3361
+ ], !1;
3362
+ var d = w === o;
3363
+ } else
3364
+ var d = !0;
3365
+ if (d)
3366
+ if (E.nodes !== void 0) {
3367
+ let w = E.nodes;
3368
+ const ie = o;
3369
+ if (Array.isArray(
3370
+ w
3371
+ )) {
3372
+ var p = !0;
3373
+ const ke = w.length;
3374
+ for (let C = 0; C < ke; C++) {
3375
+ let L = w[C];
3376
+ const Re = o;
3377
+ if (L && typeof L == "object" && !Array.isArray(
3378
+ L
3379
+ )) {
3380
+ let oe;
3381
+ if (L.vfsPath === void 0 && (oe = "vfsPath"))
3382
+ return validate11.errors = [
3383
+ {
3384
+ instancePath: e + "/artifacts/" + g + "/extraFiles/nodes/" + C,
3385
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/required",
3386
+ keyword: "required",
3387
+ params: {
3388
+ missingProperty: oe
3389
+ },
3390
+ message: "must have required property '" + oe + "'"
3391
+ }
3392
+ ], !1;
3393
+ for (const T in L)
3394
+ if (!(T === "vfsPath" || T === "type" || T === "sourcePath"))
3395
+ return validate11.errors = [
3396
+ {
3397
+ instancePath: e + "/artifacts/" + g + "/extraFiles/nodes/" + C,
3398
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/additionalProperties",
3399
+ keyword: "additionalProperties",
3400
+ params: {
3401
+ additionalProperty: T
3402
+ },
3403
+ message: "must NOT have additional properties"
3404
+ }
3405
+ ], !1;
3406
+ {
3407
+ if (L.vfsPath !== void 0) {
3408
+ const T = o;
3409
+ if (typeof L.vfsPath != "string")
3410
+ return validate11.errors = [
3411
+ {
3412
+ instancePath: e + "/artifacts/" + g + "/extraFiles/nodes/" + C + "/vfsPath",
3413
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/properties/vfsPath/type",
3414
+ keyword: "type",
3415
+ params: {
3416
+ type: "string"
3417
+ },
3418
+ message: "must be string"
3419
+ }
3420
+ ], !1;
3421
+ var h = T === o;
3422
+ } else
3423
+ var h = !0;
3424
+ if (h) {
3425
+ if (L.type !== void 0) {
3426
+ let T = L.type;
3427
+ const be = o;
3428
+ if (typeof T != "string")
3429
+ return validate11.errors = [
3430
+ {
3431
+ instancePath: e + "/artifacts/" + g + "/extraFiles/nodes/" + C + "/type",
3432
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/properties/type/type",
3433
+ keyword: "type",
3434
+ params: {
3435
+ type: "string"
3436
+ },
3437
+ message: "must be string"
3438
+ }
3439
+ ], !1;
3440
+ if (!(T === "file" || T === "directory"))
3441
+ return validate11.errors = [
3442
+ {
3443
+ instancePath: e + "/artifacts/" + g + "/extraFiles/nodes/" + C + "/type",
3444
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/properties/type/enum",
3445
+ keyword: "enum",
3446
+ params: {
3447
+ allowedValues: schema13.properties.nodes.items.properties.type.enum
3448
+ },
3449
+ message: "must be equal to one of the allowed values"
3450
+ }
3451
+ ], !1;
3452
+ var h = be === o;
3453
+ } else
3454
+ var h = !0;
3455
+ if (h)
3456
+ if (L.sourcePath !== void 0) {
3457
+ const T = o;
3458
+ if (typeof L.sourcePath != "string")
3459
+ return validate11.errors = [
3460
+ {
3461
+ instancePath: e + "/artifacts/" + g + "/extraFiles/nodes/" + C + "/sourcePath",
3462
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/properties/sourcePath/type",
3463
+ keyword: "type",
3464
+ params: {
3465
+ type: "string"
3466
+ },
3467
+ message: "must be string"
3468
+ }
3469
+ ], !1;
3470
+ var h = T === o;
3471
+ } else
3472
+ var h = !0;
3473
+ }
3474
+ }
3475
+ } else
3476
+ return validate11.errors = [
3477
+ {
3478
+ instancePath: e + "/artifacts/" + g + "/extraFiles/nodes/" + C,
3479
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/type",
3480
+ keyword: "type",
3481
+ params: {
3482
+ type: "object"
3483
+ },
3484
+ message: "must be object"
3485
+ }
3486
+ ], !1;
3487
+ var p = Re === o;
3488
+ if (!p)
3489
+ break;
3490
+ }
3491
+ } else
3492
+ return validate11.errors = [
3493
+ {
3494
+ instancePath: e + "/artifacts/" + g + "/extraFiles/nodes",
3495
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/type",
3496
+ keyword: "type",
3497
+ params: {
3498
+ type: "array"
3499
+ },
3500
+ message: "must be array"
3501
+ }
3502
+ ], !1;
3503
+ var d = ie === o;
3504
+ } else
3505
+ var d = !0;
3506
+ }
3507
+ } else
3508
+ return validate11.errors = [
3509
+ {
3510
+ instancePath: e + "/artifacts/" + g + "/extraFiles",
3511
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/type",
3512
+ keyword: "type",
3513
+ params: {
3514
+ type: "object"
3515
+ },
3516
+ message: "must be object"
3517
+ }
3518
+ ], !1;
3519
+ var l = Fe === o;
3520
+ } else
3521
+ var l = !0;
3522
+ }
3523
+ }
3524
+ } else
3525
+ return validate11.errors = [
3526
+ {
3527
+ instancePath: e + "/artifacts/" + g,
3528
+ schemaPath: "#/properties/artifacts/items/type",
3529
+ keyword: "type",
3530
+ params: {
3531
+ type: "object"
3532
+ },
3533
+ message: "must be object"
3534
+ }
3535
+ ], !1;
3536
+ var c = Q === o;
3537
+ if (!c)
3538
+ break;
3297
3539
  }
3298
3540
  } else
3299
- return validate13.errors = [
3300
- {
3301
- instancePath: e + "/nodes/" + y,
3302
- schemaPath: "#/definitions/PHPExtensionManifestExtraFile/type",
3303
- keyword: "type",
3304
- params: { type: "object" },
3305
- message: "must be object"
3306
- }
3307
- ], !1;
3308
- var c = b === o;
3309
- if (!c)
3310
- break;
3311
- }
3312
- } else
3313
- return validate13.errors = [
3314
- {
3315
- instancePath: e + "/nodes",
3316
- schemaPath: "#/properties/nodes/type",
3317
- keyword: "type",
3318
- params: { type: "array" },
3319
- message: "must be array"
3320
- }
3321
- ], !1;
3322
- var a = d === o;
3323
- } else
3324
- var a = !0;
3325
- }
3326
- } else
3327
- return validate13.errors = [
3328
- {
3329
- instancePath: e,
3330
- schemaPath: "#/type",
3331
- keyword: "type",
3332
- params: { type: "object" },
3333
- message: "must be object"
3334
- }
3335
- ], !1;
3336
- return validate13.errors = i, o === 0;
3337
- }
3338
- function validate12(r, { instancePath: e = "", parentData: t, parentDataProperty: s, rootData: n = r } = {}) {
3339
- let i = null, o = 0;
3340
- if (o === 0)
3341
- if (r && typeof r == "object" && !Array.isArray(r)) {
3342
- let c;
3343
- if (r.phpVersion === void 0 && (c = "phpVersion") || r.sourcePath === void 0 && (c = "sourcePath"))
3344
- return validate12.errors = [
3345
- {
3346
- instancePath: e,
3347
- schemaPath: "#/required",
3348
- keyword: "required",
3349
- params: { missingProperty: c },
3350
- message: "must have required property '" + c + "'"
3351
- }
3352
- ], !1;
3353
- {
3354
- const l = o;
3355
- for (const u in r)
3356
- if (!(u === "phpVersion" || u === "sourcePath" || u === "extraFiles"))
3357
- return validate12.errors = [
3358
- {
3359
- instancePath: e,
3360
- schemaPath: "#/additionalProperties",
3361
- keyword: "additionalProperties",
3362
- params: { additionalProperty: u },
3363
- message: "must NOT have additional properties"
3364
- }
3365
- ], !1;
3366
- if (l === o) {
3367
- if (r.phpVersion !== void 0) {
3368
- const u = o;
3369
- if (typeof r.phpVersion != "string")
3370
- return validate12.errors = [
3371
- {
3372
- instancePath: e + "/phpVersion",
3373
- schemaPath: "#/properties/phpVersion/type",
3374
- keyword: "type",
3375
- params: { type: "string" },
3376
- message: "must be string"
3377
- }
3378
- ], !1;
3379
- var a = u === o;
3380
- } else
3381
- var a = !0;
3382
- if (a) {
3383
- if (r.sourcePath !== void 0) {
3384
- const u = o;
3385
- if (typeof r.sourcePath != "string")
3386
- return validate12.errors = [
3541
+ return validate11.errors = [
3387
3542
  {
3388
- instancePath: e + "/sourcePath",
3389
- schemaPath: "#/properties/sourcePath/type",
3543
+ instancePath: e + "/artifacts",
3544
+ schemaPath: "#/properties/artifacts/type",
3390
3545
  keyword: "type",
3391
- params: { type: "string" },
3392
- message: "must be string"
3546
+ params: { type: "array" },
3547
+ message: "must be array"
3393
3548
  }
3394
3549
  ], !1;
3395
- var a = u === o;
3550
+ var a = D === o;
3396
3551
  } else
3397
3552
  var a = !0;
3398
3553
  if (a)
3399
3554
  if (r.extraFiles !== void 0) {
3400
- const u = o;
3401
- validate13(r.extraFiles, {
3402
- instancePath: e + "/extraFiles",
3403
- parentData: r,
3404
- parentDataProperty: "extraFiles",
3405
- rootData: n
3406
- }) || (i = i === null ? validate13.errors : i.concat(validate13.errors), o = i.length);
3407
- var a = u === o;
3408
- } else
3409
- var a = !0;
3410
- }
3411
- }
3412
- }
3413
- } else
3414
- return validate12.errors = [
3415
- {
3416
- instancePath: e,
3417
- schemaPath: "#/type",
3418
- keyword: "type",
3419
- params: { type: "object" },
3420
- message: "must be object"
3421
- }
3422
- ], !1;
3423
- return validate12.errors = i, o === 0;
3424
- }
3425
- function validate11(r, { instancePath: e = "", parentData: t, parentDataProperty: s, rootData: n = r } = {}) {
3426
- let i = null, o = 0;
3427
- if (o === 0)
3428
- if (r && typeof r == "object" && !Array.isArray(r)) {
3429
- let l;
3430
- if (r.name === void 0 && (l = "name") || r.artifacts === void 0 && (l = "artifacts"))
3431
- return validate11.errors = [
3432
- {
3433
- instancePath: e,
3434
- schemaPath: "#/required",
3435
- keyword: "required",
3436
- params: { missingProperty: l },
3437
- message: "must have required property '" + l + "'"
3438
- }
3439
- ], !1;
3440
- {
3441
- const u = o;
3442
- for (const d in r)
3443
- if (!(d === "name" || d === "version" || d === "mode" || d === "artifacts" || d === "extraFiles"))
3444
- return validate11.errors = [
3445
- {
3446
- instancePath: e,
3447
- schemaPath: "#/additionalProperties",
3448
- keyword: "additionalProperties",
3449
- params: { additionalProperty: d },
3450
- message: "must NOT have additional properties"
3451
- }
3452
- ], !1;
3453
- if (u === o) {
3454
- if (r.name !== void 0) {
3455
- const d = o;
3456
- if (typeof r.name != "string")
3457
- return validate11.errors = [
3458
- {
3459
- instancePath: e + "/name",
3460
- schemaPath: "#/properties/name/type",
3461
- keyword: "type",
3462
- params: { type: "string" },
3463
- message: "must be string"
3464
- }
3465
- ], !1;
3466
- var a = d === o;
3467
- } else
3468
- var a = !0;
3469
- if (a) {
3470
- if (r.version !== void 0) {
3471
- const d = o;
3472
- if (typeof r.version != "string")
3473
- return validate11.errors = [
3555
+ let m = r.extraFiles;
3556
+ const D = o;
3557
+ if (m && typeof m == "object" && !Array.isArray(m)) {
3558
+ for (const S in m)
3559
+ if (!(S === "vfsRoot" || S === "nodes"))
3560
+ return validate11.errors = [
3561
+ {
3562
+ instancePath: e + "/extraFiles",
3563
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/additionalProperties",
3564
+ keyword: "additionalProperties",
3565
+ params: {
3566
+ additionalProperty: S
3567
+ },
3568
+ message: "must NOT have additional properties"
3569
+ }
3570
+ ], !1;
3474
3571
  {
3475
- instancePath: e + "/version",
3476
- schemaPath: "#/properties/version/type",
3477
- keyword: "type",
3478
- params: { type: "string" },
3479
- message: "must be string"
3572
+ if (m.vfsRoot !== void 0) {
3573
+ const S = o;
3574
+ if (typeof m.vfsRoot != "string")
3575
+ return validate11.errors = [
3576
+ {
3577
+ instancePath: e + "/extraFiles/vfsRoot",
3578
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/vfsRoot/type",
3579
+ keyword: "type",
3580
+ params: {
3581
+ type: "string"
3582
+ },
3583
+ message: "must be string"
3584
+ }
3585
+ ], !1;
3586
+ var f = S === o;
3587
+ } else
3588
+ var f = !0;
3589
+ if (f)
3590
+ if (m.nodes !== void 0) {
3591
+ let S = m.nodes;
3592
+ const g = o;
3593
+ if (Array.isArray(
3594
+ S
3595
+ )) {
3596
+ var k = !0;
3597
+ const Q = S.length;
3598
+ for (let I = 0; I < Q; I++) {
3599
+ let F = S[I];
3600
+ const E = o;
3601
+ if (F && typeof F == "object" && !Array.isArray(
3602
+ F
3603
+ )) {
3604
+ let ne;
3605
+ if (F.vfsPath === void 0 && (ne = "vfsPath"))
3606
+ return validate11.errors = [
3607
+ {
3608
+ instancePath: e + "/extraFiles/nodes/" + I,
3609
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/required",
3610
+ keyword: "required",
3611
+ params: {
3612
+ missingProperty: ne
3613
+ },
3614
+ message: "must have required property '" + ne + "'"
3615
+ }
3616
+ ], !1;
3617
+ for (const w in F)
3618
+ if (!(w === "vfsPath" || w === "type" || w === "sourcePath"))
3619
+ return validate11.errors = [
3620
+ {
3621
+ instancePath: e + "/extraFiles/nodes/" + I,
3622
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/additionalProperties",
3623
+ keyword: "additionalProperties",
3624
+ params: {
3625
+ additionalProperty: w
3626
+ },
3627
+ message: "must NOT have additional properties"
3628
+ }
3629
+ ], !1;
3630
+ {
3631
+ if (F.vfsPath !== void 0) {
3632
+ const w = o;
3633
+ if (typeof F.vfsPath != "string")
3634
+ return validate11.errors = [
3635
+ {
3636
+ instancePath: e + "/extraFiles/nodes/" + I + "/vfsPath",
3637
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/properties/vfsPath/type",
3638
+ keyword: "type",
3639
+ params: {
3640
+ type: "string"
3641
+ },
3642
+ message: "must be string"
3643
+ }
3644
+ ], !1;
3645
+ var R = w === o;
3646
+ } else
3647
+ var R = !0;
3648
+ if (R) {
3649
+ if (F.type !== void 0) {
3650
+ let w = F.type;
3651
+ const ie = o;
3652
+ if (typeof w != "string")
3653
+ return validate11.errors = [
3654
+ {
3655
+ instancePath: e + "/extraFiles/nodes/" + I + "/type",
3656
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/properties/type/type",
3657
+ keyword: "type",
3658
+ params: {
3659
+ type: "string"
3660
+ },
3661
+ message: "must be string"
3662
+ }
3663
+ ], !1;
3664
+ if (!(w === "file" || w === "directory"))
3665
+ return validate11.errors = [
3666
+ {
3667
+ instancePath: e + "/extraFiles/nodes/" + I + "/type",
3668
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/properties/type/enum",
3669
+ keyword: "enum",
3670
+ params: {
3671
+ allowedValues: schema13.properties.nodes.items.properties.type.enum
3672
+ },
3673
+ message: "must be equal to one of the allowed values"
3674
+ }
3675
+ ], !1;
3676
+ var R = ie === o;
3677
+ } else
3678
+ var R = !0;
3679
+ if (R)
3680
+ if (F.sourcePath !== void 0) {
3681
+ const w = o;
3682
+ if (typeof F.sourcePath != "string")
3683
+ return validate11.errors = [
3684
+ {
3685
+ instancePath: e + "/extraFiles/nodes/" + I + "/sourcePath",
3686
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/properties/sourcePath/type",
3687
+ keyword: "type",
3688
+ params: {
3689
+ type: "string"
3690
+ },
3691
+ message: "must be string"
3692
+ }
3693
+ ], !1;
3694
+ var R = w === o;
3695
+ } else
3696
+ var R = !0;
3697
+ }
3698
+ }
3699
+ } else
3700
+ return validate11.errors = [
3701
+ {
3702
+ instancePath: e + "/extraFiles/nodes/" + I,
3703
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/items/type",
3704
+ keyword: "type",
3705
+ params: {
3706
+ type: "object"
3707
+ },
3708
+ message: "must be object"
3709
+ }
3710
+ ], !1;
3711
+ var k = E === o;
3712
+ if (!k)
3713
+ break;
3714
+ }
3715
+ } else
3716
+ return validate11.errors = [
3717
+ {
3718
+ instancePath: e + "/extraFiles/nodes",
3719
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/properties/nodes/type",
3720
+ keyword: "type",
3721
+ params: {
3722
+ type: "array"
3723
+ },
3724
+ message: "must be array"
3725
+ }
3726
+ ], !1;
3727
+ var f = g === o;
3728
+ } else
3729
+ var f = !0;
3480
3730
  }
3481
- ], !1;
3482
- var a = d === o;
3483
- } else
3484
- var a = !0;
3485
- if (a) {
3486
- if (r.mode !== void 0) {
3487
- let d = r.mode;
3488
- const h = o;
3489
- if (typeof d != "string")
3731
+ } else
3490
3732
  return validate11.errors = [
3491
3733
  {
3492
- instancePath: e + "/mode",
3493
- schemaPath: "#/properties/mode/type",
3734
+ instancePath: e + "/extraFiles",
3735
+ schemaPath: "#/definitions/PHPExtensionManifestExtraFiles/type",
3494
3736
  keyword: "type",
3495
- params: { type: "string" },
3496
- message: "must be string"
3497
- }
3498
- ], !1;
3499
- if (d !== "php-extension")
3500
- return validate11.errors = [
3501
- {
3502
- instancePath: e + "/mode",
3503
- schemaPath: "#/properties/mode/const",
3504
- keyword: "const",
3505
3737
  params: {
3506
- allowedValue: "php-extension"
3738
+ type: "object"
3507
3739
  },
3508
- message: "must be equal to constant"
3740
+ message: "must be object"
3509
3741
  }
3510
3742
  ], !1;
3511
- var a = h === o;
3743
+ var a = D === o;
3512
3744
  } else
3513
3745
  var a = !0;
3514
- if (a) {
3515
- if (r.artifacts !== void 0) {
3516
- let d = r.artifacts;
3517
- const h = o;
3518
- if (o === h)
3519
- if (Array.isArray(d)) {
3520
- var c = !0;
3521
- const y = d.length;
3522
- for (let g = 0; g < y; g++) {
3523
- const b = o;
3524
- validate12(d[g], {
3525
- instancePath: e + "/artifacts/" + g,
3526
- parentData: d,
3527
- parentDataProperty: g,
3528
- rootData: n
3529
- }) || (i = i === null ? validate12.errors : i.concat(
3530
- validate12.errors
3531
- ), o = i.length);
3532
- var c = b === o;
3533
- if (!c)
3534
- break;
3535
- }
3536
- } else
3537
- return validate11.errors = [
3538
- {
3539
- instancePath: e + "/artifacts",
3540
- schemaPath: "#/properties/artifacts/type",
3541
- keyword: "type",
3542
- params: { type: "array" },
3543
- message: "must be array"
3544
- }
3545
- ], !1;
3546
- var a = h === o;
3547
- } else
3548
- var a = !0;
3549
- if (a)
3550
- if (r.extraFiles !== void 0) {
3551
- const d = o;
3552
- validate13(r.extraFiles, {
3553
- instancePath: e + "/extraFiles",
3554
- parentData: r,
3555
- parentDataProperty: "extraFiles",
3556
- rootData: n
3557
- }) || (i = i === null ? validate13.errors : i.concat(
3558
- validate13.errors
3559
- ), o = i.length);
3560
- var a = d === o;
3561
- } else
3562
- var a = !0;
3563
- }
3564
- }
3565
3746
  }
3566
3747
  }
3567
3748
  }
3568
- } else
3569
- return validate11.errors = [
3570
- {
3571
- instancePath: e,
3572
- schemaPath: "#/type",
3573
- keyword: "type",
3574
- params: { type: "object" },
3575
- message: "must be object"
3576
- }
3577
- ], !1;
3749
+ }
3750
+ } else
3751
+ return validate11.errors = [
3752
+ {
3753
+ instancePath: e,
3754
+ schemaPath: "#/type",
3755
+ keyword: "type",
3756
+ params: { type: "object" },
3757
+ message: "must be object"
3758
+ }
3759
+ ], !1;
3578
3760
  return validate11.errors = i, o === 0;
3579
3761
  }
3580
3762
  function validate10(r, { instancePath: e = "", parentData: t, parentDataProperty: s, rootData: n = r } = {}) {
@@ -3614,47 +3796,47 @@ async function resolvePHPExtension(r) {
3614
3796
  );
3615
3797
  n = await fetchBytes(e, h);
3616
3798
  } else {
3617
- let h, m;
3618
- if ("manifest" in t ? (h = t.manifest, t.baseUrl && (m = new URL(String(t.baseUrl)))) : (m = new URL(String(t.manifestUrl)), h = await (await e(m)).json()), !validate10(h))
3799
+ let h, f;
3800
+ if ("manifest" in t ? (h = t.manifest, t.baseUrl && (f = new URL(String(t.baseUrl)))) : (f = new URL(String(t.manifestUrl)), h = await (await e(f)).json()), !validate10(h))
3619
3801
  throw new Error(
3620
3802
  `Invalid PHP extension manifest: ${JSON.stringify(
3621
3803
  validate10.errors
3622
3804
  )}`
3623
3805
  );
3624
- const y = h;
3625
- if (!m)
3806
+ const k = h;
3807
+ if (!f)
3626
3808
  throw new Error(
3627
3809
  "Manifest artifacts require a manifest URL or baseUrl so relative files can be resolved."
3628
3810
  );
3629
- const g = y.artifacts.find(
3630
- (v) => v.phpVersion === r.phpVersion
3811
+ const R = k.artifacts.find(
3812
+ (V) => V.phpVersion === r.phpVersion
3631
3813
  );
3632
- if (!g)
3814
+ if (!R)
3633
3815
  throw new Error(
3634
3816
  `No extension artifact found for PHP ${r.phpVersion}.`
3635
3817
  );
3636
- s ?? (s = y.name);
3637
- const b = new Semaphore({
3818
+ s ?? (s = k.name);
3819
+ const N = new Semaphore({
3638
3820
  concurrency: MAX_EXTENSION_SIDECAR_FILE_REQUESTS
3639
- }), Q = [];
3640
- for (const v of [y.extraFiles, g.extraFiles])
3641
- for (const A of (v == null ? void 0 : v.nodes) ?? []) {
3642
- const K = joinPaths(v.vfsRoot ?? "", A.vfsPath);
3643
- if (A.type === "directory") {
3644
- o.push(K);
3821
+ }), m = [];
3822
+ for (const V of [k.extraFiles, R.extraFiles])
3823
+ for (const S of (V == null ? void 0 : V.nodes) ?? []) {
3824
+ const g = joinPaths(V.vfsRoot ?? "", S.vfsPath);
3825
+ if (S.type === "directory") {
3826
+ o.push(g);
3645
3827
  continue;
3646
3828
  }
3647
- if (!A.sourcePath) continue;
3648
- const he = new URL(A.sourcePath, m);
3649
- Q.push(
3650
- b.run(() => fetchBytes(e, he)).then((fe) => {
3651
- i[K] = fe;
3829
+ if (!S.sourcePath) continue;
3830
+ const b = new URL(S.sourcePath, f);
3831
+ m.push(
3832
+ N.run(() => fetchBytes(e, b)).then((Q) => {
3833
+ i[g] = Q;
3652
3834
  })
3653
3835
  );
3654
3836
  }
3655
3837
  const [D] = await Promise.all([
3656
- fetchBytes(e, new URL(g.sourcePath, m)),
3657
- ...Q
3838
+ fetchBytes(e, new URL(R.sourcePath, f)),
3839
+ ...m
3658
3840
  ]);
3659
3841
  n = D;
3660
3842
  }
@@ -3662,18 +3844,18 @@ async function resolvePHPExtension(r) {
3662
3844
  r.extensionDir ?? PHP_EXTENSIONS_DIR
3663
3845
  );
3664
3846
  r.extraFiles && (Object.assign(i, r.extraFiles.files), o.push(...r.extraFiles.directories ?? []));
3665
- const c = r.loadWithIniDirective ?? "extension", l = joinPaths(a, `${s}.so`), u = joinPaths(a, `${s}.ini`), d = [
3847
+ const c = r.loadWithIniDirective ?? "extension", l = joinPaths(a, `${s}.so`), d = joinPaths(a, `${s}.ini`), p = [
3666
3848
  `${c}=${l}`,
3667
3849
  ...Object.entries(r.iniEntries ?? {}).map(
3668
- ([h, m]) => `${h}=${m}`
3850
+ ([h, f]) => `${h}=${f}`
3669
3851
  )
3670
3852
  ].join(`
3671
3853
  `);
3672
3854
  return {
3673
3855
  soPath: l,
3674
3856
  soBytes: n,
3675
- iniPath: u,
3676
- iniContent: d,
3857
+ iniPath: d,
3858
+ iniContent: p,
3677
3859
  extraFiles: {
3678
3860
  files: i,
3679
3861
  directories: o
@@ -3758,25 +3940,25 @@ function ensureProxyFSHasMmapSupport(r) {
3758
3940
  throw new n.ErrnoError(19);
3759
3941
  if (a !== 0)
3760
3942
  throw new n.ErrnoError(22);
3761
- const u = t.malloc(o);
3762
- if (!u)
3943
+ const d = t.malloc(o);
3944
+ if (!d)
3763
3945
  throw new n.ErrnoError(48);
3764
- const d = t.HEAPU8.subarray(u, u + o);
3946
+ const p = t.HEAPU8.subarray(d, d + o);
3765
3947
  let h = 0;
3766
3948
  for (; h < o; ) {
3767
- const m = i.stream_ops.read(
3949
+ const f = i.stream_ops.read(
3768
3950
  i,
3769
- d,
3951
+ p,
3770
3952
  h,
3771
3953
  o - h,
3772
3954
  h
3773
3955
  );
3774
- if (m <= 0) break;
3775
- h += m;
3956
+ if (f <= 0) break;
3957
+ h += f;
3776
3958
  }
3777
3959
  if (h !== o)
3778
- throw t.free(u), new n.ErrnoError(5);
3779
- return { ptr: u, allocated: !0 };
3960
+ throw t.free(d), new n.ErrnoError(5);
3961
+ return { ptr: d, allocated: !0 };
3780
3962
  }, s.stream_ops.msync = function(i, o, a, c, l) {
3781
3963
  return l & 2 || i.stream_ops.write(
3782
3964
  i,
@@ -3984,10 +4166,10 @@ class NodeSABSyncReceiveMessageTransport {
3984
4166
  ), Atomics.wait(i, 0, 0, 5e3) === "timed-out")
3985
4167
  throw new Error("Timeout waiting for response");
3986
4168
  for (; ; ) {
3987
- const u = NodeSABSyncReceiveMessageTransport.receiveMessageOnPort(e);
3988
- if (((l = u.message) == null ? void 0 : l.id) === o)
3989
- return u.message;
3990
- if (!u)
4169
+ const d = NodeSABSyncReceiveMessageTransport.receiveMessageOnPort(e);
4170
+ if (((l = d.message) == null ? void 0 : l.id) === o)
4171
+ return d.message;
4172
+ if (!d)
3991
4173
  throw new Error("No response received");
3992
4174
  }
3993
4175
  }
@@ -4065,51 +4247,51 @@ function expose(r, e = globalThis, t = ["*"], s) {
4065
4247
  path: [],
4066
4248
  ...i.data
4067
4249
  }, l = (i.data.argumentList || []).map(fromWireValue);
4068
- let u;
4250
+ let d;
4069
4251
  try {
4070
- const d = c.slice(0, -1).reduce((m, y) => m[y], r), h = c.reduce((m, y) => m[y], r);
4252
+ const p = c.slice(0, -1).reduce((f, k) => f[k], r), h = c.reduce((f, k) => f[k], r);
4071
4253
  switch (a) {
4072
4254
  case MessageType.GET:
4073
- u = h;
4255
+ d = h;
4074
4256
  break;
4075
4257
  case MessageType.SET:
4076
- d[c.slice(-1)[0]] = fromWireValue(
4258
+ p[c.slice(-1)[0]] = fromWireValue(
4077
4259
  i.data.value
4078
- ), u = !0;
4260
+ ), d = !0;
4079
4261
  break;
4080
4262
  case MessageType.APPLY:
4081
- u = h.apply(d, l);
4263
+ d = h.apply(p, l);
4082
4264
  break;
4083
4265
  case MessageType.CONSTRUCT:
4084
4266
  {
4085
- const m = new h(...l);
4086
- u = proxy(m);
4267
+ const f = new h(...l);
4268
+ d = proxy(f);
4087
4269
  }
4088
4270
  break;
4089
4271
  case MessageType.ENDPOINT:
4090
4272
  {
4091
- const { port1: m, port2: y } = new MessageChannel();
4092
- expose(r, y), u = transfer(m, [m]);
4273
+ const { port1: f, port2: k } = new MessageChannel();
4274
+ expose(r, k), d = transfer(f, [f]);
4093
4275
  }
4094
4276
  break;
4095
4277
  case MessageType.RELEASE:
4096
- u = void 0;
4278
+ d = void 0;
4097
4279
  break;
4098
4280
  default:
4099
4281
  return;
4100
4282
  }
4101
- } catch (d) {
4102
- u = { value: d, [throwMarker]: 0 };
4283
+ } catch (p) {
4284
+ d = { value: p, [throwMarker]: 0 };
4103
4285
  }
4104
- Promise.resolve(u).catch((d) => ({ value: d, [throwMarker]: 0 })).then((d) => {
4105
- const [h, m] = toWireValue(d);
4106
- e.postMessage({ ...h, id: o }, m), a === MessageType.RELEASE && (e.removeEventListener("message", n), closeEndPoint(e), finalizer in r && typeof r[finalizer] == "function" && r[finalizer]());
4286
+ Promise.resolve(d).catch((p) => ({ value: p, [throwMarker]: 0 })).then((p) => {
4287
+ const [h, f] = toWireValue(p);
4288
+ e.postMessage({ ...h, id: o }, f), a === MessageType.RELEASE && (e.removeEventListener("message", n), closeEndPoint(e), finalizer in r && typeof r[finalizer] == "function" && r[finalizer]());
4107
4289
  }).catch(() => {
4108
- const [d, h] = toWireValue({
4290
+ const [p, h] = toWireValue({
4109
4291
  value: new TypeError("Unserializable return value"),
4110
4292
  [throwMarker]: 0
4111
4293
  });
4112
- e.postMessage({ ...d, id: o }, h);
4294
+ e.postMessage({ ...p, id: o }, h);
4113
4295
  }).finally(() => {
4114
4296
  s == null || s(i);
4115
4297
  });
@@ -4180,16 +4362,16 @@ function createProxy(r, e, t = [], s = function() {
4180
4362
  },
4181
4363
  set(o, a, c) {
4182
4364
  throwIfProxyReleased(n);
4183
- const [l, u] = toWireValue(c);
4365
+ const [l, d] = toWireValue(c);
4184
4366
  return requestResponseMessage(
4185
4367
  r,
4186
4368
  e,
4187
4369
  {
4188
4370
  type: MessageType.SET,
4189
- path: [...t, a].map((d) => d.toString()),
4371
+ path: [...t, a].map((p) => p.toString()),
4190
4372
  value: l
4191
4373
  },
4192
- u
4374
+ d
4193
4375
  ).then(fromWireValue);
4194
4376
  },
4195
4377
  apply(o, a, c) {
@@ -4201,16 +4383,16 @@ function createProxy(r, e, t = [], s = function() {
4201
4383
  }).then(fromWireValue);
4202
4384
  if (l === "bind")
4203
4385
  return createProxy(r, e, t.slice(0, -1));
4204
- const [u, d] = processArguments(c);
4386
+ const [d, p] = processArguments(c);
4205
4387
  return requestResponseMessage(
4206
4388
  r,
4207
4389
  e,
4208
4390
  {
4209
4391
  type: MessageType.APPLY,
4210
4392
  path: t.map((h) => h.toString()),
4211
- argumentList: u
4393
+ argumentList: d
4212
4394
  },
4213
- d
4395
+ p
4214
4396
  ).then(fromWireValue);
4215
4397
  },
4216
4398
  construct(o, a) {
@@ -4221,7 +4403,7 @@ function createProxy(r, e, t = [], s = function() {
4221
4403
  e,
4222
4404
  {
4223
4405
  type: MessageType.CONSTRUCT,
4224
- path: t.map((u) => u.toString()),
4406
+ path: t.map((d) => d.toString()),
4225
4407
  argumentList: c
4226
4408
  },
4227
4409
  l
@@ -4421,19 +4603,19 @@ const errorProperties = [
4421
4603
  useToJSON: o,
4422
4604
  serialize: a
4423
4605
  });
4424
- for (const [l, u] of Object.entries(r)) {
4425
- if (u && u instanceof Uint8Array && u.constructor.name === "Buffer") {
4606
+ for (const [l, d] of Object.entries(r)) {
4607
+ if (d && d instanceof Uint8Array && d.constructor.name === "Buffer") {
4426
4608
  t[l] = "[object Buffer]";
4427
4609
  continue;
4428
4610
  }
4429
- if (u !== null && typeof u == "object" && typeof u.pipe == "function") {
4611
+ if (d !== null && typeof d == "object" && typeof d.pipe == "function") {
4430
4612
  t[l] = "[object Stream]";
4431
4613
  continue;
4432
4614
  }
4433
- if (typeof u != "function") {
4434
- if (!u || typeof u != "object") {
4615
+ if (typeof d != "function") {
4616
+ if (!d || typeof d != "object") {
4435
4617
  try {
4436
- t[l] = u;
4618
+ t[l] = d;
4437
4619
  } catch {
4438
4620
  }
4439
4621
  continue;
@@ -4446,10 +4628,10 @@ const errorProperties = [
4446
4628
  }
4447
4629
  }
4448
4630
  if (a || t instanceof Error)
4449
- for (const { property: l, enumerable: u } of errorProperties)
4631
+ for (const { property: l, enumerable: d } of errorProperties)
4450
4632
  r[l] !== void 0 && r[l] !== null && Object.defineProperty(t, l, {
4451
4633
  value: isErrorLike(r[l]) || Array.isArray(r[l]) ? c(r[l]) : r[l],
4452
- enumerable: s ? !0 : u,
4634
+ enumerable: s ? !0 : d,
4453
4635
  configurable: !0,
4454
4636
  writable: !0
4455
4637
  });
@@ -5394,23 +5576,23 @@ function createObjectPoolProxy(r) {
5394
5576
  }
5395
5577
  function i(o) {
5396
5578
  return s().then((a) => {
5397
- const c = (u) => {
5398
- const d = u == null ? void 0 : u.finished;
5399
- return d && typeof d.then == "function" ? Promise.resolve(d).then(
5579
+ const c = (d) => {
5580
+ const p = d == null ? void 0 : d.finished;
5581
+ return p && typeof p.then == "function" ? Promise.resolve(p).then(
5400
5582
  () => n(a),
5401
5583
  () => n(a)
5402
- ) : n(a), u;
5584
+ ) : n(a), d;
5403
5585
  };
5404
5586
  let l;
5405
5587
  try {
5406
5588
  l = o(a);
5407
- } catch (u) {
5408
- throw n(a), u;
5589
+ } catch (d) {
5590
+ throw n(a), d;
5409
5591
  }
5410
5592
  return l != null && typeof l.then == "function" ? l.then(
5411
- (u) => c(u),
5412
- (u) => {
5413
- throw n(a), u;
5593
+ (d) => c(d),
5594
+ (d) => {
5595
+ throw n(a), d;
5414
5596
  }
5415
5597
  ) : c(l);
5416
5598
  });
@@ -5422,14 +5604,14 @@ function createObjectPoolProxy(r) {
5422
5604
  if (a !== "then")
5423
5605
  return new Proxy(function() {
5424
5606
  }, {
5425
- apply(c, l, u) {
5426
- return i((d) => d[a](...u));
5607
+ apply(c, l, d) {
5608
+ return i((p) => p[a](...d));
5427
5609
  },
5428
5610
  get(c, l) {
5429
5611
  if (l === "then")
5430
- return (u, d) => i((h) => h[a]).then(
5431
- u,
5432
- d
5612
+ return (d, p) => i((h) => h[a]).then(
5613
+ d,
5614
+ p
5433
5615
  );
5434
5616
  }
5435
5617
  });