@php-wasm/universal 3.1.3 → 3.1.4
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.cjs +4 -4
- package/index.cjs.map +1 -1
- package/index.js +13 -11
- package/index.js.map +1 -1
- package/package.json +7 -7
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var G = (r) => {
|
|
2
2
|
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var u = (r, e, t) => (
|
|
4
|
+
var D = (r, e, t) => e.has(r) || G("Cannot " + t);
|
|
5
|
+
var u = (r, e, t) => (D(r, e, "read from private field"), t ? t.call(r) : e.get(r)), y = (r, e, t) => e.has(r) ? G("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), g = (r, e, t, s) => (D(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), m = (r, e, t) => (D(r, e, "access private method"), t);
|
|
6
6
|
import "@php-wasm/node-polyfills";
|
|
7
7
|
import { logger } from "@php-wasm/logger";
|
|
8
8
|
import { dirname, joinPaths, Semaphore, createSpawnHandler, basename, normalizePath, AcquireTimeoutError, splitShellCommand } from "@php-wasm/util";
|
|
@@ -646,7 +646,7 @@ const currentJsRuntime = function() {
|
|
|
646
646
|
200: "OK"
|
|
647
647
|
};
|
|
648
648
|
var C;
|
|
649
|
-
const
|
|
649
|
+
const j = class j {
|
|
650
650
|
constructor(e, t, s, n) {
|
|
651
651
|
/**
|
|
652
652
|
* Response headers stream (internal).
|
|
@@ -680,7 +680,7 @@ const D = class D {
|
|
|
680
680
|
new TextEncoder().encode(e.errors)
|
|
681
681
|
), c.close();
|
|
682
682
|
}
|
|
683
|
-
}), a = new
|
|
683
|
+
}), a = new j(
|
|
684
684
|
i,
|
|
685
685
|
t,
|
|
686
686
|
o,
|
|
@@ -696,7 +696,7 @@ const D = class D {
|
|
|
696
696
|
* Shorthand for `StreamedPHPResponse.fromPHPResponse(PHPResponse.forHttpCode(...))`.
|
|
697
697
|
*/
|
|
698
698
|
static forHttpCode(e, t = "") {
|
|
699
|
-
return
|
|
699
|
+
return j.fromPHPResponse(
|
|
700
700
|
PHPResponse.forHttpCode(e, t)
|
|
701
701
|
);
|
|
702
702
|
}
|
|
@@ -769,7 +769,7 @@ const D = class D {
|
|
|
769
769
|
}
|
|
770
770
|
};
|
|
771
771
|
C = new WeakMap();
|
|
772
|
-
let StreamedPHPResponse =
|
|
772
|
+
let StreamedPHPResponse = j;
|
|
773
773
|
async function parseHeadersStream(r) {
|
|
774
774
|
const e = await streamToText(r);
|
|
775
775
|
let t;
|
|
@@ -1043,7 +1043,7 @@ class PHPExecutionFailureError extends Error {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
1045
|
const PHP_INI_PATH = "/internal/shared/php.ini", AUTO_PREPEND_SCRIPT = "/internal/shared/auto_prepend_file.php", OPCACHE_FILE_FOLDER = "/internal/shared/opcache";
|
|
1046
|
-
var M, R, b, S, H, T, w, p, J, Y, X, Q, K, Z, ee, te,
|
|
1046
|
+
var M, R, b, S, H, T, w, p, J, Y, X, Q, K, Z, ee, te, W, re, q, $;
|
|
1047
1047
|
class PHP {
|
|
1048
1048
|
/**
|
|
1049
1049
|
* Initializes a PHP runtime.
|
|
@@ -1494,9 +1494,9 @@ class PHP {
|
|
|
1494
1494
|
m(this, p, Y).call(this, r.relativeUri || ""), m(this, p, Z).call(this, r.method || "GET");
|
|
1495
1495
|
const i = normalizeHeaders(r.headers || {}), o = i.host || "example.com:443", a = m(this, p, K).call(this, o, r.protocol || "http");
|
|
1496
1496
|
if (m(this, p, X).call(this, o), m(this, p, Q).call(this, a), m(this, p, ee).call(this, i), r.body && (t = m(this, p, te).call(this, r.body)), typeof r.code == "string")
|
|
1497
|
-
this.writeFile("/internal/eval.php", r.code), m(this, p,
|
|
1497
|
+
this.writeFile("/internal/eval.php", r.code), m(this, p, W).call(this, "/internal/eval.php");
|
|
1498
1498
|
else if (typeof r.scriptPath == "string")
|
|
1499
|
-
m(this, p,
|
|
1499
|
+
m(this, p, W).call(this, r.scriptPath || "");
|
|
1500
1500
|
else
|
|
1501
1501
|
throw new TypeError(
|
|
1502
1502
|
"The request object must have either a `code` or a `scriptPath` property."
|
|
@@ -2035,7 +2035,7 @@ J = function(r, e, t) {
|
|
|
2035
2035
|
[NUMBER],
|
|
2036
2036
|
[t]
|
|
2037
2037
|
), s;
|
|
2038
|
-
},
|
|
2038
|
+
}, W = function(r) {
|
|
2039
2039
|
this[__private__dont__use].ccall(
|
|
2040
2040
|
"wasm_set_path_translated",
|
|
2041
2041
|
null,
|
|
@@ -2469,7 +2469,7 @@ async function encodeAsMultipart(r) {
|
|
|
2469
2469
|
function fileToUint8Array(r) {
|
|
2470
2470
|
return r.arrayBuffer().then((e) => new Uint8Array(e));
|
|
2471
2471
|
}
|
|
2472
|
-
const _default = "application/octet-stream", asx = "video/x-ms-asf", atom = "application/atom+xml", avi = "video/x-msvideo", avif = "image/avif", bin = "application/octet-stream", bmp = "image/x-ms-bmp", cco = "application/x-cocoa", css = "text/css", data = "application/octet-stream", deb = "application/octet-stream", der = "application/x-x509-ca-cert", dmg = "application/octet-stream", doc = "application/msword", docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", eot = "application/vnd.ms-fontobject", flv = "video/x-flv", gif = "image/gif", gz = "application/gzip", hqx = "application/mac-binhex40", htc = "text/x-component", html = "text/html", ico = "image/x-icon", iso = "application/octet-stream", jad = "text/vnd.sun.j2me.app-descriptor", jar = "application/java-archive", jardiff = "application/x-java-archive-diff", jng = "image/x-jng", jnlp = "application/x-java-jnlp-file", jpg = "image/jpeg", jpeg = "image/jpeg", js = "application/javascript", json = "application/json", kml = "application/vnd.google-earth.kml+xml", kmz = "application/vnd.google-earth.kmz", m3u8 = "application/vnd.apple.mpegurl", m4a = "audio/x-m4a", m4v = "video/x-m4v", md = "text/plain", mid = "audio/midi", mml = "text/mathml", mng = "video/x-mng", mov = "video/quicktime", mp3 = "audio/mpeg", mp4 = "video/mp4", mpeg = "video/mpeg", msi = "application/octet-stream", odg = "application/vnd.oasis.opendocument.graphics", odp = "application/vnd.oasis.opendocument.presentation", ods = "application/vnd.oasis.opendocument.spreadsheet", odt = "application/vnd.oasis.opendocument.text", ogg = "audio/ogg", otf = "font/otf", pdf = "application/pdf", pl = "application/x-perl", png = "image/png", ppt = "application/vnd.ms-powerpoint", pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation", prc = "application/x-pilot", ps = "application/postscript", ra = "audio/x-realaudio", rar = "application/x-rar-compressed", rpm = "application/x-redhat-package-manager", rss = "application/rss+xml", rtf = "application/rtf", run = "application/x-makeself", sea = "application/x-sea", sit = "application/x-stuffit", svg = "image/svg+xml", swf = "application/x-shockwave-flash", tcl = "application/x-tcl", tar = "application/x-tar", tif = "image/tiff", ts = "video/mp2t", ttf = "font/ttf", txt = "text/plain", wasm = "application/wasm", wbmp = "image/vnd.wap.wbmp", webm = "video/webm", webp = "image/webp", wml = "text/vnd.wap.wml", wmlc = "application/vnd.wap.wmlc", wmv = "video/x-ms-wmv", woff = "font/woff", woff2 = "font/woff2", xhtml = "application/xhtml+xml", xls = "application/vnd.ms-excel", xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", xml = "text/xml", xpi = "application/x-xpinstall", xspf = "application/xspf+xml", zip = "application/zip", mimeTypes = {
|
|
2472
|
+
const _default = "application/octet-stream", asx = "video/x-ms-asf", atom = "application/atom+xml", avi = "video/x-msvideo", avif = "image/avif", bin = "application/octet-stream", bmp = "image/x-ms-bmp", cco = "application/x-cocoa", cjs = "application/javascript", css = "text/css", data = "application/octet-stream", deb = "application/octet-stream", der = "application/x-x509-ca-cert", dmg = "application/octet-stream", doc = "application/msword", docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", eot = "application/vnd.ms-fontobject", flv = "video/x-flv", gif = "image/gif", gz = "application/gzip", hqx = "application/mac-binhex40", htc = "text/x-component", html = "text/html", ico = "image/x-icon", iso = "application/octet-stream", jad = "text/vnd.sun.j2me.app-descriptor", jar = "application/java-archive", jardiff = "application/x-java-archive-diff", jng = "image/x-jng", jnlp = "application/x-java-jnlp-file", jpg = "image/jpeg", jpeg = "image/jpeg", js = "application/javascript", json = "application/json", kml = "application/vnd.google-earth.kml+xml", kmz = "application/vnd.google-earth.kmz", m3u8 = "application/vnd.apple.mpegurl", m4a = "audio/x-m4a", m4v = "video/x-m4v", md = "text/plain", mid = "audio/midi", mjs = "application/javascript", mml = "text/mathml", mng = "video/x-mng", mov = "video/quicktime", mp3 = "audio/mpeg", mp4 = "video/mp4", mpeg = "video/mpeg", msi = "application/octet-stream", odg = "application/vnd.oasis.opendocument.graphics", odp = "application/vnd.oasis.opendocument.presentation", ods = "application/vnd.oasis.opendocument.spreadsheet", odt = "application/vnd.oasis.opendocument.text", ogg = "audio/ogg", otf = "font/otf", pdf = "application/pdf", pl = "application/x-perl", png = "image/png", ppt = "application/vnd.ms-powerpoint", pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation", prc = "application/x-pilot", ps = "application/postscript", ra = "audio/x-realaudio", rar = "application/x-rar-compressed", rpm = "application/x-redhat-package-manager", rss = "application/rss+xml", rtf = "application/rtf", run = "application/x-makeself", sea = "application/x-sea", sit = "application/x-stuffit", svg = "image/svg+xml", swf = "application/x-shockwave-flash", tcl = "application/x-tcl", tar = "application/x-tar", tif = "image/tiff", ts = "video/mp2t", ttf = "font/ttf", txt = "text/plain", wasm = "application/wasm", wbmp = "image/vnd.wap.wbmp", webm = "video/webm", webp = "image/webp", wml = "text/vnd.wap.wml", wmlc = "application/vnd.wap.wmlc", wmv = "video/x-ms-wmv", woff = "font/woff", woff2 = "font/woff2", xhtml = "application/xhtml+xml", xls = "application/vnd.ms-excel", xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", xml = "text/xml", xpi = "application/x-xpinstall", xspf = "application/xspf+xml", zip = "application/zip", mimeTypes = {
|
|
2473
2473
|
_default,
|
|
2474
2474
|
"3gpp": "video/3gpp",
|
|
2475
2475
|
"7z": "application/x-7z-compressed",
|
|
@@ -2480,6 +2480,7 @@ const _default = "application/octet-stream", asx = "video/x-ms-asf", atom = "app
|
|
|
2480
2480
|
bin,
|
|
2481
2481
|
bmp,
|
|
2482
2482
|
cco,
|
|
2483
|
+
cjs,
|
|
2483
2484
|
css,
|
|
2484
2485
|
data,
|
|
2485
2486
|
deb,
|
|
@@ -2512,6 +2513,7 @@ const _default = "application/octet-stream", asx = "video/x-ms-asf", atom = "app
|
|
|
2512
2513
|
m4v,
|
|
2513
2514
|
md,
|
|
2514
2515
|
mid,
|
|
2516
|
+
mjs,
|
|
2515
2517
|
mml,
|
|
2516
2518
|
mng,
|
|
2517
2519
|
mov,
|