File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,15 @@ export default {
13
13
async engine ( { PhpWeb } , _ , url ) {
14
14
const { stderr, stdout, get } = stdio ( ) ;
15
15
const interpreter = await new Promise ( resolve => {
16
+ let timer = 0 , chunks = [ ] ;
16
17
const php = new PhpWeb ( {
17
- print : stdout ,
18
+ print : ( message ) => {
19
+ chunks . push ( message ) ;
20
+ clearTimeout ( timer ) ;
21
+ timer = setTimeout ( ( ) => {
22
+ document . getElementById ( 'target' ) . innerHTML = chunks . splice ( 0 ) . join ( '' ) ;
23
+ } ) ;
24
+ } ,
18
25
printErr : ( message ) => {
19
26
if ( message ) stderr ( message ) ;
20
27
} ,
Original file line number Diff line number Diff line change 71
71
"html-escaper" : " ^3.0.3"
72
72
},
73
73
"worker" : {
74
- "blob" : " sha256-ixJNXrBnwM18zoc4l44JmnNzgD+eoNpGaOcZz3dXP94 ="
74
+ "blob" : " sha256-BDFBL6yh1wOU5tFuRvJ/0Eg3QHPu/yDsay/B77CbrGM ="
75
75
}
76
76
}
Original file line number Diff line number Diff line change 9
9
</ head >
10
10
< body >
11
11
< script type ="php-wasm ">
12
- echo 'Hello PHP' ;
13
- vrzno_run ( 'alert' , [ 'Hello, World!' ] ) ;
12
+ phpinfo ( ) ;
14
13
</ script >
14
+ < div id ="target "> </ div >
15
15
</ body >
16
16
</ html >
You can’t perform that action at this time.
0 commit comments