NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
access to the php output buffer(s) in the debugger?


Joined: 18 Oct 2006
Posts: 75
Reply with quote
Is there any way I can inspect the contents of the current output buffer (created implicitly or by ob_start) from the PhpEd debugger?

Thanks,
Nick
View user's profileFind all posts by nickweaversSend private messageVisit poster's websiteYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
You can invoke corresponding ob_XXX functions in Watch or Immediate and see their return values.
Watch is better if you want it to happen automatically after each step, Immediate is better for one-time checks.

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


Joined: 08 Jul 2011
Posts: 2
Reply with quote
Thanks Dimitri,

I tried ob_get_contents() as a watch and was able to see what it retrieved from the buffer.

I think my question was was wrong. What I am after is a way to see each "write" to stdout or nested buffers that would happen due to something outside of php tabs, or an echo, or a ob_end_flush() etc. My case was that I had a line of text appearing in a web page that shouldn't be there and I was having trouble finding what was putting it there. Walking through every line of code was laborious and although I new it would get me there in the end, I couldn't find it for some time. If I could have done a sort of tail on the nested buffers it might have helped.

Or maybe there is another better way to track down unintended output?

Thanks,
Nick
View user's profileFind all posts by nickweavers2Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
If you want to see each "write", you may want to disable output buffer at all. In this case Output window will be updated with each echo (or any other output function) call.
If you want to get debugger stopped when a particular content appear in the output buffer, set a Global Breakpoint with condition like below:
strpos(ob_get_contents(), "my text") !== FALSE

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
access to the php output buffer(s) in the debugger?
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