@php-wasm/universal 3.0.5 → 3.0.8
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 +8 -6
- package/index.cjs.map +1 -1
- package/index.js +438 -141
- package/index.js.map +1 -1
- package/lib/php-worker.d.ts +7 -0
- package/lib/php.d.ts +16 -1
- package/lib/rotate-php-runtime.d.ts +1 -1
- package/package.json +8 -7
package/lib/php-worker.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare class PHPWorker implements LimitedPHPApi, AsyncDisposable {
|
|
|
23
23
|
absoluteUrl: string;
|
|
24
24
|
/** @inheritDoc @php-wasm/universal!RequestHandler.documentRoot */
|
|
25
25
|
documentRoot: string;
|
|
26
|
+
private chroot;
|
|
26
27
|
onMessageListeners: MessageListener[];
|
|
27
28
|
/** @inheritDoc */
|
|
28
29
|
constructor(requestHandler?: PHPRequestHandler, monitor?: EmscriptenDownloadMonitor);
|
|
@@ -66,6 +67,12 @@ export declare class PHPWorker implements LimitedPHPApi, AsyncDisposable {
|
|
|
66
67
|
}): Promise<StreamedPHPResponse>;
|
|
67
68
|
/** @inheritDoc @php-wasm/universal!/PHP.chdir */
|
|
68
69
|
chdir(path: string): void;
|
|
70
|
+
/** @inheritDoc @php-wasm/universal!/PHP.chdir */
|
|
71
|
+
cwd(): string;
|
|
72
|
+
/**
|
|
73
|
+
* @returns A PHP instance with a consistent chroot.
|
|
74
|
+
*/
|
|
75
|
+
private acquirePHPInstance;
|
|
69
76
|
/** @inheritDoc @php-wasm/universal!/PHP.setSapiName */
|
|
70
77
|
setSapiName(newName: string): void;
|
|
71
78
|
/** @inheritDoc @php-wasm/universal!/PHP.mkdir */
|
package/lib/php.d.ts
CHANGED
|
@@ -115,6 +115,12 @@ export declare class PHP implements Disposable {
|
|
|
115
115
|
* @param path - The new working directory.
|
|
116
116
|
*/
|
|
117
117
|
chdir(path: string): void;
|
|
118
|
+
/**
|
|
119
|
+
* Gets the current working directory in the PHP filesystem.
|
|
120
|
+
*
|
|
121
|
+
* @returns The current working directory.
|
|
122
|
+
*/
|
|
123
|
+
cwd(): any;
|
|
118
124
|
/**
|
|
119
125
|
* Changes the permissions of a file or directory.
|
|
120
126
|
* @param path - The path to the file or directory.
|
|
@@ -417,7 +423,6 @@ export declare class PHP implements Disposable {
|
|
|
417
423
|
enableRuntimeRotation(options: {
|
|
418
424
|
recreateRuntime: () => Promise<number> | number;
|
|
419
425
|
maxRequests?: number;
|
|
420
|
-
cwd?: string;
|
|
421
426
|
}): void;
|
|
422
427
|
private rotateRuntime;
|
|
423
428
|
/**
|
|
@@ -450,7 +455,17 @@ export declare class PHP implements Disposable {
|
|
|
450
455
|
*/
|
|
451
456
|
cli(argv: string[], options?: {
|
|
452
457
|
env?: Record<string, string>;
|
|
458
|
+
cwd?: string;
|
|
453
459
|
}): Promise<StreamedPHPResponse>;
|
|
460
|
+
/**
|
|
461
|
+
* Runs an arbitrary CLI command using the spawn handler associated
|
|
462
|
+
* with this PHP instance.
|
|
463
|
+
*
|
|
464
|
+
* @param argv
|
|
465
|
+
* @param options
|
|
466
|
+
* @returns StreamedPHPResponse.
|
|
467
|
+
*/
|
|
468
|
+
private subProcess;
|
|
454
469
|
setSkipShebang(shouldSkip: boolean): void;
|
|
455
470
|
exit(code?: number): void;
|
|
456
471
|
[Symbol.dispose](): void;
|
|
@@ -11,4 +11,4 @@ export interface RotateOptions {
|
|
|
11
11
|
*
|
|
12
12
|
* @deprecated Use `php.enableRuntimeRotation()` instead.
|
|
13
13
|
*/
|
|
14
|
-
export declare function rotatePHPRuntime({ php,
|
|
14
|
+
export declare function rotatePHPRuntime({ php, recreateRuntime, maxRequests, }: RotateOptions): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@php-wasm/universal",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"description": "PHP.wasm – emscripten bindings for PHP",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,24 +37,25 @@
|
|
|
37
37
|
"module": "./index.js",
|
|
38
38
|
"types": "index.d.ts",
|
|
39
39
|
"license": "GPL-2.0-or-later",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "a1128d0626073076640e7acd088cd3c9c70916c2",
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=20.18.3",
|
|
43
43
|
"npm": ">=10.1.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"ini": "4.1.2",
|
|
47
|
-
"@php-wasm/node-polyfills": "3.0.
|
|
48
|
-
"@php-wasm/logger": "3.0.
|
|
49
|
-
"@php-wasm/util": "3.0.
|
|
50
|
-
"@php-wasm/stream-compression": "3.0.
|
|
51
|
-
"@php-wasm/progress": "3.0.
|
|
47
|
+
"@php-wasm/node-polyfills": "3.0.8",
|
|
48
|
+
"@php-wasm/logger": "3.0.8",
|
|
49
|
+
"@php-wasm/util": "3.0.8",
|
|
50
|
+
"@php-wasm/stream-compression": "3.0.8",
|
|
51
|
+
"@php-wasm/progress": "3.0.8"
|
|
52
52
|
},
|
|
53
53
|
"overrides": {
|
|
54
54
|
"rollup": "^4.34.6",
|
|
55
55
|
"react": "18.3.1",
|
|
56
56
|
"react-dom": "18.3.1",
|
|
57
57
|
"typescript": "5.4.5",
|
|
58
|
+
"@playwright/test": "1.47.1",
|
|
58
59
|
"ws": "^8.18.0"
|
|
59
60
|
},
|
|
60
61
|
"optionalDependencies": {
|