API Reference Guide > Zend Java Bridge - PHP API

Zend Java Bridge - PHP API

This topic lists the PHP API functions of the Zend Java Bridge.

Table of Contents

The JavaException Class

JavaException is a PHP class that inherits from the default PHP5 class "Exception"

Available Since Version: 3.6

JavaException Functions

Function

Description

getCause

Get the Java exception that led to this exception

getCause

Get the Java exception that led to this exception

Available Since Version: 3.6

Return Value: object - A Java exception object, if there was an exception, NULL otherwise

The Java Class

a Java object

Available Since Version: 3.6

Java Functions

Function

Description

__construct

Creates a Java object

__construct

Creates a Java object

Available Since Version: 3.6

Parameter

Type

Required

Description

class_name

string

Yes

Class name to create

Return Value: object - The Java object that was created, NULL otherwise

Zend Java Bridge Functions

Function

Description

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

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

Return Value: object - 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

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

Parameter

Type

Required

Description

ignore

boolean

Yes

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

Parameter

Type

Required

Description

throw

int

Yes

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

Parameter

Type

Required

Description

encoding

string

No

Default encoding type is UTF-8

java_require

Includes an additional CLASSPATH/JAR in a PHP script context

Available Since Version: 3.6

Parameter

Type

Required

Description

path

string

Yes

URL pointing to the location of the Jar file. This function accepts the following protocols:
https://, http://, file://, ftp://
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

Parameter

Type

Required

Description

new_jarpath

string

Yes

The path to the Jar files