The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 21, 2019, 01:44:10 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: PHP class method/function monitoring & logging  (Read 1765 times)
kurdt
Lifer
*****
Offline Offline

Posts: 1153


paha arkkitehti


View Profile
« on: April 02, 2010, 01:09:49 AM »

Is there any built-in features in PHP to monitor individual functions/methods in classes and execution times? I have been doing this manually by adding logit(__FUNCTION__) at the beginning and at the end of every function. But this results in lots of duplicate code so I'm looking for more efficient way to do it. Is there anyway to add some sort of __construct type of method in class that executes every time method gets executed?
Logged

I met god and he had nothing to say to me.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: April 02, 2010, 08:55:55 AM »

I'm not certain because I've not done it ... but look up the __call magic method - it might do you.

http://php.net/manual/en/language.oop5.magic.php

Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
herbacious
Journeyman
***
Offline Offline

Posts: 51


View Profile
« Reply #2 on: April 06, 2010, 01:54:28 PM »

http://xdebug.org/docs/profiler Applause

xdebug + firefox addon + kcachegrind

http://xdebug.org/

https://addons.mozilla.org/en-US/firefox/addon/58688

http://kcachegrind.sourceforge.net/html/Home.html

Logged
jammaster82
Lifer
*****
Offline Offline

Posts: 666


Thats craigs list for ya


View Profile
« Reply #3 on: April 06, 2010, 07:59:54 PM »

I just fire up phpdesigner2008.. xdebug is
all set up and ready to roll..

It has code completion, suggestions for all
php functions when typing with code complete
find matching braces, breakpoints, step over/into
xdebug support.. Code explorer, variable watches
that work deep inside of objects.... FTW
Logged

The watched pot, never boils... But if you walk away from it , the soup burns.  What gives?
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!