NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Breakpointing on built-in php functions


Joined: 30 Oct 2007
Posts: 3
Location: Boston
Reply with quote
I'd like to breakpoint on built-in PHP session management functions such as session_start().
Is there any way to do this?

_________________
PA
View user's profileFind all posts by papleySend private messageAIM Address
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Why not to set it on the php code where you call this function?

if on the other hand you need to debug session_start, feel free to download php sources, compile them with debug info and proceed with debugging in C/C++ IDE like visual studio (windows) or kdevelop (linux/unix).

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


Joined: 30 Oct 2007
Posts: 3
Location: Boston
Reply with quote
dmitri wrote:
Why not to set it on the php code where you call this function?

if on the other hand you need to debug session_start, feel free to download php sources, compile them with debug info and proceed with debugging in C/C++ IDE like visual studio (windows) or kdevelop (linux/unix).


The issue is there are many places in the code where these functions are called. I want to see where they're being invoked from in specific cases.

The wrapper is the best solution, but it's more of a pain then I expected.

_________________
PA
View user's profileFind all posts by papleySend private messageAIM Address
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
papley wrote:
The wrapper is the best solution, but it's more of a pain then I expected.


I would probably handle this situation by defining all the wrapper functions in one file, setting that file as an auto-include in php.ini, and doing a global search-and-replace on the actual function calls to replace them with calls to the wrappers. Just make absolutely sure that the wrappers are parameter-compatible with their real-function equivalents, lest you create runtime errors.

The biggest downside to this approach is that it slows the performance of those function calls, since it adds a user-level function call into the mix. However, for functions like session_start() that you aren't calling thousands of times in a tight loop, the penalty probably isn't even measurable by the profiler, yet alone noticeable.
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Breakpointing on built-in php functions
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