@php-wasm/web 3.1.22 → 3.1.26

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
@@ -196,7 +196,7 @@ const le = {
196
196
  uncompressed: 0,
197
197
  ansiX962_compressed_prime: 1,
198
198
  ansiX962_compressed_char2: 2
199
- }, X = p(le);
199
+ }, J = p(le);
200
200
  class he {
201
201
  /**
202
202
  * +--------------------------------------------------+
@@ -217,7 +217,7 @@ class he {
217
217
  const t = new g(e.buffer), n = t.readUint8(), r = [];
218
218
  for (let s = 0; s < n; s++) {
219
219
  const a = t.readUint8();
220
- a in X && r.push(X[a]);
220
+ a in J && r.push(J[a]);
221
221
  }
222
222
  return r;
223
223
  }
@@ -464,14 +464,14 @@ const Ae = {
464
464
  TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305: 52396,
465
465
  TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305: 52397,
466
466
  TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305: 52398
467
- }, J = p(ue), He = {
467
+ }, X = p(ue), He = {
468
468
  secp256r1: 23,
469
469
  secp384r1: 24,
470
470
  secp521r1: 25,
471
471
  x25519: 29,
472
472
  x448: 30
473
473
  }, Q = p(He);
474
- class Fe {
474
+ class qe {
475
475
  /**
476
476
  * +--------------------------------------------------+
477
477
  * | Payload Length [2B] |
@@ -526,7 +526,7 @@ const V = {
526
526
  sha384: 5,
527
527
  sha512: 6
528
528
  }, te = p(z);
529
- class qe {
529
+ class Fe {
530
530
  /**
531
531
  * Binary layout:
532
532
  *
@@ -579,8 +579,8 @@ class qe {
579
579
  }
580
580
  const ne = {
581
581
  server_name: Ce,
582
- signature_algorithms: qe,
583
- supported_groups: Fe,
582
+ signature_algorithms: Fe,
583
+ supported_groups: qe,
584
584
  ec_point_formats: he,
585
585
  renegotiation_info: Ae
586
586
  };
@@ -1090,7 +1090,7 @@ class E {
1090
1090
  const n = [];
1091
1091
  for (; !t.isFinished(); ) {
1092
1092
  const r = t.readUint16();
1093
- r in J && n.push(J[r]);
1093
+ r in X && n.push(X[r]);
1094
1094
  }
1095
1095
  return n;
1096
1096
  }
@@ -1430,7 +1430,7 @@ class K {
1430
1430
  }
1431
1431
  }
1432
1432
  function Ze(i, e) {
1433
- return Xe.generateCertificate(i, e);
1433
+ return Je.generateCertificate(i, e);
1434
1434
  }
1435
1435
  function gt(i) {
1436
1436
  return `-----BEGIN CERTIFICATE-----
@@ -1447,7 +1447,7 @@ ${we(
1447
1447
  )}
1448
1448
  -----END PRIVATE KEY-----`;
1449
1449
  }
1450
- class Xe {
1450
+ class Je {
1451
1451
  static async generateCertificate(e, t) {
1452
1452
  const n = await crypto.subtle.generateKey(
1453
1453
  {
@@ -1619,7 +1619,7 @@ class Xe {
1619
1619
  ]);
1620
1620
  }
1621
1621
  }
1622
- const Je = {
1622
+ const Xe = {
1623
1623
  // Algorithm OIDs
1624
1624
  "1.2.840.113549.1.1.1": "rsaEncryption",
1625
1625
  "1.2.840.113549.1.1.4": "md5WithRSAEncryption",
@@ -1730,7 +1730,7 @@ const Je = {
1730
1730
  "1.3.6.1.5.5.7.3.8": "timeStamping"
1731
1731
  };
1732
1732
  function w(i) {
1733
- for (const [e, t] of Object.entries(Je))
1733
+ for (const [e, t] of Object.entries(Xe))
1734
1734
  if (t === i)
1735
1735
  return e;
1736
1736
  throw new Error(`OID not found for name: ${i}`);
@@ -2189,22 +2189,22 @@ Content-Length: 0\r
2189
2189
  let u;
2190
2190
  if (S.method !== "GET") {
2191
2191
  const k = e.getReader();
2192
- let P = A.length, F = A.slice(-6);
2192
+ let P = A.length, q = A.slice(-6);
2193
2193
  const me = new TextEncoder().encode(`0\r
2194
2194
  \r
2195
2195
  `);
2196
2196
  u = new ReadableStream({
2197
2197
  async start(b) {
2198
2198
  A.length > 0 && b.enqueue(A);
2199
- const q = C === "content-length" && h !== void 0 && P >= h;
2200
- (s || q) && b.close();
2199
+ const F = C === "content-length" && h !== void 0 && P >= h;
2200
+ (s || F) && b.close();
2201
2201
  },
2202
2202
  async pull(b) {
2203
- const { done: q, value: I } = await k.read();
2204
- if (P += (I == null ? void 0 : I.length) || 0, I && (b.enqueue(I), F = H([
2205
- F,
2203
+ const { done: F, value: I } = await k.read();
2204
+ if (P += (I == null ? void 0 : I.length) || 0, I && (b.enqueue(I), q = H([
2205
+ q,
2206
2206
  I || new Uint8Array()
2207
- ]).slice(-5)), q || C === "content-length" && h !== void 0 && P >= h || C === "chunked" && F.every(
2207
+ ]).slice(-5)), F || C === "content-length" && h !== void 0 && P >= h || C === "chunked" && q.every(
2208
2208
  (Le, ge) => Le === me[ge]
2209
2209
  )) {
2210
2210
  b.close();
@@ -2289,12 +2289,16 @@ async function _t(i, e, t, n = []) {
2289
2289
  return Ie(t, r);
2290
2290
  }
2291
2291
  async function ot(i, e, t) {
2292
- if (typeof t == "object" && "source" in t)
2292
+ if (typeof t == "object" && "source" in t) {
2293
+ if (e === "asyncify")
2294
+ throw new Error(
2295
+ "External PHP extensions require JSPI. Asyncify is only supported for PHP.wasm bundled extensions."
2296
+ );
2293
2297
  return await Y({
2294
2298
  ...t,
2295
- phpVersion: i,
2296
- asyncMode: e
2299
+ phpVersion: i
2297
2300
  });
2301
+ }
2298
2302
  const n = typeof t == "string" ? t : t.name;
2299
2303
  if (n !== "intl")
2300
2304
  throw new Error(`Unknown bundled PHP web extension: ${String(n)}.`);
@@ -2315,15 +2319,13 @@ async function ot(i, e, t) {
2315
2319
  bytes: new Uint8Array(_)
2316
2320
  },
2317
2321
  phpVersion: i,
2318
- asyncMode: e,
2319
2322
  env: {
2320
2323
  ICU_DATA: "/internal/shared"
2321
2324
  },
2322
2325
  extraFiles: {
2323
- targetPath: "/internal/shared",
2324
2326
  files: {
2325
2327
  // The Intl extension looks for the hard-coded ICU data name.
2326
- "icudt74l.dat": new Uint8Array(c)
2328
+ "/internal/shared/icudt74l.dat": new Uint8Array(c)
2327
2329
  }
2328
2330
  }
2329
2331
  });