@php-wasm/node 1.0.27 → 1.0.29
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 +6 -14
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -15,23 +15,15 @@ WS proxy.
|
|
|
15
15
|
Here's how to use it:
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
|
-
import { PHP } from '@php-wasm/
|
|
19
|
-
|
|
20
|
-
requestHandler: {
|
|
21
|
-
documentRoot: new URL('./', import.meta.url).pathname,
|
|
22
|
-
},
|
|
23
|
-
});
|
|
18
|
+
import { PHP } from '@php-wasm/universal';
|
|
19
|
+
import { loadNodeRuntime } from '@php-wasm/node';
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
php.writeFile('./index.php', `<?php echo "Hello " . $_POST['name']; ?>`);
|
|
27
|
-
await php.run({ scriptPath: './index.php' });
|
|
21
|
+
const php = new PHP(await loadNodeRuntime('8.3'));
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
method: 'POST',
|
|
32
|
-
url: '/index.php',
|
|
33
|
-
data: { name: 'John' },
|
|
23
|
+
const output = await php.run({
|
|
24
|
+
code: '<?php phpinfo(); ?>',
|
|
34
25
|
});
|
|
26
|
+
|
|
35
27
|
console.log(response.text);
|
|
36
28
|
```
|
|
37
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@php-wasm/node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "PHP.wasm for Node.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"license": "GPL-2.0-or-later",
|
|
40
40
|
"types": "index.d.ts",
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "173e69f62e1b43bd7353b875054bb1ef5e394de8",
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=18.18.0",
|
|
44
44
|
"npm": ">=8.11.0"
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"wasm-feature-detect": "1.8.0",
|
|
52
52
|
"ws": "8.18.0",
|
|
53
53
|
"yargs": "17.7.2",
|
|
54
|
-
"@php-wasm/node-polyfills": "1.0.
|
|
55
|
-
"@php-wasm/universal": "1.0.
|
|
56
|
-
"@php-wasm/logger": "1.0.
|
|
57
|
-
"@php-wasm/util": "1.0.
|
|
58
|
-
"@wp-playground/common": "1.0.
|
|
59
|
-
"@wp-playground/wordpress": "1.0.
|
|
54
|
+
"@php-wasm/node-polyfills": "1.0.29",
|
|
55
|
+
"@php-wasm/universal": "1.0.29",
|
|
56
|
+
"@php-wasm/logger": "1.0.29",
|
|
57
|
+
"@php-wasm/util": "1.0.29",
|
|
58
|
+
"@wp-playground/common": "1.0.29",
|
|
59
|
+
"@wp-playground/wordpress": "1.0.29"
|
|
60
60
|
}
|
|
61
61
|
}
|