NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
invoke debugger from code


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Might it be possible to invoke the debugger from within a php script? Something like you can do in javascript with WSH debugger:
Code:
<?php
print "something";
_phpdebug();
print "more commands.. but now you're debugging";


My interest in this is b/c I'm working in Drupal (a cms), and when I insert php into a node that Drupal must interpret, I clearly have no easy way to set a breakpoint to start debugging unless I find the lines in Drupal that handle embedded php code.
View user's profileFind all posts by bcswebstudioSend private message


Joined: 19 Aug 2006
Posts: 76
Reply with quote
try:

Code:

DebugBreak();
View user's profileFind all posts by jlSend private message
Starting deubugger from code: DebugBreak();


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Well what do you know! Thanks-- works great!

(I couldn't and still can't find this in the docs when searching for info on how to invoke debug or even the keyword "debugbreak": Feature request: Add this to more places in docs)
View user's profileFind all posts by bcswebstudioSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
See: php-debug-functions-t2806.html

This definitely needs to be better documented!
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
DebugBreak should show in code autocomplete


Joined: 28 Jun 2006
Posts: 92
Reply with quote
DebugBreak() should show in code auto-complete..
View user's profileFind all posts by bcswebstudioSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8239
Reply with quote
Feel free to add it into Tools->Settings->Reserved Words, php4|php5, [Add]

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


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Thank you guys!
I had no idea about the existence of such useful function DebugBreak(), but I need it many times
View user's profileFind all posts by DelphiSend private messageICQ Number
please add DebugBreak() to documentation


Joined: 28 Jun 2006
Posts: 92
Reply with quote
In the latest release, I did a search for the string "debugbreak" in documentation and came up emptyhanded. I think it should be documented somewhere maybe in the "ways to invoke debugger" section(s).

cheers
View user's profileFind all posts by bcswebstudioSend private message
Profiler


Joined: 26 Sep 2007
Posts: 1
Reply with quote
Hi

DebugBreak() works fine.

I tried run profiler selecting "Run profiler with debugger" but seen not work with DebugBreak().

Is there a function like DebugBreak() to run profiler from script?

Regards

macm
View user's profileFind all posts by macmSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8239
Reply with quote
As of version 3.2, dbg can start profiler only from the very beginning of the execution.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
invoke debugger from code
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