file getting written wrongly
I use a simple file counter to track how many times each function
in a script of mine gets executed. so I have two file
to track how many times each function is called/executed.
The script is written is such a way that
one function will be executed once only
after the other function is executed
atleast three times.(after page receives 3 hits)
So content of one file will be always higher than the other file.
But sometimes the content of the second file
is more than the other file
What might be the problem ?
Is there any other way to track how many times a function is called ?
Can you post some code? It sounds like a logic error to me.
As far as tracking function usage, I might do:
$GLOBALS['function_count'][__FUNCTION__]) + 1 : 1;
// rest of function definition . . .
// end of script:
$log = __FILE__ . " (" . date('Y-m-d H:i:s') . "): ";
foreach($GLOBALS['function_count'] as $function => $count)
$log .= $function = $count . "; ";
error_log(rtrim($log, " ;"));
Then just check the PHP error log for usage (or specify a separate file in the call to error_log()).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread