cvs: peardoc /en/package php.xml /en/package/php php-fctcalltrac.xml /en/package/php/php-fctcalltrac basic.xml intro.xml
| From: | Michel Corne | Date: | Sun, 13 Jan 2008 20:14:48 +0000 |
| Subject: | cvs: peardoc /en/package php.xml /en/package/php php-fctcalltrac.xml /en/package/php/php-fctcalltrac basic.xml intro.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-10385@lists.php.net to get a copy of this message | ||
mcorne Sun Jan 13 20:14:48 2008 UTC
Added files:
/peardoc/en/package/php php-fctcalltrac.xml
/peardoc/en/package/php/php-fctcalltrac basic.xml intro.xml
Modified files:
/peardoc/en/package php.xml
Log:
Initial commit.
Package basic use.
http://cvs.php.net/viewvc.cgi/peardoc/en/package/php.xml?r1=1.13&r2=1.14&diff_format=u Index: peardoc/en/package/php.xml diff -u peardoc/en/package/php.xml:1.13 peardoc/en/package/php.xml:1.14 --- peardoc/en/package/php.xml:1.13 Thu Dec 27 21:30:01 2007 +++ peardoc/en/package/php.xml Sun Jan 13 20:14:47 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <chapter id="package.php"> @@ -16,6 +16,7 @@ &package.php.php-codesniffer; &package.php.php-compat; &package.php.php-compatinfo; + &package.php.php-fctcalltrac; &package.php.phpunit; &package.php.phpunit2; http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-fctcalltrac.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-fctcalltrac.xml +++ peardoc/en/package/php/php-fctcalltrac.xml <!-- $Revision: 1.1 $ --> <sect1 id="package.php.php-fctcalltrac"> <title>PHP_FunctionCallTracer</title> <para> Creates a function calls debug trace. Functions arguments, returned parameters and watched variables are reported in the same section for each function call. The trace is available as an array, or can be displayed or written in a file. Traced variables can be processed by provided user functions for displaying purposes. </para> &package.php.php-request.intro; &package.php.php-request.basic; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-fctcalltrac/basic.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-fctcalltrac/basic.xml +++ peardoc/en/package/php/php-fctcalltrac/basic.xml <!-- $Revision: 1.1 $ --> <refentry id="package.php.php-fctcalltrac.basic"> <refnamediv> <refname>Basic Use</refname> <refpurpose> Simple trace of function arguments and returned variables. </refpurpose> </refnamediv> <refsect1 id="package.php.php-fctcalltrac.basic.overview"> <title>Overview</title> <para> PHP_FunctionCallTracer::traceArguments() is used to trace the function arguments. There is no need to pass the function arguments to PHP_FunctionCallTracer::traceArguments() to trace them. Note that PHP_FunctionCallTracer::traceArguments() may not be used, if the function does not call any other function or if the function calls functions that are not being traced. </para> <para> PHP_FunctionCallTracer::traceVariables() is used to trace variables within the function. The variables to trace must be passed as arguments to PHP_FunctionCallTracer::traceVariables(). PHP_FunctionCallTracer::traceVariables() may be called as many times as required to watch variables value change. </para> <para> PHP_FunctionCallTracer::traceReturn() is used to trace the variables returned by the function. The variables to trace must be passed as arguments to PHP_FunctionCallTracer::traceReturn(). </para> <para> PHP_FunctionCallTracer::putTrace() is used to display the trace to the standard output or to write it into a file. </para> </refsect1> <refsect1 id="package.php.php-fctcalltrac.basic.usage"> <title>How to use PHP_FunctionCallTracer</title> <para> In this example, <filename>package.php</filename> contains two classes whose methods are traced. The package is used by an application <filename>trace.php</filename>. The trace is stored into <filename>trace.txt</filename>. </para> <example> <title>The package <filename>package.php</filename></title> <programlisting role="php"> <?php /** * this is an example of a package * * calls to the tracer are added wherever there is a need to trace a function call * these calls can be left in the package, they are executed only if the tracer is loaded */ class math { /** * tracing the arguments and the returned parameter * * note that traceReturn() calls traceArguments() by default which is fine here * since this method does call other methods to trace */ public static function prod($x, $y) { // class_exists('PHP_FunctionCallTracer', false) // and PHP_FunctionCallTracer::traceArguments(); $p = $x * $y; class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceReturn($p); return $p; } /** * tracing the arguments and the returned parameter * * traceArguments() must be called here since this method calls other methods * that may be traced, so that traced calls are displayed in the right order */ public static function square($x) { class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceArguments(); $x2 = self::prod($x, $x); class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceReturn($x2); return $x2; } } class geometry { private $pi = 3.14; /** * tracing the arguments and the returned parameter * another variable is traced along with the returned parameter */ public function circle($r) { class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceArguments(); $pi2 = 2 * $this->pi; $c = math::prod($r, $pi2); class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceReturn($c, $pi2); return $c; } /** * tracing the arguments, some variables and the returned parameter */ public function disk($r) { class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceArguments(); $r2 = math::square($r); class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceVariables($r2, $this->pi); $d = math::prod($r2, $this->pi); class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceReturn($d); return $d; } } ?> </programlisting> </example> <example> <title>The application <filename>trace.php</filename></title> <programlisting role="php"> <?php /** * run php trace.php to generate the trace * open trace.txt to analyse the function calls trace */ /** * adds the path of the package if this is a raw install * includes the package (example) to debug and the tracer package */ file_exists("../../../../PHP/") and set_include_path('../../../..' . PATH_SEPARATOR . get_include_path()); require_once 'package.php'; require_once 'PHP/FunctionCallTracer.php'; /** * creates an instance of the class to debug and calls a few methods * writes the trace in a file */ $geometry = new geometry; $c = $geometry->circle(2); $d = $geometry->disk(3); $file = dirname(__FILE__) . '/trace.txt'; PHP_FunctionCallTracer::putTrace($file, false); ?> </programlisting> </example> <example> <title>The trace <filename>trace.txt</filename></title> <programlisting role="php"> Array ( [php_uname] => Windows NT MICHEL-PORT 5.1 build 2600 [date] => Friday, 03-Aug-07 09:17:30 UTC [calls] => Array ( [0] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\trace.php [line] => 20 [function] => geometry->circle ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 55 [args] => Array ( [0] => 2 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 61 [args] => Array ( [0] => 12.56 [1] => 6.28 ) ) ) [1] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 58 [function] => math::prod ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 2 [1] => 6.28 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 12.56 ) ) ) [2] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\trace.php [line] => 21 [function] => geometry->disk ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 71 [args] => Array ( [0] => 3 ) ) [watches] => Array ( [0] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 75 [args] => Array ( [0] => 9 [1] => 3.14 ) ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 80 [args] => Array ( [0] => 28.26 ) ) ) [3] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 73 [function] => math::square ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 35 [args] => Array ( [0] => 3 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 40 [args] => Array ( [0] => 9 ) ) ) [4] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 37 [function] => math::prod ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 3 [1] => 3 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 9 ) ) ) [5] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 77 [function] => math::prod ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 9 [1] => 3.14 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 28.26 ) ) ) ) [objects] => Array ( [0] => geometry Object ( [pi:private] => 3.14 ) [2] => same as #0 ) ) </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-fctcalltrac/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-fctcalltrac/intro.xml +++ peardoc/en/package/php/php-fctcalltrac/intro.xml <!-- $Revision: 1.1 $ --> <refentry id="package.php.php-fctcalltrac.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose> <classname>PHP_FunctionCallTracer</classname> creates function calls debug trace. </refpurpose> </refnamediv> <refsect1 id="package.php.php-fctcalltrac.intro.overview"> <title>Overview</title> <para> Functions arguments, returned parameters and watched variables are reported in the same section for each function call. The trace is available as an array, or can be displayed or written in a file. Traced variables can be processed by provided user functions for displaying purposes. </para> <para> This package is not a replacement for full fledged PHP debuggers. It is useful for (1) remote debugging, (2) to debug a complex sequence of function calls, (3) to display non text variables in a user readable format. </para> <orderedlist> <listitem> <simpara> Remote debugging is sometimes the only option to debug a package that works fine on your system, e.g. a 32-bit OS, but breaks on a different system, e.g. a 64-bit OS, which you have no access to. A remote user who has the latter OS could run the package, then send you the trace for analysis. </simpara> </listitem> <listitem> <simpara> It is sometimes difficult not to loose track of functions calls in some live debugging sessions even with top notch PHP editor/debuggers. The trace produced by this package may come handy and is easy to use in combination with the source code to track calls and variables. </simpara> </listitem> <listitem> <simpara> Some variables native format does not always display well, typically: packed data and UTF-8 strings. They can be converted as they are being traced to a readable format by provided user functions. For example: converting binary strings to hexadecimal, or UTF-8 string to Unicode. </simpara> </listitem> </orderedlist> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/peardoc/en/package/php.xml?r1=1.13&r2=1.14&diff_format=u Index: peardoc/en/package/php.xml diff -u peardoc/en/package/php.xml:1.13 peardoc/en/package/php.xml:1.14 --- peardoc/en/package/php.xml:1.13 Thu Dec 27 21:30:01 2007 +++ peardoc/en/package/php.xml Sun Jan 13 20:14:47 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <chapter id="package.php"> @@ -16,6 +16,7 @@ &package.php.php-codesniffer; &package.php.php-compat; &package.php.php-compatinfo; + &package.php.php-fctcalltrac; &package.php.phpunit; &package.php.phpunit2; http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-fctcalltrac.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-fctcalltrac.xml +++ peardoc/en/package/php/php-fctcalltrac.xml <!-- $Revision: 1.1 $ --> <sect1 id="package.php.php-fctcalltrac"> <title>PHP_FunctionCallTracer</title> <para> Creates a function calls debug trace. Functions arguments, returned parameters and watched variables are reported in the same section for each function call. The trace is available as an array, or can be displayed or written in a file. Traced variables can be processed by provided user functions for displaying purposes. </para> &package.php.php-request.intro; &package.php.php-request.basic; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-fctcalltrac/basic.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-fctcalltrac/basic.xml +++ peardoc/en/package/php/php-fctcalltrac/basic.xml <!-- $Revision: 1.1 $ --> <refentry id="package.php.php-fctcalltrac.basic"> <refnamediv> <refname>Basic Use</refname> <refpurpose> Simple trace of function arguments and returned variables. </refpurpose> </refnamediv> <refsect1 id="package.php.php-fctcalltrac.basic.overview"> <title>Overview</title> <para> PHP_FunctionCallTracer::traceArguments() is used to trace the function arguments. There is no need to pass the function arguments to PHP_FunctionCallTracer::traceArguments() to trace them. Note that PHP_FunctionCallTracer::traceArguments() may not be used, if the function does not call any other function or if the function calls functions that are not being traced. </para> <para> PHP_FunctionCallTracer::traceVariables() is used to trace variables within the function. The variables to trace must be passed as arguments to PHP_FunctionCallTracer::traceVariables(). PHP_FunctionCallTracer::traceVariables() may be called as many times as required to watch variables value change. </para> <para> PHP_FunctionCallTracer::traceReturn() is used to trace the variables returned by the function. The variables to trace must be passed as arguments to PHP_FunctionCallTracer::traceReturn(). </para> <para> PHP_FunctionCallTracer::putTrace() is used to display the trace to the standard output or to write it into a file. </para> </refsect1> <refsect1 id="package.php.php-fctcalltrac.basic.usage"> <title>How to use PHP_FunctionCallTracer</title> <para> In this example, <filename>package.php</filename> contains two classes whose methods are traced. The package is used by an application <filename>trace.php</filename>. The trace is stored into <filename>trace.txt</filename>. </para> <example> <title>The package <filename>package.php</filename></title> <programlisting role="php"> <?php /** * this is an example of a package * * calls to the tracer are added wherever there is a need to trace a function call * these calls can be left in the package, they are executed only if the tracer is loaded */ class math { /** * tracing the arguments and the returned parameter * * note that traceReturn() calls traceArguments() by default which is fine here * since this method does call other methods to trace */ public static function prod($x, $y) { // class_exists('PHP_FunctionCallTracer', false) // and PHP_FunctionCallTracer::traceArguments(); $p = $x * $y; class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceReturn($p); return $p; } /** * tracing the arguments and the returned parameter * * traceArguments() must be called here since this method calls other methods * that may be traced, so that traced calls are displayed in the right order */ public static function square($x) { class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceArguments(); $x2 = self::prod($x, $x); class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceReturn($x2); return $x2; } } class geometry { private $pi = 3.14; /** * tracing the arguments and the returned parameter * another variable is traced along with the returned parameter */ public function circle($r) { class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceArguments(); $pi2 = 2 * $this->pi; $c = math::prod($r, $pi2); class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceReturn($c, $pi2); return $c; } /** * tracing the arguments, some variables and the returned parameter */ public function disk($r) { class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceArguments(); $r2 = math::square($r); class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceVariables($r2, $this->pi); $d = math::prod($r2, $this->pi); class_exists('PHP_FunctionCallTracer', false) and PHP_FunctionCallTracer::traceReturn($d); return $d; } } ?> </programlisting> </example> <example> <title>The application <filename>trace.php</filename></title> <programlisting role="php"> <?php /** * run php trace.php to generate the trace * open trace.txt to analyse the function calls trace */ /** * adds the path of the package if this is a raw install * includes the package (example) to debug and the tracer package */ file_exists("../../../../PHP/") and set_include_path('../../../..' . PATH_SEPARATOR . get_include_path()); require_once 'package.php'; require_once 'PHP/FunctionCallTracer.php'; /** * creates an instance of the class to debug and calls a few methods * writes the trace in a file */ $geometry = new geometry; $c = $geometry->circle(2); $d = $geometry->disk(3); $file = dirname(__FILE__) . '/trace.txt'; PHP_FunctionCallTracer::putTrace($file, false); ?> </programlisting> </example> <example> <title>The trace <filename>trace.txt</filename></title> <programlisting role="php"> Array ( [php_uname] => Windows NT MICHEL-PORT 5.1 build 2600 [date] => Friday, 03-Aug-07 09:17:30 UTC [calls] => Array ( [0] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\trace.php [line] => 20 [function] => geometry->circle ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 55 [args] => Array ( [0] => 2 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 61 [args] => Array ( [0] => 12.56 [1] => 6.28 ) ) ) [1] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 58 [function] => math::prod ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 2 [1] => 6.28 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 12.56 ) ) ) [2] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\trace.php [line] => 21 [function] => geometry->disk ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 71 [args] => Array ( [0] => 3 ) ) [watches] => Array ( [0] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 75 [args] => Array ( [0] => 9 [1] => 3.14 ) ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 80 [args] => Array ( [0] => 28.26 ) ) ) [3] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 73 [function] => math::square ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 35 [args] => Array ( [0] => 3 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 40 [args] => Array ( [0] => 9 ) ) ) [4] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 37 [function] => math::prod ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 3 [1] => 3 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 9 ) ) ) [5] => Array ( [call] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 77 [function] => math::prod ) [in] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 9 [1] => 3.14 ) ) [out] => Array ( [file] => D:\Data\dev\php-fctcalltrac\trunk\PHP\docs\examples\basic\package.php [line] => 22 [args] => Array ( [0] => 28.26 ) ) ) ) [objects] => Array ( [0] => geometry Object ( [pi:private] => 3.14 ) [2] => same as #0 ) ) </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-fctcalltrac/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-fctcalltrac/intro.xml +++ peardoc/en/package/php/php-fctcalltrac/intro.xml <!-- $Revision: 1.1 $ --> <refentry id="package.php.php-fctcalltrac.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose> <classname>PHP_FunctionCallTracer</classname> creates function calls debug trace. </refpurpose> </refnamediv> <refsect1 id="package.php.php-fctcalltrac.intro.overview"> <title>Overview</title> <para> Functions arguments, returned parameters and watched variables are reported in the same section for each function call. The trace is available as an array, or can be displayed or written in a file. Traced variables can be processed by provided user functions for displaying purposes. </para> <para> This package is not a replacement for full fledged PHP debuggers. It is useful for (1) remote debugging, (2) to debug a complex sequence of function calls, (3) to display non text variables in a user readable format. </para> <orderedlist> <listitem> <simpara> Remote debugging is sometimes the only option to debug a package that works fine on your system, e.g. a 32-bit OS, but breaks on a different system, e.g. a 64-bit OS, which you have no access to. A remote user who has the latter OS could run the package, then send you the trace for analysis. </simpara> </listitem> <listitem> <simpara> It is sometimes difficult not to loose track of functions calls in some live debugging sessions even with top notch PHP editor/debuggers. The trace produced by this package may come handy and is easy to use in combination with the source code to track calls and variables. </simpara> </listitem> <listitem> <simpara> Some variables native format does not always display well, typically: packed data and UTF-8 strings. They can be converted as they are being traced to a readable format by provided user functions. For example: converting binary strings to hexadecimal, or UTF-8 string to Unicode. </simpara> </listitem> </orderedlist> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->