php-doc-en/reference/apd/reference.xml

126 lines
3.9 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<reference id="ref.apd">
<title>Advanced PHP debugger</title>
<titleabbrev>APD</titleabbrev>
<partintro>
<section id="apd.intro">
&reftitle.intro;
<para>
APD is the Advanced PHP Debugger. It was written to provide strace/truss
capability for profiling and debugging php code, as well as providing the
ability to print out a full stack backtrace. APD does supports
interactive and non interactive debugging, by default it writes data to
trace files. APD provides event based logging, so that varying levels of
information (including function calls, arguments passed, timings, etc.)
can be turned on or off for individual scripts.
</para>
<para>
APD is a Zend Extension, modifying the way the internals of PHP handle
function calls, and thus may or may not be compatible with other Zend
Extensions (for example Zend Optimizer).
</para>
</section>
&reference.apd.configure;
<section id="apd.examples">
<title>How to use PHP-APD in your scripts</title>
<para>
In your PHP script, add the following line:
</para>
<para>
<programlisting role="php">
<![CDATA[
apd_set_session_trace(9);
]]>
</programlisting>
</para>
<para>
Now run your script.
</para>
<para>
The dump output will be writing to:
</para>
<para>
<programlisting role="text">
<![CDATA[
<apd.dumpdir>/apd_dump_<pid>
]]>
</programlisting>
</para>
<para>
The output itself will look something like:
<screen>
<![CDATA[
16:37:51(george@wasabi)[~/src/apd]> cat /tmp/apd_dump_31994
APD - Advanced PHP Debugger Trace File
---------------------------------------------------------------------------
Process Pid (31994)
Trace Begun at Fri Aug 10 16:37:45 2001
---------------------------------------------------------------------------
( 0.000000): apd_set_session_trace called at somewhere
( 0.001482): apd_set_session_trace() returned. Elapsed (997475865.364909)
( 0.001563): getcwd() /opt/apache/htdocs/a.php:4
( 0.001628): getcwd() returned. Elapsed (0.000065)
( 0.001819): require() /opt/apache/htdocs/a.php:6
++ argv[0] $(??) = /tmp/a.php
( 0.002231): getcwd() /tmp/a.php:3
( 0.002290): getcwd() returned. Elapsed (0.000059)
( 0.002375): include_once() /tmp/a.php:4
++ argv[0] $(??) = /tmp/aa.php
( 0.003276): include_once() returned. Elapsed (0.000901)
( 0.003334): require() returned. Elapsed (0.001515)
( 0.003381): require_once() /opt/apache/htdocs/a.php:7
++ argv[0] $(??) = /tmp/aa.php
( 0.003515): require_once() returned. Elapsed (0.000134)
( 0.003564): include() /opt/apache/htdocs/a.php:8
++ argv[0] $(??) = /tmp/b.php
( 0.003792): include() returned. Elapsed (0.000228)
( 0.018341): RSHUTDOWN called - end of trace
---------------------------------------------------------------------------
Process Pid (31994)
Trace Ended at Fri Aug 10 16:37:45 2001
---------------------------------------------------------------------------
]]>
</screen>
</para>
</section>
<section id="apd.contact">
<title>Contact Information</title>
<para>
If you have comments, bugfixes, enhancements or want to help developing
this beast, you can send an mail to
<ulink url="mailto:&email.apd;">&email.apd;</ulink>. Any help is very
welcome.
</para>
</section>
</partintro>
&reference.apd.functions;
</reference>
<!-- 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
-->