-
Notifications
You must be signed in to change notification settings - Fork 370
Open
Labels
[Type] Developer DocumentationDocumentation for developersDocumentation for developers
Description
The code example at Playground API Client page doesn't clarify from where to get the PHP object in the browser
const php = PHP.load('7.4', {
requestHandler: {
documentRoot: "/www"
}
})
php.writeFile("/www/index.php", `<?php echo file_get_contents("php://input");`);
const result = await php.request({
method: "GET",
headers: {
"Content-Type": "text/plain"
},
body: "Hello world!",
path: "/www/index.php"
});
// result.text === "Hello world!"
For example, at Javascript API page is clear that you need to import the startPlaygroundWeb method from 'https://playground.wordpress.net/client/index.js'
import { startPlaygroundWeb } from 'https://playground.wordpress.net/client/index.js';
Also, under "Running PHP code" there are two subsections:
- The run() method
- The request() method
but "The run() method" is empty
cc: @fellyph
fellyph
Metadata
Metadata
Assignees
Labels
[Type] Developer DocumentationDocumentation for developersDocumentation for developers