cvs: peardoc /en/package gtk2.xml /en/package/gtk filedrop.xml /en/package/gtk2 exceptiondump.xml /en/package/gtk2/exceptiondump intro.xml
reusing.xml

From: Date: Fri, 27 Oct 2006 20:13:25 +0000
Subject: cvs: peardoc /en/package gtk2.xml /en/package/gtk filedrop.xml /en/package/gtk2 exceptiondump.xml /en/package/gtk2/exceptiondump intro.xml
reusing.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8665@lists.php.net to get a copy of this message
cweiske Fri Oct 27 20:13:25 2006 UTC Added files: /peardoc/en/package/gtk2 exceptiondump.xml /peardoc/en/package/gtk2/exceptiondump intro.xml reusing.xml Modified files: /peardoc/en/package gtk2.xml /peardoc/en/package/gtk filedrop.xml Log: - Gtk2_VarDump section about reusing the classes - Gtk2_ExceptionDump docs http://cvs.php.net/viewvc.cgi/peardoc/en/package/gtk2.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/gtk2.xml diff -u peardoc/en/package/gtk2.xml:1.4 peardoc/en/package/gtk2.xml:1.5 --- peardoc/en/package/gtk2.xml:1.4 Thu Jun 29 20:32:32 2006 +++ peardoc/en/package/gtk2.xml Fri Oct 27 20:13:25 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <chapter id="package.gtk2"> @@ -13,6 +13,7 @@ &blankpagehack; &package.gtk2.entrydialog; + &package.gtk2.exceptiondump; &package.gtk2.filedrop; &package.gtk2.vardump; http://cvs.php.net/viewvc.cgi/peardoc/en/package/gtk/filedrop.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/gtk/filedrop.xml diff -u peardoc/en/package/gtk/filedrop.xml:1.1 peardoc/en/package/gtk/filedrop.xml:1.2 --- peardoc/en/package/gtk/filedrop.xml:1.1 Sat Nov 6 16:26:06 2004 +++ peardoc/en/package/gtk/filedrop.xml Fri Oct 27 20:13:25 2006 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> -<sect1 id="package.gtk.filedrop"> +<sect1 id="package.gtk.gtk-filedrop"> <title>FileDrop</title> <para> http://cvs.php.net/viewvc.cgi/peardoc/en/package/gtk2/exceptiondump.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/exceptiondump.xml +++ peardoc/en/package/gtk2/exceptiondump.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="package.gtk2.exceptiondump"> <title>Gtk2_ExceptionDump</title> <para> Catches and displays PHP errors, notices and warnings as well as PEAR Errors and uncaught exceptions. </para> &package.gtk2.exceptiondump.intro; &package.gtk2.exceptiondump.reusing; </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/gtk2/exceptiondump/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/exceptiondump/intro.xml +++ peardoc/en/package/gtk2/exceptiondump/intro.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.gtk2.exceptiondump.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose>Using Gtk2_ExceptionDump</refpurpose> </refnamediv> <refsect1> <title>About Gtk2_ExceptionDump</title> <para> <classname>Gtk2_ExceptionDump</classname> catches and displays common errors and warnings that can be produced in a PHP scripts: PHP errors, notices and warnings as well as PEAR Errors and uncaught exceptions. They are displayed in a Gtk2 window with a tree view, providing the error message and the backtrace with passed parameters. </para> <para> The most easy thing to do is letting the class handle everything automatically. You can decide which errors should be catched: All, PHP errors, PEAR errors or uncaught exceptions. The following methods need to be called statically to set up error handling: <itemizedlist> <listitem><para> <function>setupExceptionHandler</function> </para></listitem> <listitem><para> <function>setupPearErrorHandler</function> </para></listitem> <listitem><para> <function>setupPhpErrorHandler</function> </para></listitem> <listitem><para> <function>setupAllHandlers</function> </para></listitem> </itemizedlist> </para> <example> <title>Letting Gtk2_ExceptionDump handle all errors</title> <programlisting role="php"><![CDATA[<?php require_once 'Gtk2/ExceptionDump.php'; Gtk2_ExceptionDump::setupAllHandlers(); ?>]]></programlisting> </example> <refsect2> <title>Handling exceptions by hand</title> <para> If you don't want to let <classname>Gtk2_ExceptionDump</classname> handle errors automatically, you can display the window by hand, e.g. in a <function>catch</function> statement. </para> <example> <title>Catching exceptions by hand</title> <programlisting role="php"><![CDATA[<?php try { //do some stuff that //could throw an exception } catch (Exception $e) { require_once 'Gtk2/ExceptionDump.php'; Gtk2_ExceptionDump::display($e); } ?>]]></programlisting> </example> </refsect2> <refsect2> <title>More examples</title> <para> As usually, the package has more examples in the doc directory: <filename>/path/to/pear/docs/Gtk2_ExceptionDump/examples/</filename>. </para> </refsect2> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/peardoc/en/package/gtk2/exceptiondump/reusing.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/exceptiondump/reusing.xml +++ peardoc/en/package/gtk2/exceptiondump/reusing.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.gtk2.exceptiondump.reusing"> <refnamediv> <refname>Re-using Gtk2_ExceptionDump</refname> <refpurpose>Embedding it in own applications</refpurpose> </refnamediv> <refsect1> <title>Re-using Gtk2_ExceptionDump</title> <para> You can make use of the brain power that went into the development of <classname>Gtk2_ExceptionDump</classname> by embedding the stack trace treeview into your own application. </para> <para> There class you want is <classname>Gtk2_ExceptionDump_Stack</classname>. It's a subclass of <classname>GtkTreeView</classname> and should be embedded in a <classname>GtkScrolledWindow</classname> if you use it. The constructor takes the exception object, but it can be omitted and set later by using <function>setException</function>. </para> </refsect1> </refentry>

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