NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Partial preview while debugging


Joined: 23 Dec 2008
Posts: 14
Reply with quote
Hello. I bought today PHPED, and I must say that I'm really happy with it. By using various IDEs in these days, I feel I have to suggest you this: It would be useful to see, during a debug, the partial output generated until a break point occured. Let me explain myself better.

Assuming I have this code:

Code:
<?php
echo ("First\n");
echo ("Second\n");
*echo ("Third\n");
echo ("Fourth\n");
?>


where * stands for a break point. When the debug starts, it will stop before PHP echoes "Third": it would be nice to have a sort of "partial output" view, in which we should see

Code:
First
Second


In my opinion, this could make the debug easier, instead of putting echoes to see whether something outed or not at a given point; by now I can only see the output at the end of the script.

EDIT: I saw that something like that is done by the "Output" view of the debugger, rather than the "Output" panel that pops out between the open files when the debug is complete. That's great, but it leads me to another improvement: since the the Output view only outputs code, how about an Output view that renders the HTML code, so we can see the partial output browser-like in the middle of a debug?
View user's profileFind all posts by cm0901Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
I saw that something like that is done by the "Output" view


Correct. Debug Window->Output shows everything that went to the output up to the debugging point.


Quote:
how about an Output view that renders the HTML code


Output with browser is EXACTLY what you're asking about and it GETS exactly the same data as Debug Window->output, but most of time you don't see anything there because browser waits for more data to come Smile

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 23 Dec 2008
Posts: 14
Reply with quote
dmitri wrote:
Output with browser is EXACTLY what you're asking about and it GETS exactly the same data as Debug Window->output, but most of time you don't see anything there because browser waits for more data to come Smile


Could you please shed some more light on this? I saw a case in which, even if the Debug Window->output had a complete HTML file (ending with </html>), the Output panel still didn't show nothing.
View user's profileFind all posts by cm0901Send private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
I presume that if you enable output buffering it won't show up.
In any case, I've never known the output panel to output anything unless I explicitly do a flush, must be my PHP settings Smile
I've never missed it though so I didn't look into it yet.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
Could you please shed some more light on this? I saw a case in which, even if the Debug Window->output had a complete HTML file (ending with </html>), the Output panel still didn't show nothing


It's completely up to the browser when its rendering has to start. It may depend, for example, on HTTP headers and on the html file itself.

Also, as Steve noticed, buffering may play its role too. Try ob_ flush() to flush the output buffers.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Partial preview while debugging
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic