@capsulescodes/browser-php 0.6.4 → 0.6.7
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/README.md +3 -3
- package/bin/cli.js +8 -6
- package/dist/env.js +2906 -2940
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -107,7 +107,7 @@ npm run composer
|
|
|
107
107
|
> / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
|
|
108
108
|
> \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
|
|
109
109
|
> /_/
|
|
110
|
-
> Composer version 2.
|
|
110
|
+
> Composer version 2.9.3 2025-12-30 13:40:17
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
<br>
|
|
@@ -117,10 +117,10 @@ npm run composer
|
|
|
117
117
|
|
|
118
118
|
The scripts can be configured with environment variables
|
|
119
119
|
|
|
120
|
-
- `BROWSER_PHP_VERSION` : The PHP version you need | default : `8.
|
|
120
|
+
- `BROWSER_PHP_VERSION` : The PHP version you need | default : `8.4`
|
|
121
121
|
- `BROWSER_PHP_CLI` : The CLI output mode | default : `xterm`
|
|
122
122
|
|
|
123
|
-
- `BROWSER_PHP_COMPOSER_VERSION` : The Composer executable version | default : `2.
|
|
123
|
+
- `BROWSER_PHP_COMPOSER_VERSION` : The Composer executable version | default : `2.9.3`
|
|
124
124
|
- `BROWSER_PHP_COMPOSER_PATH` : The Composer executable path | default : `vendor/bin`
|
|
125
125
|
- `BROWSER_PHP_COMPOSER_NAME` : The Composer executable name | default : `composer`
|
|
126
126
|
|
package/bin/cli.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { PHP as p } from "@php-wasm/universal";
|
|
3
|
-
import { loadNodeRuntime as
|
|
2
|
+
import { PHP as n, sandboxedSpawnHandlerFactory as p } from "@php-wasm/universal";
|
|
3
|
+
import { loadNodeRuntime as a, createNodeFsMountHandler as c } from "@php-wasm/node";
|
|
4
4
|
import s from "../dist/env.js";
|
|
5
|
-
const r = new
|
|
5
|
+
const r = new n(await a(s.php.version, { emscriptenOptions: { ENV: { TERM: s.php.cli } } }));
|
|
6
6
|
r.mkdir(process.cwd());
|
|
7
7
|
r.mount(process.cwd(), c(process.cwd()));
|
|
8
8
|
r.chdir(process.cwd());
|
|
9
|
+
await r.setSpawnHandler(p(async () => ({ php: r, reap: () => {
|
|
10
|
+
} })));
|
|
9
11
|
let d = process.argv.slice(2);
|
|
10
12
|
const t = await r.cli(["php", ...d]);
|
|
11
13
|
t.stderr.pipeTo(new WritableStream({ write(e) {
|
|
@@ -15,7 +17,7 @@ t.stdout.pipeTo(new WritableStream({ write(e) {
|
|
|
15
17
|
process.stdout.write(e);
|
|
16
18
|
} }));
|
|
17
19
|
t.exitCode.finally(() => setTimeout(() => process.exit(0), 100));
|
|
18
|
-
const
|
|
19
|
-
process.stderr.write = function(e,
|
|
20
|
-
return typeof e == "string" && (e.includes("Program terminated with exit(0)") || e.includes("ErrorEvent")) ? !0 :
|
|
20
|
+
const w = process.stderr.write;
|
|
21
|
+
process.stderr.write = function(e, o, i) {
|
|
22
|
+
return typeof e == "string" && (e.includes("Program terminated with exit(0)") || e.includes("ErrorEvent")) ? !0 : w.call(process.stderr, e, o, i);
|
|
21
23
|
};
|