Class: PHP_FunctionCallTracer
Source Location: /PHP_FunctionCallTracer-1.0.0/FunctionCallTracer.php
Function Call Tracer
Author(s):
Version:
- Release:@package_version@
Copyright:
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
createStackKey [line 226]
array createStackKey(
array
$trace)
|
|
Creates a function call ID stack key Based on the backtrace. Ignores the last function call. Retains only the data clearly identifying the call: 'file', 'line', 'class', 'type', 'function'. Serializes the backtrace to build the key.
Parameters:
filterTrace [line 200]
array filterTrace(
array
$trace, array
$keys)
|
|
Filters some key/values of a function calls trace
Parameters:
getTrace [line 247]
array getTrace(
[boolean
$getPhpInfo = true])
|
|
Gets the function calls trace This method is usually called at the end of a debugging session.
Parameters:
isCallable [line 278]
boolean isCallable(
array
$function)
|
|
Determines if the provided user function is callable
Parameters:
processVariables [line 332]
boolean processVariables(
)
|
|
Processes a set of variables with provided user functions It is usually called after self::traceArguments(), self::traceReturn(), or self::traceVariables(). It will process the variables passed to the above functions. This method is used in 2 different ways. (1) If the package is used with one user function, e.g. self::setUserFunctions('dechex'), this method is expecting as arguments the keys of variables that were passed to the above functions. Examples when called after self::traceArguments($a, $b, $c): - self::processVariables() => $a, $b, $c are processed.
- self::processVariables(true) => $a, $b, $c are processed.
- self::processVariables(0) => $a only is processed.
- self::processVariables(0,1) => $a and $b only are processed.
(2) If the package is used with 2 or more user function : e.g. self::setUserFunctions('dechex', 'bin2hex'), this method is expecting for each argument a set of keys of variables that were passed to the above functions. Examples when called after self::traceArguments($a, $b, $c): - self::processVariables() => $a, $b, $c are processed by dechex.
- self::processVariables(null, true) => $a, $b, $c are processed by bin2hex.
- self::processVariables(0, 1) => $a is processed by dechex and $b by bin2hex.
- self::processVariables(0, array(1, 2)) => $a is processed by dexhex, and $b and $c by bin2hex.
Automatically calls self::traceArguments() if this method is the first one called within a function.
putTrace [line 401]
array putTrace(
[string
$file = ''], [boolean
$getPhpInfo = null])
|
|
Displays or writes the function calls trace in a file This method is usually called at the end of a debugging session.
Parameters:
reset [line 434]
Resets the class settings and working variables This method is needed when 2 or more debug sessions are run in a row. There is no need to call this method before self::setUserFunctions() which calls this method internally.
setUserFunctions [line 465]
array setUserFunctions(
)
|
|
Sets provided user functions Each argument is expected to be a callable function or object/class method. Examples: - self::setUserFunctions('dechex') => the PHP function dexhex
- self::setUserFunctions(array($object, 'foo')) => the object method foo
- self::setUserFunctions(array('foo', 'bar')) => the class method foo::bar
- self::setUserFunctions('dechex', array('foo', 'bar')) => a combination of the PHP function dexhex and the class method foo::bar.
The first argument is the user function/method #0, the second is #1 etc... This order number is used when passing variables keys to self::processVariables(). Verifies that the user functions/methods are callable. Reports which ones are callable or not in the function calls trace.
tidyMethodName [line 496]
string tidyMethodName(
mixed
$function)
|
|
Tidies the object/class method name
Parameters:
traceArguments [line 546]
boolean traceArguments(
)
|
|
Traces the argments passed to a function Usually called within a function before the rest of the function code. Normally, not expecting any arguments since they are captured automaticly. However, if the function expects arguments passed by reference, the arguments should be passed explicitly, due to PHP Bug 42058: "debug_backtrace messes up with references". For example, given the function foo($a, &$b): self::traceArguments($a, $b) should be used instead of self::traceArguments() to trace arguments properly. Called automaticly by self::traceReturn(), self::traceVariables() or self::processVariables() if it is not called explicitly before any of those methods within the function. It should always be called if the function itself calls other functions that are being traced as well, in order to keep the function calls in order within the trace.
traceReturn [line 600]
Traces the return parameters Optionally called within a function before a return statement. Normally expecting the parameters returned by the function, plus optionally any other variables. For example, given the return($a, $b) statement in a function: self::traceReturn($a, $b) should preceed this return statement. Automatically calls self::traceArguments() if it is not called explicitly before this method within the function.
traceVariables [line 639]
boolean traceVariables(
)
|
|
Traces variables used by a function Expecting a list of variables. For example, self::traceVariables($a, $b). Automatically calls self::traceArguments() if it is not called explicitly before this method within the function.
Documentation generated on Mon, 11 Mar 2019 15:09:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|