Repository navigation
Commit 4405353
authored
[ php-wasm ] Add
## Motivation for the change
This is a pull request to dynamically load Xdebug in `@php-wasm` Node
ASYNCIFY.
[Roadmap](#2315)
## Related issues and pull requests
Relative to XDebug
- #2248
- #314
- #2288
- #831
Relative to dynamic library
- #89
- #2290
- #673
## Implementation details
Additional steps for asyncify are implemented :
- new nx commands
- new `WITH_JSPI` and `WITH_DEBUG` arguments in Xdebug Dockerfile
- new `xdebug.so` files are compiled and dynamically loaded
## Zend extensions and PHP versions
> [!IMPORTANT]
> Each version of PHP requires its own version of Xdebug because each
version of PHP has a specific Zend Engine API version. Consequently,
each version of Xdebug is designed to be compatible with a particular
Zend Engine API version.
Example using PHP `8.2` with Xdebug `8.3` :
```
Xdebug requires Zend Engine API version 420230831.
The Zend Engine API version 420220829 which is installed, is outdated.
```
## Testing Instructions
Two files are needed. A PHP file to test the step debugger. A JS file to run PHP 8.4 node ASYNCIFY.
`php/xdebug.php`
```php
<?php
$test = 42; // Set a breakpoint on this line
echo "Hello Xdebug World\n";
```
`scripts/node.js`
```javascript
import { PHP } from '@php-wasm/universal';
import { loadNodeRuntime } from '@php-wasm/node';
const php = new PHP( await loadNodeRuntime( '8.4', { withXdebug : true }
) );
await php.runStream( { scriptPath : `php/xdebug.php` } );
```
To achieve the test, you first need to start debugging [ with F5 or Run > Start debugging in VSCode ], then run :
```bash
node scripts/node.js
```xdebug shared extension to @php-wasm/node ASYNCIFY (#2326)1 parent eee84fc commit 4405353
43 files changed
Lines changed: 507 additions & 103 deletions
File tree
- packages
- meta/src/node-es-module-loader
- php-wasm
- compile
- php
- xdebug
- node
- asyncify
- 7_2_34
- 7_3_33
- 7_4_33
- 8_0_30
- 8_1_23
- 8_2_10
- 8_3_0
- 8_4_0
- extensions/xdebug
- 7_2
- 7_3
- 7_4
- 8_0
- 8_1
- 8_2
- 8_3
- 8_4
- src/lib/xdebug
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1644 | 1644 | | |
1645 | 1645 | | |
1646 | 1646 | | |
| 1647 | + | |
| 1648 | + | |
1647 | 1649 | | |
1648 | 1650 | | |
1649 | 1651 | | |
| |||
1724 | 1726 | | |
1725 | 1727 | | |
1726 | 1728 | | |
| 1729 | + | |
| 1730 | + | |
1727 | 1731 | | |
1728 | 1732 | | |
1729 | 1733 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
88 | | - | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
93 | | - | |
| 96 | + | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
81 | | - | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
0 commit comments