cvs: phpdoc-de /reference/java book.xml configure.xml constants.xml examples.xml ini.xml reference.xml setup.xml /reference/java/functions
java-last-exception-clear.xml java-last-exception-get.xml
| From: | Hartmut Holzgraefe | Date: | Mon, 17 Mar 2008 20:36:41 +0000 |
| Subject: | cvs: phpdoc-de /reference/java book.xml configure.xml constants.xml examples.xml ini.xml reference.xml setup.xml /reference/java/functions java-last-exception-clear.xml java-last-exception-get.xml |
||
| Groups: | php.doc.de | ||
| Request: | Send a blank email to doc-de+get-2567@lists.php.net to get a copy of this message | ||
hholzgra Mon Mar 17 20:36:41 2008 UTC
Added files:
/phpdoc-de/reference/java book.xml configure.xml constants.xml
examples.xml ini.xml setup.xml
Modified files:
/phpdoc-de/reference/java reference.xml
/phpdoc-de/reference/java/functions java-last-exception-clear.xml
java-last-exception-get.xml
Log:
translation updates
http://cvs.php.net/viewvc.cgi/phpdoc-de/reference/java/reference.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc-de/reference/java/reference.xml diff -u /dev/null phpdoc-de/reference/java/reference.xml:1.9 --- /dev/null Mon Mar 17 20:36:40 2008 +++ phpdoc-de/reference/java/reference.xml Mon Mar 17 20:36:40 2008 @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.16 Maintainer: hholzgra Status: ready --> + +<reference xml:id="ref.java" xmlns="http://docbook.org/ns/docbook"> + <title>PHP / Java Integration</title> + + &reference.java.entities.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 +indent-tabs-mode:nil +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/phpdoc-de/reference/java/functions/java-last-exception-clear.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-de/reference/java/functions/java-last-exception-clear.xml diff -u phpdoc-de/reference/java/functions/java-last-exception-clear.xml:1.5 phpdoc-de/reference/java/functions/java-last-exception-clear.xml:1.6 --- phpdoc-de/reference/java/functions/java-last-exception-clear.xml:1.5 Sat Jun 23 13:21:38 2007 +++ phpdoc-de/reference/java/functions/java-last-exception-clear.xml Mon Mar 17 20:36:40 2008 @@ -1,19 +1,44 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready --> - <refentry xml:id="function.java-last-exception-clear" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>java_last_exception_clear</refname> - <refpurpose>Letzte Java Exception freigeben</refpurpose> - </refnamediv> - <refsect1> - <title>Beschreibung</title> - <methodsynopsis> - <type>void</type><methodname>java_last_exception_clear</methodname> - <void/> - </methodsynopsis> - </refsect1> - </refentry> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.8 Maintainer: hholzgra Status: ready --> + +<refentry xml:id="function.java-last-exception-clear" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>java_last_exception_clear</refname> + <refpurpose>Löscht die letzte aufgetretene Java Exception</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>void</type><methodname>java_last_exception_clear</methodname> + <void/> + </methodsynopsis> + <para> + Löscht die letzte aufgetretene Java Exception. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.void; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + Ein Beispiel findet sich in <function>java_last_exception_get</function>. + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &warn.experimental.func; + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc-de/reference/java/functions/java-last-exception-get.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-de/reference/java/functions/java-last-exception-get.xml diff -u phpdoc-de/reference/java/functions/java-last-exception-get.xml:1.6 phpdoc-de/reference/java/functions/java-last-exception-get.xml:1.7 --- phpdoc-de/reference/java/functions/java-last-exception-get.xml:1.6 Mon Oct 1 16:05:03 2007 +++ phpdoc-de/reference/java/functions/java-last-exception-get.xml Mon Mar 17 20:36:40 2008 @@ -1,48 +1,73 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready --> - <refentry xml:id="function.java-last-exception-get" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>java_last_exception_get</refname> - <refpurpose>Letzte Java Exception holen</refpurpose> - </refnamediv> - <refsect1> - <title>Beschreibung</title> - <methodsynopsis> - <type>exception</type><methodname>java_last_exception_get</methodname> - <void/> - </methodsynopsis> - <para> - Das nachstehende Beispiel demonstriert die Verarbeitung von Java Exceptions - aus PHP heraus: - - <example> - <title>Verarbeitung von Java Exceptions</title> - <programlisting role="php"> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.11 Maintainer: hholzgra Status: ready --> + +<refentry xml:id="function.java-last-exception-get" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>java_last_exception_get</refname> + <refpurpose>Liefert die zuletzt aufgetretene Java Exception</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>object</type><methodname>java_last_exception_get</methodname> + <void/> + </methodsynopsis> + <para> + Liefert die zuletzt aufgetretene Java Exception. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Gibt ein Exception Objekt zurück. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + Das folgende Beispiel zeigt die Nutzung des Java + Exception Handlers aus PHP heraus. + <example> + <title>Java Exception Handler</title> + <programlisting role="php"> <![CDATA[ <?php - $stack = new Java('java.util.Stack'); - $stack->push(1); +$stack = new Java('java.util.Stack'); +$stack->push(1); - // Sollte funktionieren - $result = $stack->pop(); - $ex = java_last_exception_get(); - if (!$ex) print "$result\n"; - - // Sollte nicht funktionieren (Fehler mit @ unterdrückt) - $result = @$stack->pop(); - $ex = java_last_exception_get(); - if ($ex) print $ex->toString(); +// Das folgende sollte funktionieren +$result = $stack->pop(); +$ex = java_last_exception_get(); +if (!$ex) { + echo "$result\n"; +} - // Exception freigeben - java_last_exception_clear(); +// Das folgende sollte fehlschlagen (Fehler durch @ unterdrückt) +$result = @$stack->pop(); +$ex = java_last_exception_get(); +if ($ex) { + echo $ex->toString(); +} + +// Letzte Exception löschen +java_last_exception_clear(); ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &warn.experimental.func; + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc-de/reference/java/book.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/book.xml +++ phpdoc-de/reference/java/book.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: hholzgra Status: ready --> <!-- Purpose: remote.other --> <!-- Membership: pecl, external --> <!-- State: experimental --> <book xml:id="book.java" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Java</title> <!-- {{{ preface --> <preface xml:id="intro.java"> &reftitle.intro; <para> Es gibt zwei verschiedene Möglichkeiten um PHP mit Java zu verbinden: Sie können entweder <link linkend="java.servlet">PHP in eine Java Servlet Umgebung integrieren</link>, was die stabilere und effizientere Lösung ist, oder Sie können Java Unterstützung in PHP integrieren. Ersteres wird durch ein SAPI Modul ermöglicht das die Verbindung zum Servlet Server herstellt, letzteres über die hier vorgestellte Java Extension. </para> <para> Die Java Extension bietet ein einfaches und effektives mittel für das Erzeugen von Java Objekten und für Methodenaufrufe aus Java heraus. Die JVM wird über das JNI Interface erzeugt und läuft innerhalb des PHP Prozesses. </para> &warn.experimental; </preface> <!-- }}} --> &reference.java.setup; &reference.java.constants; &reference.java.servlet; &reference.java.examples; &reference.java.reference; </book> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/configure.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/configure.xml +++ phpdoc-de/reference/java/configure.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.10 Maintainer: hholzgra Status: ready --> <section xml:id="java.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> &reftitle.install; <para> &pecl.moved; <!-- Not yet available &pecl.info; <link xlink:href="&url.pecl.package;java">&url.pecl.package;java</link>. --> </para> <para> &pecl.source.4; Um diese Extension zu nutzen müssen Sie PHP mit Java Unterstützung kompilieren. Hierzu benötigen Sie die Option <option role="configure" >--with-java[=DIR]</option>, wobei DIR dem Installationsverzeichnis Ihres JDK entspricht. Weitere Installationsanweisungen finden Sie in <filename>php-src/ext/java/README</filename>. </para> <para> Windos Benutzer können <filename>php_java.dll</filename> in Ihrer &php.ini; einbinden um diese Extension zu nutzen. &pecl.windows.4; &pecl.windows.download; </para> <note> <para> Um diese Extension unter Windows mit PHP <=4.0.6 zu aktivieren muss <filename>jvm.dll</filename> über den System-PATH gefunden werden können. Für PHP > 4.0.6 wird keine zusätzliche DLL mehr benötigt. </para> </note> </section> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/constants.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/constants.xml +++ phpdoc-de/reference/java/constants.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.16 Maintainer: hholzgra Status: ready --> <appendix xml:id="java.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> &reftitle.constants; &no.constants; </appendix> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/examples.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/examples.xml +++ phpdoc-de/reference/java/examples.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: hholzgra Status: ready --> <chapter xml:id="java.examples" xmlns="http://docbook.org/ns/docbook"> &reftitle.examples; <section xml:id="java.examples-basic"> <para> <example> <title>Java Beispiel</title> <programlisting role="php"> <![CDATA[ <?php // Instanziere Java Klasse java.lang.System in PHP $system = new Java('java.lang.System'); // Beispiele für Propertyzugriffe echo 'Java version=' . $system->getProperty('java.version') . '<br />'; echo 'Java vendor=' . $system->getProperty('java.vendor') . '<br />'; echo 'OS=' . $system->getProperty('os.name') . ' ' . $system->getProperty('os.version') . ' on ' . $system->getProperty('os.arch') . ' <br />'; // java.util.Date example $formatter = new Java('java.text.SimpleDateFormat', "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz"); echo $formatter->format(new Java('java.util.Date')); ?> ]]> </programlisting> </example> <example> <title>AWT Example</title> <programlisting role="php"> <![CDATA[ <?php // This example is only intended to be run as a CGI. $frame = new Java('java.awt.Frame', 'PHP'); $button = new Java('java.awt.Button', 'Hello Java World!'); $frame->add('North', $button); $frame->validate(); $frame->pack(); $frame->visible = True; $thread = new Java('java.lang.Thread'); $thread->sleep(10000); $frame->dispose(); ?> ]]> </programlisting> </example> Notes: <itemizedlist> <listitem> <simpara> <literal>new Java()</literal> will create an instance of a class if a suitable constructor is available. If no parameters are passed and the default constructor is useful as it provides access to classes like <literal>java.lang.System</literal> which expose most of their functionallity through static methods. </simpara> </listitem> <listitem> <simpara> Accessing a member of an instance will first look for bean properties then public fields. In other words, <literal>print $date.time</literal> will first attempt to be resolved as <literal>$date.getTime()</literal>, then as <literal>$date.time</literal>. </simpara> </listitem> <listitem> <simpara> Both static and instance members can be accessed on an object with the same syntax. Furthermore, if the java object is of type <literal>java.lang.Class</literal>, then static members of the class (fields and methods) can be accessed. </simpara> </listitem> <listitem> <para> Exceptions raised result in PHP warnings, and &null; results. The warnings may be eliminated by prefixing the method call with an "@" sign. The following APIs may be used to retrieve and reset the last error: <itemizedlist> <listitem><simpara><function>java_last_exception_get</function></simpara></listitem> <listitem><simpara><function>java_last_exception_clear</function></simpara></listitem> </itemizedlist> </para> </listitem> <listitem> <simpara> Overload resolution is in general a hard problem given the differences in types between the two languages. The PHP Java extension employs a simple, but fairly effective, metric for determining which overload is the best match. </simpara> <simpara> Additionally, method names in PHP are not case sensitive, potentially increasing the number of overloads to select from. </simpara> <simpara> Once a method is selected, the parameters are coerced if necessary, possibly with a loss of data (example: double precision floating point numbers will be converted to boolean). <!-- FIXME Why aren't java-doubles converted to PHP-floats? Is this correct? --> </simpara> </listitem> <listitem> <simpara> In the tradition of PHP, arrays and hashtables may pretty much be used interchangably. Note that hashtables in PHP may only be indexed by integers or strings; and that arrays of primitive types in Java can not be sparse. Also note that these constructs are passed by value, so may be expensive in terms of memory and time. </simpara> </listitem> </itemizedlist> </para> </section> </chapter> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/ini.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/ini.xml +++ phpdoc-de/reference/java/ini.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: hholzgra Status: ready --> <section xml:id="java.configuration" xmlns="http://docbook.org/ns/docbook"> &reftitle.runtime; &extension.runtime; <para> <table> <title>Java Konfigurationsoptionen/title> <tgroup cols="4"> <thead> <row> <entry>Name</entry> <entry>Standard</entry> <entry>Ãnderbar</entry> <entry>Kommentar</entry> </row> </thead> <tbody> <row> <entry>java.class.path</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> <entry></entry> </row> <row> <entry>java.home</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> <entry></entry> </row> <row> <entry>java.library.path</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> <entry></entry> </row> <row> <entry>java.library</entry> <entry>JAVALIB</entry> <entry>PHP_INI_ALL</entry> <entry></entry> </row> </tbody> </tgroup> </table> &ini.php.constants; </para> </section> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/setup.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/setup.xml +++ phpdoc-de/reference/java/setup.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.12 Maintainer: hholzgra Status: ready --> <chapter xml:id="java.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> &reftitle.setup; <!-- {{{ Requirements --> <section xml:id="java.requirements"> &reftitle.required; <para> Sie benötigen eine installierte Java Virtual Machine auf ihrem System um diese Extension zu nutzen. </para> </section> <!-- }}} --> <!-- {{{ Installation --> &reference.java.configure; <!-- }}} --> <!-- {{{ Configuration --> &reference.java.ini; <!-- }}} --> <!-- {{{ Resources --> <section xml:id="java.resources"> &reftitle.resources; &no.resource; </section> <!-- }}} --> </chapter> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/reference.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc-de/reference/java/reference.xml diff -u /dev/null phpdoc-de/reference/java/reference.xml:1.9 --- /dev/null Mon Mar 17 20:36:40 2008 +++ phpdoc-de/reference/java/reference.xml Mon Mar 17 20:36:40 2008 @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.16 Maintainer: hholzgra Status: ready --> + +<reference xml:id="ref.java" xmlns="http://docbook.org/ns/docbook"> + <title>PHP / Java Integration</title> + + &reference.java.entities.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 +indent-tabs-mode:nil +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/phpdoc-de/reference/java/functions/java-last-exception-clear.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-de/reference/java/functions/java-last-exception-clear.xml diff -u phpdoc-de/reference/java/functions/java-last-exception-clear.xml:1.5 phpdoc-de/reference/java/functions/java-last-exception-clear.xml:1.6 --- phpdoc-de/reference/java/functions/java-last-exception-clear.xml:1.5 Sat Jun 23 13:21:38 2007 +++ phpdoc-de/reference/java/functions/java-last-exception-clear.xml Mon Mar 17 20:36:40 2008 @@ -1,19 +1,44 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready --> - <refentry xml:id="function.java-last-exception-clear" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>java_last_exception_clear</refname> - <refpurpose>Letzte Java Exception freigeben</refpurpose> - </refnamediv> - <refsect1> - <title>Beschreibung</title> - <methodsynopsis> - <type>void</type><methodname>java_last_exception_clear</methodname> - <void/> - </methodsynopsis> - </refsect1> - </refentry> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.8 Maintainer: hholzgra Status: ready --> + +<refentry xml:id="function.java-last-exception-clear" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>java_last_exception_clear</refname> + <refpurpose>Löscht die letzte aufgetretene Java Exception</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>void</type><methodname>java_last_exception_clear</methodname> + <void/> + </methodsynopsis> + <para> + Löscht die letzte aufgetretene Java Exception. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.void; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + Ein Beispiel findet sich in <function>java_last_exception_get</function>. + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &warn.experimental.func; + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc-de/reference/java/functions/java-last-exception-get.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-de/reference/java/functions/java-last-exception-get.xml diff -u phpdoc-de/reference/java/functions/java-last-exception-get.xml:1.6 phpdoc-de/reference/java/functions/java-last-exception-get.xml:1.7 --- phpdoc-de/reference/java/functions/java-last-exception-get.xml:1.6 Mon Oct 1 16:05:03 2007 +++ phpdoc-de/reference/java/functions/java-last-exception-get.xml Mon Mar 17 20:36:40 2008 @@ -1,48 +1,73 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready --> - <refentry xml:id="function.java-last-exception-get" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>java_last_exception_get</refname> - <refpurpose>Letzte Java Exception holen</refpurpose> - </refnamediv> - <refsect1> - <title>Beschreibung</title> - <methodsynopsis> - <type>exception</type><methodname>java_last_exception_get</methodname> - <void/> - </methodsynopsis> - <para> - Das nachstehende Beispiel demonstriert die Verarbeitung von Java Exceptions - aus PHP heraus: - - <example> - <title>Verarbeitung von Java Exceptions</title> - <programlisting role="php"> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.11 Maintainer: hholzgra Status: ready --> + +<refentry xml:id="function.java-last-exception-get" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>java_last_exception_get</refname> + <refpurpose>Liefert die zuletzt aufgetretene Java Exception</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>object</type><methodname>java_last_exception_get</methodname> + <void/> + </methodsynopsis> + <para> + Liefert die zuletzt aufgetretene Java Exception. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Gibt ein Exception Objekt zurück. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + Das folgende Beispiel zeigt die Nutzung des Java + Exception Handlers aus PHP heraus. + <example> + <title>Java Exception Handler</title> + <programlisting role="php"> <![CDATA[ <?php - $stack = new Java('java.util.Stack'); - $stack->push(1); +$stack = new Java('java.util.Stack'); +$stack->push(1); - // Sollte funktionieren - $result = $stack->pop(); - $ex = java_last_exception_get(); - if (!$ex) print "$result\n"; - - // Sollte nicht funktionieren (Fehler mit @ unterdrückt) - $result = @$stack->pop(); - $ex = java_last_exception_get(); - if ($ex) print $ex->toString(); +// Das folgende sollte funktionieren +$result = $stack->pop(); +$ex = java_last_exception_get(); +if (!$ex) { + echo "$result\n"; +} - // Exception freigeben - java_last_exception_clear(); +// Das folgende sollte fehlschlagen (Fehler durch @ unterdrückt) +$result = @$stack->pop(); +$ex = java_last_exception_get(); +if ($ex) { + echo $ex->toString(); +} + +// Letzte Exception löschen +java_last_exception_clear(); ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &warn.experimental.func; + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc-de/reference/java/book.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/book.xml +++ phpdoc-de/reference/java/book.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: hholzgra Status: ready --> <!-- Purpose: remote.other --> <!-- Membership: pecl, external --> <!-- State: experimental --> <book xml:id="book.java" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Java</title> <!-- {{{ preface --> <preface xml:id="intro.java"> &reftitle.intro; <para> Es gibt zwei verschiedene Möglichkeiten um PHP mit Java zu verbinden: Sie können entweder <link linkend="java.servlet">PHP in eine Java Servlet Umgebung integrieren</link>, was die stabilere und effizientere Lösung ist, oder Sie können Java Unterstützung in PHP integrieren. Ersteres wird durch ein SAPI Modul ermöglicht das die Verbindung zum Servlet Server herstellt, letzteres über die hier vorgestellte Java Extension. </para> <para> Die Java Extension bietet ein einfaches und effektives mittel für das Erzeugen von Java Objekten und für Methodenaufrufe aus Java heraus. Die JVM wird über das JNI Interface erzeugt und läuft innerhalb des PHP Prozesses. </para> &warn.experimental; </preface> <!-- }}} --> &reference.java.setup; &reference.java.constants; &reference.java.servlet; &reference.java.examples; &reference.java.reference; </book> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/configure.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/configure.xml +++ phpdoc-de/reference/java/configure.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.10 Maintainer: hholzgra Status: ready --> <section xml:id="java.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> &reftitle.install; <para> &pecl.moved; <!-- Not yet available &pecl.info; <link xlink:href="&url.pecl.package;java">&url.pecl.package;java</link>. --> </para> <para> &pecl.source.4; Um diese Extension zu nutzen müssen Sie PHP mit Java Unterstützung kompilieren. Hierzu benötigen Sie die Option <option role="configure" >--with-java[=DIR]</option>, wobei DIR dem Installationsverzeichnis Ihres JDK entspricht. Weitere Installationsanweisungen finden Sie in <filename>php-src/ext/java/README</filename>. </para> <para> Windos Benutzer können <filename>php_java.dll</filename> in Ihrer &php.ini; einbinden um diese Extension zu nutzen. &pecl.windows.4; &pecl.windows.download; </para> <note> <para> Um diese Extension unter Windows mit PHP <=4.0.6 zu aktivieren muss <filename>jvm.dll</filename> über den System-PATH gefunden werden können. Für PHP > 4.0.6 wird keine zusätzliche DLL mehr benötigt. </para> </note> </section> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/constants.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/constants.xml +++ phpdoc-de/reference/java/constants.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.16 Maintainer: hholzgra Status: ready --> <appendix xml:id="java.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> &reftitle.constants; &no.constants; </appendix> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/examples.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/examples.xml +++ phpdoc-de/reference/java/examples.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: hholzgra Status: ready --> <chapter xml:id="java.examples" xmlns="http://docbook.org/ns/docbook"> &reftitle.examples; <section xml:id="java.examples-basic"> <para> <example> <title>Java Beispiel</title> <programlisting role="php"> <![CDATA[ <?php // Instanziere Java Klasse java.lang.System in PHP $system = new Java('java.lang.System'); // Beispiele für Propertyzugriffe echo 'Java version=' . $system->getProperty('java.version') . '<br />'; echo 'Java vendor=' . $system->getProperty('java.vendor') . '<br />'; echo 'OS=' . $system->getProperty('os.name') . ' ' . $system->getProperty('os.version') . ' on ' . $system->getProperty('os.arch') . ' <br />'; // java.util.Date example $formatter = new Java('java.text.SimpleDateFormat', "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz"); echo $formatter->format(new Java('java.util.Date')); ?> ]]> </programlisting> </example> <example> <title>AWT Example</title> <programlisting role="php"> <![CDATA[ <?php // This example is only intended to be run as a CGI. $frame = new Java('java.awt.Frame', 'PHP'); $button = new Java('java.awt.Button', 'Hello Java World!'); $frame->add('North', $button); $frame->validate(); $frame->pack(); $frame->visible = True; $thread = new Java('java.lang.Thread'); $thread->sleep(10000); $frame->dispose(); ?> ]]> </programlisting> </example> Notes: <itemizedlist> <listitem> <simpara> <literal>new Java()</literal> will create an instance of a class if a suitable constructor is available. If no parameters are passed and the default constructor is useful as it provides access to classes like <literal>java.lang.System</literal> which expose most of their functionallity through static methods. </simpara> </listitem> <listitem> <simpara> Accessing a member of an instance will first look for bean properties then public fields. In other words, <literal>print $date.time</literal> will first attempt to be resolved as <literal>$date.getTime()</literal>, then as <literal>$date.time</literal>. </simpara> </listitem> <listitem> <simpara> Both static and instance members can be accessed on an object with the same syntax. Furthermore, if the java object is of type <literal>java.lang.Class</literal>, then static members of the class (fields and methods) can be accessed. </simpara> </listitem> <listitem> <para> Exceptions raised result in PHP warnings, and &null; results. The warnings may be eliminated by prefixing the method call with an "@" sign. The following APIs may be used to retrieve and reset the last error: <itemizedlist> <listitem><simpara><function>java_last_exception_get</function></simpara></listitem> <listitem><simpara><function>java_last_exception_clear</function></simpara></listitem> </itemizedlist> </para> </listitem> <listitem> <simpara> Overload resolution is in general a hard problem given the differences in types between the two languages. The PHP Java extension employs a simple, but fairly effective, metric for determining which overload is the best match. </simpara> <simpara> Additionally, method names in PHP are not case sensitive, potentially increasing the number of overloads to select from. </simpara> <simpara> Once a method is selected, the parameters are coerced if necessary, possibly with a loss of data (example: double precision floating point numbers will be converted to boolean). <!-- FIXME Why aren't java-doubles converted to PHP-floats? Is this correct? --> </simpara> </listitem> <listitem> <simpara> In the tradition of PHP, arrays and hashtables may pretty much be used interchangably. Note that hashtables in PHP may only be indexed by integers or strings; and that arrays of primitive types in Java can not be sparse. Also note that these constructs are passed by value, so may be expensive in terms of memory and time. </simpara> </listitem> </itemizedlist> </para> </section> </chapter> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/ini.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/ini.xml +++ phpdoc-de/reference/java/ini.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: hholzgra Status: ready --> <section xml:id="java.configuration" xmlns="http://docbook.org/ns/docbook"> &reftitle.runtime; &extension.runtime; <para> <table> <title>Java Konfigurationsoptionen/title> <tgroup cols="4"> <thead> <row> <entry>Name</entry> <entry>Standard</entry> <entry>Ãnderbar</entry> <entry>Kommentar</entry> </row> </thead> <tbody> <row> <entry>java.class.path</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> <entry></entry> </row> <row> <entry>java.home</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> <entry></entry> </row> <row> <entry>java.library.path</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> <entry></entry> </row> <row> <entry>java.library</entry> <entry>JAVALIB</entry> <entry>PHP_INI_ALL</entry> <entry></entry> </row> </tbody> </tgroup> </table> &ini.php.constants; </para> </section> <!-- 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 indent-tabs-mode:nil 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/phpdoc-de/reference/java/setup.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/java/setup.xml +++ phpdoc-de/reference/java/setup.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.12 Maintainer: hholzgra Status: ready --> <chapter xml:id="java.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> &reftitle.setup; <!-- {{{ Requirements --> <section xml:id="java.requirements"> &reftitle.required; <para> Sie benötigen eine installierte Java Virtual Machine auf ihrem System um diese Extension zu nutzen. </para> </section> <!-- }}} --> <!-- {{{ Installation --> &reference.java.configure; <!-- }}} --> <!-- {{{ Configuration --> &reference.java.ini; <!-- }}} --> <!-- {{{ Resources --> <section xml:id="java.resources"> &reftitle.resources; &no.resource; </section> <!-- }}} --> </chapter> <!-- 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 indent-tabs-mode:nil 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 -->