Skip to content

Add tag attribute for binding PhpWeb instance to window #81

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasalt
Copy link

@jasalt jasalt commented May 10, 2025

Allows interactive debugging in browser console after page load which is not possible with the tag evaluation method as far as I understand.

Option 1 would simply look for "true" value and add binding window.php (available in browser console as php), option 2 allows user to specify binding name for avoiding naming conflicts e.g.

<script 
  type="text/php"
  data-stdout="div#output" data-stderr="pre#error"
  data-php-bind-window-as='wasmphp'>

Afterwards the instance can be called from JS console to inspect/modify filesystem contents await wasmphp.readdir('/preload/'), loaded classes await wasmphp.run('<?php echo print_r(get_declared_classes());') and so on.

The build / CI setup is foreign still, tested the patch locally on npm 0.0.9-alpha-32. Neater alternative solutions are welcome and attribute naming suggestions if this is generally a good idea.

Allows interactive debugging in browser console after page load
@jasalt jasalt changed the title DRAFT: Add tag attribute for binding PhpWeb instance to window Add tag attribute for binding PhpWeb instance to window May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant