cvs: peardoc /en/package/php/php-functioncalltracer basic.xml

From: Date: Mon, 14 Jan 2008 11:00:12 +0000
Subject: cvs: peardoc /en/package/php/php-functioncalltracer basic.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-10391@lists.php.net to get a copy of this message
mcorne Mon Jan 14 11:00:12 2008 UTC Modified files: /peardoc/en/package/php/php-functioncalltracer basic.xml Log: Removed the PHP tags from within code examples. Added content. http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-functioncalltracer/basic.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/php/php-functioncalltracer/basic.xml diff -u peardoc/en/package/php/php-functioncalltracer/basic.xml:1.2 peardoc/en/package/php/php-functioncalltracer/basic.xml:1.3 --- peardoc/en/package/php/php-functioncalltracer/basic.xml:1.2 Mon Jan 14 09:08:42 2008 +++ peardoc/en/package/php/php-functioncalltracer/basic.xml Mon Jan 14 11:00:12 2008 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.php.php-functioncalltracer.basic"> <refnamediv> <refname>Basic Use</refname> @@ -40,19 +40,20 @@ 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>. + To generate the trace, run: #php trace.php. </para> <example> <title>The package <filename>package.php</filename></title> + <para> + Note that checking if <classname>PHP_FunctionCallTracer</classname> is loaded: + class_exists('PHP_FunctionCallTracer', false), is optional. It is useful only + if the tracing methods are meant to be left in the code. They will be called only if + <classname>PHP_FunctionCallTracer</classname> is loaded. + </para> + <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 @@ -129,8 +130,6 @@ return $d; } } - -?> </programlisting> </example> @@ -138,12 +137,6 @@ <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 @@ -162,18 +155,16 @@ $file = dirname(__FILE__) . '/trace.txt'; PHP_FunctionCallTracer::putTrace($file, false); - -?> </programlisting> </example> <example> <title>The trace <filename>trace.txt</filename></title> - <programlisting role="php"> + <screen> Array ( - [php_uname] => Windows NT MICHEL-PORT 5.1 build 2600 + [php_uname] => Windows NT mybox 5.1 build 2600 [date] => Friday, 03-Aug-07 09:17:30 UTC [calls] => Array ( @@ -392,7 +383,7 @@ ) ) - </programlisting> + </screen> </example> </refsect1>

« previous php.pear.doc (#10391) next »