Is it possible to somehow use some of the PHP classes that come with Zend in a Java project? I’d like to think that there’s always a way, but how?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Question you should ask yourself first
First some questions you should ask your self, which could help use give you the best answer(because programming is a lot of times about trade-offs):
Can you run PHP code natively:
If it is not possible to run PHP code natively via (http/CLI) then your only option would be to try if Quercus does the job.
How much concurrency does PHP have:
Let’s assume you don’t call PHP much. Then I would consider writing a simple webservice(see below)because this is the easiest to implement. If not a PHP deamon which is running in the background waiting for work(PHP) to process which it receives from java message queue(deamon), and sends the message to queue.
If quick then a daemon would be the way to go.
But I would first advice try to implement the easiest/quickest solution and benchmark it. The quickest solution could be written in a couple of minutes. The more difficult could take some time.
Solutions:
Simple webservice:
let’s say you call http://localhost:8181/zend/doZend.php?a=a&b=b from within your Java program. This would call:
doZendfunction with function parametersa&bfrom your corresponding PHP service