File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,15 @@ export default {
1313 async engine ( { PhpWeb } , _ , url ) {
1414 const { stderr, stdout, get } = stdio ( ) ;
1515 const interpreter = await new Promise ( resolve => {
16+ let timer = 0 , chunks = [ ] ;
1617 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+ } ,
1825 printErr : ( message ) => {
1926 if ( message ) stderr ( message ) ;
2027 } ,
Original file line number Diff line number Diff line change 7171 "html-escaper" : " ^3.0.3"
7272 },
7373 "worker" : {
74- "blob" : " sha256-ixJNXrBnwM18zoc4l44JmnNzgD+eoNpGaOcZz3dXP94 ="
74+ "blob" : " sha256-BDFBL6yh1wOU5tFuRvJ/0Eg3QHPu/yDsay/B77CbrGM ="
7575 }
7676}
Original file line number Diff line number Diff line change 99 </ head >
1010 < body >
1111 < script type ="php-wasm ">
12- echo 'Hello PHP' ;
13- vrzno_run ( 'alert' , [ 'Hello, World!' ] ) ;
12+ phpinfo ( ) ;
1413 </ script >
14+ < div id ="target "> </ div >
1515 </ body >
1616</ html >
You can’t perform that action at this time.
0 commit comments