Zend Java Bridge - PHP API
Table of Contents
- JavaException - The JavaException class
- Zend Java Bridge functions
- java - Creates a Java object
- java_last_exception_get - Returns a Java exception object for the last exception that occurred in the script: only the last exception is stored by the Java Bridge
- java_last_exception_clear - Clears the last Java exception object record from the Java Bridge storage
- java_set_ignore_case - Sets the case sensitivity for Java calls when there are mixed cases in your PHP script
- java_throw_exceptions - Controls if exceptions are thrown on Java exception. When an exception is thrown by a Java application, this function controls if the exception caught by the PHP code will continue to be thrown or not (if not, it is stored in the Java Bridge's internal memory)
- java_set_encoding - Sets encoding for strings received by Java from the PHP code to verify that the encoding is the same in the PHP and Java code
- java_require - Includes an additional CLASSPATH/JAR in a PHP script context
- java_reload - Reloads Jar files that were dynamically loaded - on demand
PHP Functions
java
Creates a Java object
Available since version 3.6
Description
object java (string $class_name [ , ... ])
Parameters
- class_name
- Class name to create
- ...
- Additional arguments are treated as constructor parameters
Return Value
The Java object that was created, NULL otherwise
java_last_exception_get
Returns a Java exception object for the last exception that occurred in the script: only the last exception is stored by the Java Bridge
Available since version 3.6
Description
object java_last_exception_get (void)
Return Value
Java exception object, if there was an exception, NULL otherwise
java_last_exception_clear
Clears the last Java exception object record from the Java Bridge storage
Available since version 3.6
Description
void java_last_exception_clear (void)
java_set_ignore_case
Sets the case sensitivity for Java calls when there are mixed cases in your PHP script
Available since version 3.6
Description
void java_set_ignore_case (boolean $ignore)
Parameters
- ignore
- If set, the Java attribute and method names are resolved, regardless of case
java_throw_exceptions
Controls if exceptions are thrown on Java exception. When an exception is thrown by a Java application, this function controls if the exception caught by the PHP code will continue to be thrown or not (if not, it is stored in the Java Bridge's internal memory)
Available since version 3.6
Description
void java_throw_exceptions (int $throw)
Parameters
- throw
- If true, a PHP exception is thrown when a Java exception happens. If set to FALSE, use java_last_exception_get() to check for exceptions
java_set_encoding
Sets encoding for strings received by Java from the PHP code to verify that the encoding is the same in the PHP and Java code
Available since version 3.6
Description
void java_set_encoding ([ string $encoding = UTF-8 ])
Parameters
- encoding
- Default encoding type is UTF-8. The default value is UTF-8
java_require
Includes an additional CLASSPATH/JAR in a PHP script context
Available since version 3.6
Description
void java_require (string $path)
Parameters
- path
- URL pointing to the location of the Jar file. This function accepts the following protocols: <br> https://, http://, file://, ftp:// <br> It can also be a local path: E.g., c:\
java_reload
Reloads Jar files that were dynamically loaded - on demand
Available since version 3.6
Description
void java_reload (string $new_jarpath)
Parameters
- new_jarpath
- The path to the Jar files