New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to run php after setup is complete? #641
Comments
@janw-me this could be a typo when pasting or writing into the GitHub box, but the step should be |
@dmsnell The single quotes are a copy paste error. I had them but playground won't even run with a unknown keyword. |
@janw-me I suspected it was that but wanted to confirm. can we rule out other problems? how about some lines that echo the users or posts to confirm that this is running before the import? it's my understanding that what you are doing is the right way to accomplish what you're asking. |
I don't thing echos/var_dump trigger during that step. <iframe id="wp-playground-blueprint-api" style="width: 100% !important; height: 800px; max-width: 100%;"></iframe>
<script type="module">
import { startPlaygroundWeb } from 'https://unpkg.com/@wp-playground/client/index.js';
const client = await startPlaygroundWeb({
iframe: document.getElementById('wp-playground-blueprint-api'),
remoteUrl: `https://playground.wordpress.net/remote.html`,
blueprint: {
landingPage: '/wp-admin/plugins.php',
preferredVersions: {
php: '8.0',
wp: 'latest',
},
steps: [
{
step: 'login',
username: 'admin',
password: 'password',
},
{
"step": "runPHP",
"code": "<?php var_dump( 'blueprint' );"
}
],
},
});
const response = await client.run({
code: '<?php var_dump("js code"); var_dump(function_exists("get_posts")); ',
});
console.log(response.text);
</script> Also the WP function |
@janw-me try adding |
@adamziel thanks. |
Thank you @janw-me!
Yes, yes it does 👍 |
I`ve got a blueprint working. It imports an xml, but I want to delete the extra user the import created.
So I got the following step at the end of my steps:
Nether php statement seems to trigger.
I suspect this snippet runs before WP is installed.
My blueprint is based on this example.
And here the
echo hi
appears to run early during the initialization.How can we run php after everything else is done.
The text was updated successfully, but these errors were encountered: