@php-wasm/web 0.9.42 → 0.9.45
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 +200 -171
- package/kitchen-sink/7_0_33/php_7_0.wasm +0 -0
- package/kitchen-sink/7_1_30/php_7_1.wasm +0 -0
- package/kitchen-sink/7_2_34/php_7_2.wasm +0 -0
- package/kitchen-sink/7_3_33/php_7_3.wasm +0 -0
- package/kitchen-sink/7_4_33/php_7_4.wasm +0 -0
- package/kitchen-sink/8_0_30/php_8_0.wasm +0 -0
- package/kitchen-sink/8_1_23/php_8_1.wasm +0 -0
- package/kitchen-sink/8_2_10/php_8_2.wasm +0 -0
- package/kitchen-sink/8_3_0/php_8_3.wasm +0 -0
- package/kitchen-sink/php_7_0.js +1 -1
- package/kitchen-sink/php_7_1.js +1 -1
- package/kitchen-sink/php_7_2.js +1 -1
- package/kitchen-sink/php_7_3.js +1 -1
- package/kitchen-sink/php_7_4.js +1 -1
- package/kitchen-sink/php_8_0.js +1 -1
- package/kitchen-sink/php_8_1.js +1 -1
- package/kitchen-sink/php_8_2.js +1 -1
- package/kitchen-sink/php_8_3.js +1 -1
- package/light/7_0_33/php_7_0.wasm +0 -0
- package/light/7_1_30/php_7_1.wasm +0 -0
- package/light/7_2_34/php_7_2.wasm +0 -0
- package/light/7_3_33/php_7_3.wasm +0 -0
- package/light/7_4_33/php_7_4.wasm +0 -0
- package/light/8_0_30/php_8_0.wasm +0 -0
- package/light/8_1_23/php_8_1.wasm +0 -0
- package/light/8_2_10/php_8_2.wasm +0 -0
- package/light/8_3_0/php_8_3.wasm +0 -0
- package/light/php_7_0.js +1 -1
- package/light/php_7_1.js +1 -1
- package/light/php_7_2.js +1 -1
- package/light/php_7_3.js +1 -1
- package/light/php_7_4.js +1 -1
- package/light/php_8_0.js +1 -1
- package/light/php_8_1.js +1 -1
- package/light/php_8_2.js +1 -1
- package/light/php_8_3.js +1 -1
- package/package.json +7 -7
package/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { PHPResponse as
|
|
2
|
-
import * as
|
|
3
|
-
import { PhpWasmError as
|
|
4
|
-
import { responseTo as
|
|
5
|
-
import { logger as
|
|
6
|
-
import { journalFSEvents as
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
const e = r instanceof Worker ? r :
|
|
10
|
-
return new Proxy(
|
|
1
|
+
import { PHPResponse as D, LatestSupportedPHPVersion as R, loadPHPRuntime as L, FSHelpers as p, __private__dont__use as P } from "@php-wasm/universal";
|
|
2
|
+
import * as f from "comlink";
|
|
3
|
+
import { PhpWasmError as y, Semaphore as z, joinPaths as W } from "@php-wasm/util";
|
|
4
|
+
import { responseTo as M } from "@php-wasm/web-service-worker";
|
|
5
|
+
import { logger as h } from "@php-wasm/logger";
|
|
6
|
+
import { journalFSEvents as O } from "@php-wasm/fs-journal";
|
|
7
|
+
function Q(r, t = void 0) {
|
|
8
|
+
v();
|
|
9
|
+
const e = r instanceof Worker ? r : f.windowEndpoint(r, t), n = f.wrap(e), a = g(n);
|
|
10
|
+
return new Proxy(a, {
|
|
11
11
|
get: (i, s) => s === "isConnected" ? async () => {
|
|
12
12
|
for (; ; )
|
|
13
13
|
try {
|
|
14
|
-
await
|
|
14
|
+
await A(n.isConnected(), 200);
|
|
15
15
|
break;
|
|
16
16
|
} catch {
|
|
17
17
|
}
|
|
18
|
-
} :
|
|
18
|
+
} : n[s]
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
22
|
-
return new Promise((e,
|
|
23
|
-
setTimeout(
|
|
21
|
+
async function A(r, t) {
|
|
22
|
+
return new Promise((e, n) => {
|
|
23
|
+
setTimeout(n, t), r.then(e);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function X(r, t) {
|
|
27
|
+
v();
|
|
28
28
|
const e = Promise.resolve();
|
|
29
|
-
let
|
|
30
|
-
const i = new Promise((
|
|
31
|
-
|
|
32
|
-
}), s =
|
|
33
|
-
get: (
|
|
29
|
+
let n, a;
|
|
30
|
+
const i = new Promise((c, u) => {
|
|
31
|
+
n = c, a = u;
|
|
32
|
+
}), s = g(r), o = new Proxy(s, {
|
|
33
|
+
get: (c, u) => u === "isConnected" ? () => e : u === "isReady" ? () => i : u in c ? c[u] : t == null ? void 0 : t[u]
|
|
34
34
|
});
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
typeof window < "u" ?
|
|
38
|
-
), [
|
|
35
|
+
return f.expose(
|
|
36
|
+
o,
|
|
37
|
+
typeof window < "u" ? f.windowEndpoint(self.parent) : void 0
|
|
38
|
+
), [n, a, o];
|
|
39
39
|
}
|
|
40
|
-
let
|
|
41
|
-
function
|
|
42
|
-
if (
|
|
40
|
+
let E = !1;
|
|
41
|
+
function v() {
|
|
42
|
+
if (E)
|
|
43
43
|
return;
|
|
44
|
-
|
|
44
|
+
E = !0, f.transferHandlers.set("EVENT", {
|
|
45
45
|
canHandle: (e) => e instanceof CustomEvent,
|
|
46
46
|
serialize: (e) => [
|
|
47
47
|
{
|
|
@@ -50,49 +50,49 @@ function W() {
|
|
|
50
50
|
[]
|
|
51
51
|
],
|
|
52
52
|
deserialize: (e) => e
|
|
53
|
-
}),
|
|
53
|
+
}), f.transferHandlers.set("FUNCTION", {
|
|
54
54
|
canHandle: (e) => typeof e == "function",
|
|
55
55
|
serialize(e) {
|
|
56
|
-
const { port1:
|
|
57
|
-
return
|
|
56
|
+
const { port1: n, port2: a } = new MessageChannel();
|
|
57
|
+
return f.expose(e, n), [a, [a]];
|
|
58
58
|
},
|
|
59
59
|
deserialize(e) {
|
|
60
|
-
return e.start(),
|
|
60
|
+
return e.start(), f.wrap(e);
|
|
61
61
|
}
|
|
62
|
-
}),
|
|
62
|
+
}), f.transferHandlers.set("PHPResponse", {
|
|
63
63
|
canHandle: (e) => typeof e == "object" && e !== null && "headers" in e && "bytes" in e && "errors" in e && "exitCode" in e && "httpStatusCode" in e,
|
|
64
64
|
serialize(e) {
|
|
65
65
|
return [e.toRawData(), []];
|
|
66
66
|
},
|
|
67
67
|
deserialize(e) {
|
|
68
|
-
return
|
|
68
|
+
return D.fromRawData(e);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
-
const r =
|
|
71
|
+
const r = f.transferHandlers.get("throw"), t = r == null ? void 0 : r.serialize;
|
|
72
72
|
r.serialize = ({ value: e }) => {
|
|
73
|
-
const
|
|
74
|
-
return e.response && (
|
|
73
|
+
const n = t({ value: e });
|
|
74
|
+
return e.response && (n[0].value.response = e.response), e.source && (n[0].value.source = e.source), n;
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function g(r) {
|
|
78
78
|
return new Proxy(r, {
|
|
79
79
|
get(t, e) {
|
|
80
80
|
switch (typeof t[e]) {
|
|
81
81
|
case "function":
|
|
82
|
-
return (...
|
|
82
|
+
return (...n) => t[e](...n);
|
|
83
83
|
case "object":
|
|
84
|
-
return t[e] === null ? t[e] :
|
|
84
|
+
return t[e] === null ? t[e] : g(t[e]);
|
|
85
85
|
case "undefined":
|
|
86
86
|
case "number":
|
|
87
87
|
case "string":
|
|
88
88
|
return t[e];
|
|
89
89
|
default:
|
|
90
|
-
return
|
|
90
|
+
return f.proxy(t[e]);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
async function
|
|
95
|
+
async function I(r = R, t = "light") {
|
|
96
96
|
if (t === "kitchen-sink")
|
|
97
97
|
switch (r) {
|
|
98
98
|
case "8.3":
|
|
@@ -137,7 +137,7 @@ async function M(r = R, t = "light") {
|
|
|
137
137
|
}
|
|
138
138
|
throw new Error(`Unsupported PHP version ${r}`);
|
|
139
139
|
}
|
|
140
|
-
const
|
|
140
|
+
const _ = () => ({
|
|
141
141
|
websocket: {
|
|
142
142
|
decorator: (r) => class extends r {
|
|
143
143
|
constructor() {
|
|
@@ -152,168 +152,184 @@ const A = () => ({
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
|
-
async function
|
|
156
|
-
var
|
|
157
|
-
const e = t.loadAllExtensions ? "kitchen-sink" : "light",
|
|
158
|
-
return (
|
|
155
|
+
async function Z(r, t = {}) {
|
|
156
|
+
var a;
|
|
157
|
+
const e = t.loadAllExtensions ? "kitchen-sink" : "light", n = await I(r, e);
|
|
158
|
+
return (a = t.onPhpLoaderModuleLoaded) == null || a.call(t, n), await L(n, {
|
|
159
159
|
...t.emscriptenOptions || {},
|
|
160
|
-
...
|
|
160
|
+
..._()
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
let b;
|
|
164
|
-
const
|
|
164
|
+
const $ = new Promise((r) => {
|
|
165
165
|
b = r;
|
|
166
166
|
});
|
|
167
|
-
function
|
|
167
|
+
function ee(r) {
|
|
168
168
|
if (!r)
|
|
169
|
-
throw new
|
|
169
|
+
throw new y("PHP API client must be a valid client object.");
|
|
170
170
|
b(r);
|
|
171
171
|
}
|
|
172
|
-
async function
|
|
172
|
+
async function te(r, t) {
|
|
173
173
|
const e = navigator.serviceWorker;
|
|
174
174
|
if (!e)
|
|
175
|
-
throw window.isSecureContext ? new
|
|
175
|
+
throw window.isSecureContext ? new y(
|
|
176
176
|
"Service workers are not supported in your browser."
|
|
177
|
-
) : new
|
|
177
|
+
) : new y(
|
|
178
178
|
"WordPress Playground uses service workers and may only work on HTTPS and http://localhost/ sites, but the current site is neither."
|
|
179
179
|
);
|
|
180
|
-
const
|
|
180
|
+
const n = await e.register(t, {
|
|
181
181
|
type: "module",
|
|
182
182
|
// Always bypass HTTP cache when fetching the new Service Worker script:
|
|
183
183
|
updateViaCache: "none"
|
|
184
184
|
});
|
|
185
185
|
try {
|
|
186
|
-
await
|
|
187
|
-
} catch (
|
|
188
|
-
|
|
186
|
+
await n.update();
|
|
187
|
+
} catch (a) {
|
|
188
|
+
h.error("Failed to update service worker.", a);
|
|
189
189
|
}
|
|
190
190
|
navigator.serviceWorker.addEventListener(
|
|
191
191
|
"message",
|
|
192
192
|
async function(i) {
|
|
193
193
|
if (r && i.data.scope !== r)
|
|
194
194
|
return;
|
|
195
|
-
const s = await
|
|
196
|
-
i.source.postMessage(
|
|
195
|
+
const s = await $, o = i.data.args || [], c = i.data.method, u = await s[c](...o);
|
|
196
|
+
i.source.postMessage(M(i.data.requestId, u));
|
|
197
197
|
}
|
|
198
198
|
), e.startMessages();
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function re(r, t) {
|
|
201
201
|
window.addEventListener("message", (e) => {
|
|
202
202
|
e.source === r.contentWindow && (t && e.origin !== t || typeof e.data != "object" || e.data.type !== "relay" || window.parent.postMessage(e.data, "*"));
|
|
203
203
|
}), window.addEventListener("message", (e) => {
|
|
204
|
-
var
|
|
205
|
-
e.source === window.parent && (typeof e.data != "object" || e.data.type !== "relay" || (
|
|
204
|
+
var n;
|
|
205
|
+
e.source === window.parent && (typeof e.data != "object" || e.data.type !== "relay" || (n = r == null ? void 0 : r.contentWindow) == null || n.postMessage(e.data));
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
async function
|
|
208
|
+
async function ne(r) {
|
|
209
209
|
const t = new Worker(r, { type: "module" });
|
|
210
|
-
return new Promise((e,
|
|
210
|
+
return new Promise((e, n) => {
|
|
211
211
|
t.onerror = (i) => {
|
|
212
212
|
const s = new Error(
|
|
213
213
|
`WebWorker failed to load at ${r}. ${i.message ? `Original error: ${i.message}` : ""}`
|
|
214
214
|
);
|
|
215
|
-
s.filename = i.filename,
|
|
215
|
+
s.filename = i.filename, n(s);
|
|
216
216
|
};
|
|
217
|
-
function
|
|
218
|
-
i.data === "worker-script-started" && (e(t), t.removeEventListener("message",
|
|
217
|
+
function a(i) {
|
|
218
|
+
i.data === "worker-script-started" && (e(t), t.removeEventListener("message", a));
|
|
219
219
|
}
|
|
220
|
-
t.addEventListener("message",
|
|
220
|
+
t.addEventListener("message", a);
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function ae(r, t = { initialSync: {} }) {
|
|
224
224
|
return t = {
|
|
225
225
|
...t,
|
|
226
226
|
initialSync: {
|
|
227
227
|
...t.initialSync,
|
|
228
228
|
direction: t.initialSync.direction ?? "opfs-to-memfs"
|
|
229
229
|
}
|
|
230
|
-
}, async function(e,
|
|
231
|
-
return t.initialSync.direction === "opfs-to-memfs" ? (
|
|
232
|
-
a,
|
|
233
|
-
r,
|
|
230
|
+
}, async function(e, n, a) {
|
|
231
|
+
return t.initialSync.direction === "opfs-to-memfs" ? (p.fileExists(n, a) && p.rmdir(n, a), p.mkdir(n, a), await q(n, r, a)) : await x(
|
|
234
232
|
n,
|
|
233
|
+
r,
|
|
234
|
+
a,
|
|
235
235
|
t.initialSync.onProgress
|
|
236
|
-
),
|
|
236
|
+
), J(e, r, a);
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
async function
|
|
240
|
-
|
|
241
|
-
const
|
|
239
|
+
async function q(r, t, e) {
|
|
240
|
+
p.mkdir(r, e);
|
|
241
|
+
const n = new z({
|
|
242
242
|
concurrency: 40
|
|
243
|
-
}),
|
|
243
|
+
}), a = [], i = [
|
|
244
244
|
[t, e]
|
|
245
245
|
];
|
|
246
246
|
for (; i.length > 0; ) {
|
|
247
|
-
const [s,
|
|
248
|
-
for await (const
|
|
249
|
-
const u =
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
247
|
+
const [s, o] = i.pop();
|
|
248
|
+
for await (const c of s.values()) {
|
|
249
|
+
const u = n.run(async () => {
|
|
250
|
+
const w = W(
|
|
251
|
+
o,
|
|
252
|
+
c.name
|
|
253
253
|
);
|
|
254
|
-
if (
|
|
254
|
+
if (c.kind === "directory") {
|
|
255
255
|
try {
|
|
256
|
-
r.mkdir(
|
|
257
|
-
} catch (
|
|
258
|
-
if ((
|
|
259
|
-
throw
|
|
256
|
+
r.mkdir(w);
|
|
257
|
+
} catch (l) {
|
|
258
|
+
if ((l == null ? void 0 : l.errno) !== 20)
|
|
259
|
+
throw h.error(l), l;
|
|
260
260
|
}
|
|
261
|
-
i.push([
|
|
262
|
-
} else if (
|
|
263
|
-
const
|
|
261
|
+
i.push([c, w]);
|
|
262
|
+
} else if (c.kind === "file") {
|
|
263
|
+
const l = await c.getFile(), d = new Uint8Array(await l.arrayBuffer());
|
|
264
264
|
r.createDataFile(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
o,
|
|
266
|
+
c.name,
|
|
267
|
+
d,
|
|
268
268
|
!0,
|
|
269
269
|
!0,
|
|
270
270
|
!0
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
|
|
273
|
+
a.splice(a.indexOf(u), 1);
|
|
274
274
|
});
|
|
275
|
-
|
|
275
|
+
a.push(u);
|
|
276
276
|
}
|
|
277
|
-
for (; i.length === 0 &&
|
|
278
|
-
await Promise.any(
|
|
277
|
+
for (; i.length === 0 && a.length > 0; )
|
|
278
|
+
await Promise.any(a);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
async function
|
|
281
|
+
async function x(r, t, e, n) {
|
|
282
282
|
r.mkdirTree(e);
|
|
283
|
-
const
|
|
284
|
-
async function i(
|
|
283
|
+
const a = [];
|
|
284
|
+
async function i(w, l) {
|
|
285
285
|
await Promise.all(
|
|
286
|
-
r.readdir(
|
|
287
|
-
(
|
|
288
|
-
).map(async (
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
|
|
286
|
+
r.readdir(w).filter(
|
|
287
|
+
(d) => d !== "." && d !== ".."
|
|
288
|
+
).map(async (d) => {
|
|
289
|
+
const m = W(w, d);
|
|
290
|
+
if (!F(r, m)) {
|
|
291
|
+
a.push([l, m, d]);
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
|
-
const
|
|
294
|
+
const S = await l.getDirectoryHandle(d, {
|
|
295
295
|
create: !0
|
|
296
296
|
});
|
|
297
|
-
return await i(
|
|
297
|
+
return await i(m, S);
|
|
298
298
|
})
|
|
299
299
|
);
|
|
300
300
|
}
|
|
301
301
|
await i(e, t);
|
|
302
302
|
let s = 0;
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
303
|
+
const o = n && N(n, 100), c = 100, u = /* @__PURE__ */ new Set();
|
|
304
|
+
try {
|
|
305
|
+
for (const [w, l, d] of a) {
|
|
306
|
+
const m = C(
|
|
307
|
+
w,
|
|
308
|
+
d,
|
|
309
|
+
r,
|
|
310
|
+
l
|
|
311
|
+
).then(() => {
|
|
312
|
+
s++, u.delete(m), o == null || o({
|
|
313
|
+
files: s,
|
|
314
|
+
total: a.length
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
u.add(m), u.size >= c && (await Promise.race(u), o == null || o({
|
|
318
|
+
files: s,
|
|
319
|
+
total: a.length
|
|
320
|
+
}));
|
|
321
|
+
}
|
|
322
|
+
} finally {
|
|
323
|
+
await Promise.allSettled(u);
|
|
324
|
+
}
|
|
309
325
|
}
|
|
310
|
-
function
|
|
326
|
+
function F(r, t) {
|
|
311
327
|
return r.isDir(r.lookupPath(t, { follow: !0 }).node.mode);
|
|
312
328
|
}
|
|
313
|
-
async function
|
|
314
|
-
let
|
|
329
|
+
async function C(r, t, e, n) {
|
|
330
|
+
let a;
|
|
315
331
|
try {
|
|
316
|
-
|
|
332
|
+
a = e.readFile(n, {
|
|
317
333
|
encoding: "binary"
|
|
318
334
|
});
|
|
319
335
|
} catch {
|
|
@@ -327,31 +343,31 @@ async function x(r, t, e, a) {
|
|
|
327
343
|
await i.createSyncAccessHandle()
|
|
328
344
|
);
|
|
329
345
|
try {
|
|
330
|
-
await s.truncate(0), await s.write(
|
|
346
|
+
await s.truncate(0), await s.write(a);
|
|
331
347
|
} finally {
|
|
332
348
|
await s.close();
|
|
333
349
|
}
|
|
334
350
|
}
|
|
335
|
-
function
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
}), i = new
|
|
351
|
+
function J(r, t, e) {
|
|
352
|
+
const n = [], a = O(r, e, (o) => {
|
|
353
|
+
n.push(o);
|
|
354
|
+
}), i = new j(r, t, e);
|
|
339
355
|
async function s() {
|
|
340
|
-
const
|
|
356
|
+
const o = await r.semaphore.acquire();
|
|
341
357
|
try {
|
|
342
|
-
for (;
|
|
343
|
-
await i.processEntry(
|
|
358
|
+
for (; n.length; )
|
|
359
|
+
await i.processEntry(n.shift());
|
|
344
360
|
} finally {
|
|
345
|
-
|
|
361
|
+
o();
|
|
346
362
|
}
|
|
347
363
|
}
|
|
348
364
|
return r.addEventListener("request.end", s), function() {
|
|
349
|
-
|
|
365
|
+
a(), r.removeEventListener("request.end", s);
|
|
350
366
|
};
|
|
351
367
|
}
|
|
352
|
-
class
|
|
353
|
-
constructor(t, e,
|
|
354
|
-
this.php = t, this.opfs = e, this.memfsRoot = k(
|
|
368
|
+
class j {
|
|
369
|
+
constructor(t, e, n) {
|
|
370
|
+
this.php = t, this.opfs = e, this.memfsRoot = k(n);
|
|
355
371
|
}
|
|
356
372
|
toOpfsPath(t) {
|
|
357
373
|
return k(t.substring(this.memfsRoot.length));
|
|
@@ -359,82 +375,95 @@ class J {
|
|
|
359
375
|
async processEntry(t) {
|
|
360
376
|
if (!t.path.startsWith(this.memfsRoot) || t.path === this.memfsRoot)
|
|
361
377
|
return;
|
|
362
|
-
const e = this.toOpfsPath(t.path),
|
|
363
|
-
if (
|
|
378
|
+
const e = this.toOpfsPath(t.path), n = await T(this.opfs, e), a = H(e);
|
|
379
|
+
if (a)
|
|
364
380
|
try {
|
|
365
381
|
if (t.operation === "DELETE")
|
|
366
382
|
try {
|
|
367
|
-
await
|
|
383
|
+
await n.removeEntry(a, {
|
|
368
384
|
recursive: !0
|
|
369
385
|
});
|
|
370
386
|
} catch {
|
|
371
387
|
}
|
|
372
388
|
else if (t.operation === "CREATE")
|
|
373
|
-
t.nodeType === "directory" ? await
|
|
389
|
+
t.nodeType === "directory" ? await n.getDirectoryHandle(a, {
|
|
374
390
|
create: !0
|
|
375
|
-
}) : await
|
|
391
|
+
}) : await n.getFileHandle(a, {
|
|
376
392
|
create: !0
|
|
377
393
|
});
|
|
378
394
|
else if (t.operation === "WRITE")
|
|
379
|
-
await
|
|
380
|
-
a,
|
|
395
|
+
await C(
|
|
381
396
|
n,
|
|
382
|
-
|
|
397
|
+
a,
|
|
398
|
+
this.php[P].FS,
|
|
383
399
|
t.path
|
|
384
400
|
);
|
|
385
401
|
else if (t.operation === "RENAME" && t.toPath.startsWith(this.memfsRoot)) {
|
|
386
|
-
const i = this.toOpfsPath(t.toPath), s = await
|
|
402
|
+
const i = this.toOpfsPath(t.toPath), s = await T(
|
|
387
403
|
this.opfs,
|
|
388
404
|
i
|
|
389
|
-
),
|
|
405
|
+
), o = H(i);
|
|
390
406
|
if (t.nodeType === "directory") {
|
|
391
|
-
const
|
|
392
|
-
|
|
407
|
+
const c = await s.getDirectoryHandle(
|
|
408
|
+
a,
|
|
393
409
|
{
|
|
394
410
|
create: !0
|
|
395
411
|
}
|
|
396
412
|
);
|
|
397
|
-
await
|
|
398
|
-
this.php[
|
|
399
|
-
|
|
413
|
+
await x(
|
|
414
|
+
this.php[P].FS,
|
|
415
|
+
c,
|
|
400
416
|
t.toPath
|
|
401
|
-
), await
|
|
417
|
+
), await n.removeEntry(a, {
|
|
402
418
|
recursive: !0
|
|
403
419
|
});
|
|
404
420
|
} else
|
|
405
|
-
(await
|
|
421
|
+
(await n.getFileHandle(a)).move(s, o);
|
|
406
422
|
}
|
|
407
423
|
} catch (i) {
|
|
408
|
-
throw
|
|
424
|
+
throw h.log({ entry: t, name: a }), h.error(i), i;
|
|
409
425
|
}
|
|
410
426
|
}
|
|
411
427
|
}
|
|
412
428
|
function k(r) {
|
|
413
429
|
return r.replace(/\/$/, "").replace(/\/\/+/g, "/");
|
|
414
430
|
}
|
|
415
|
-
function
|
|
431
|
+
function H(r) {
|
|
416
432
|
return r.substring(r.lastIndexOf("/") + 1);
|
|
417
433
|
}
|
|
418
|
-
async function
|
|
434
|
+
async function T(r, t) {
|
|
419
435
|
const e = t.replace(/^\/+|\/+$/g, "").replace(/\/+/, "/");
|
|
420
436
|
if (!e)
|
|
421
437
|
return r;
|
|
422
|
-
const
|
|
423
|
-
let
|
|
424
|
-
for (let i = 0; i <
|
|
425
|
-
const s =
|
|
426
|
-
|
|
438
|
+
const n = e.split("/");
|
|
439
|
+
let a = r;
|
|
440
|
+
for (let i = 0; i < n.length - 1; i++) {
|
|
441
|
+
const s = n[i];
|
|
442
|
+
a = await a.getDirectoryHandle(s, { create: !0 });
|
|
427
443
|
}
|
|
428
|
-
return
|
|
444
|
+
return a;
|
|
445
|
+
}
|
|
446
|
+
function N(r, t) {
|
|
447
|
+
let e = 0, n, a;
|
|
448
|
+
return function(...s) {
|
|
449
|
+
a = s;
|
|
450
|
+
const o = Date.now() - e;
|
|
451
|
+
if (n === void 0) {
|
|
452
|
+
const c = Math.max(0, t - o);
|
|
453
|
+
n = setTimeout(() => {
|
|
454
|
+
n = void 0, e = Date.now(), r(...a);
|
|
455
|
+
}, c);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
429
458
|
}
|
|
430
459
|
export {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
460
|
+
Q as consumeAPI,
|
|
461
|
+
ae as createDirectoryHandleMountHandler,
|
|
462
|
+
X as exposeAPI,
|
|
463
|
+
I as getPHPLoaderModule,
|
|
464
|
+
Z as loadWebRuntime,
|
|
465
|
+
te as registerServiceWorker,
|
|
466
|
+
ee as setPhpInstanceUsedByServiceWorker,
|
|
467
|
+
re as setupPostMessageRelay,
|
|
468
|
+
ne as spawnPHPWorkerThread
|
|
440
469
|
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/kitchen-sink/php_7_0.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_0_33/php_7_0.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 11188538;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/kitchen-sink/php_7_1.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_1_30/php_7_1.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 11622262;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/kitchen-sink/php_7_2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_2_34/php_7_2.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 12119510;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/kitchen-sink/php_7_3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_3_33/php_7_3.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 12202465;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/kitchen-sink/php_7_4.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_4_33/php_7_4.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 12814525;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/kitchen-sink/php_8_0.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './8_0_30/php_8_0.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 12405702;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/kitchen-sink/php_8_1.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './8_1_23/php_8_1.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 12339026;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/kitchen-sink/php_8_2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './8_2_10/php_8_2.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 12580244;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/kitchen-sink/php_8_3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './8_3_0/php_8_3.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 12837450;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/light/8_3_0/php_8_3.wasm
CHANGED
|
Binary file
|
package/light/php_7_0.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_0_33/php_7_0.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5283250;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/light/php_7_1.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_1_30/php_7_1.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5421334;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/light/php_7_2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_2_34/php_7_2.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5626867;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/light/php_7_3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_3_33/php_7_3.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5575743;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/light/php_7_4.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './7_4_33/php_7_4.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5799251;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/light/php_8_0.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './8_0_30/php_8_0.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5590860;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/light/php_8_1.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './8_1_23/php_8_1.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5396449;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/light/php_8_2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './8_2_10/php_8_2.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5509457;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/light/php_8_3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dependencyFilename from './8_3_0/php_8_3.wasm';
|
|
2
2
|
export { dependencyFilename };
|
|
3
|
-
export const dependenciesTotalSize =
|
|
3
|
+
export const dependenciesTotalSize = 5602058;
|
|
4
4
|
export function init(RuntimeName, PHPLoader) {
|
|
5
5
|
/**
|
|
6
6
|
* Overrides Emscripten's default ExitStatus object which gets
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@php-wasm/web",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.45",
|
|
4
4
|
"description": "PHP.wasm for the web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"type": "module",
|
|
30
30
|
"main": "index.js",
|
|
31
31
|
"types": "index.d.ts",
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "0c51051f503936c8bc92974ed660bd83f1957922",
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=16.15.1",
|
|
35
35
|
"npm": ">=8.11.0"
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"ini": "4.1.2",
|
|
41
41
|
"ws": "8.18.0",
|
|
42
42
|
"yargs": "17.7.2",
|
|
43
|
-
"@php-wasm/universal": "0.9.
|
|
44
|
-
"@php-wasm/util": "0.9.
|
|
45
|
-
"@php-wasm/logger": "0.9.
|
|
46
|
-
"@php-wasm/fs-journal": "0.9.
|
|
47
|
-
"@php-wasm/web-service-worker": "0.9.
|
|
43
|
+
"@php-wasm/universal": "0.9.45",
|
|
44
|
+
"@php-wasm/util": "0.9.45",
|
|
45
|
+
"@php-wasm/logger": "0.9.45",
|
|
46
|
+
"@php-wasm/fs-journal": "0.9.45",
|
|
47
|
+
"@php-wasm/web-service-worker": "0.9.45"
|
|
48
48
|
}
|
|
49
49
|
}
|