Home  >  Article  >  Backend Development  >  How to use minij2ee in php

How to use minij2ee in php

藏色散人
藏色散人Original
2021-07-16 09:50:011419browse

php method of using minij2ee: first create a PHP sample file; then introduce "Cart.php"; finally call the EJB component in the php program.

How to use minij2ee in php

The operating environment of this article: Windows7 system, PHP7.1 version, DELL G3 computer

How to use minij2ee with php?

minij2ee application server SJOP protocol implementation

Before introducing the minij2ee application server SJOP protocol implementation, let’s briefly introduce the minij2ee application server. The minij2ee application server is the first J2EE application server product that supports PHP, enabling PHP to be used to develop enterprise-level application systems.

The full name of SJOP is Sample Java ORB Protocol (Simple Java Object Request Proxy Protocol), which is a simple and efficient object request proxy protocol.

For example:

<?php
$conn=minij2ee_fetch_connection();
print "Java version=".minij2ee_callstatic_javaobj($conn,"java.lang.System","getProperty","java.lang.String","java.version")." <br> ";
?>

The main purpose of the minij2ee application server to implement the SJOP protocol is to enable PHP to access EJB enterprise-level components. Therefore, minij2ee provides an EJB-PHP compiler that can convert EJB components Classes compiled into PHP enable EJB components to be conveniently called in PHP programs, for example:

<?php
require("Cart.php"); file://Cart.php是编译Cart EJB后生成的Cart EJB的php类定义。
$home=new CartHome(); file://创建EJB的Home接口。
$objref=$home->create($cart_name); file://创建Cart EJB。
$cart=new Cart($objref);
$cart->add("some goods");    file://向购物车中添加一个物品。
?>

Using the PHP support of the minij2ee application server, you can develop object-oriented and stable objects based on PHP and J2EE technology Efficient enterprise-level application system.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to use minij2ee in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn