1. Java module of php
The php release contains a Java extension module that can be used to call Java objects. For example:
<? Php
$ System = new Java ("java. lang. System ");
Print "Java version =". $ system-> getProperty ("java. version ")."
";
?>
2. Implementation of the mini J2EE Application Server SJOP Protocol
The main purpose of implementing the sjop protocol on the minij2ee application server is to enable php to access EJB enterprise components. Therefore, minij2ee provides a EJB-PHP compiler that can compile EJB components into php classes, this allows php programs to conveniently call EJB components, for example:
<? Php
Require ("Cart. php"); // Cart. php is the php class definition of Cart EJB generated after the Cart EJB is compiled.
.
$ Home = new CartHome (); // create the Home interface of EJB.
$ Objref = $ home-> create ($ cart_name); // create a Cart EJB.
$ Cart = new Cart ($ objref );
$ Cart-> add ("some goods"); // add an item to the cart.