# Anybody written a Java SAPI?

- Thread: https://externals.io/message/21967
- Original archive: https://news-web.php.net/php.internals/21967
- Started by Ben Trafford on 2006-02-21T10:31:16+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #21967 — Ben Trafford — 2006-02-21T10:31:16+00:00

URL: https://externals.io/message/21967#21967

Hello!

	And here I am, back with more SAPI questions. Having abandoned my earlier 
project as unworkable, I'm trying to build a MUD server in Java...and I 
want people from within the MUD server to be able to access functions 
written in PHP. Seems like an ideal situation for a SAPI.

	I've seen JSR 223 from the Java community, but it appears only be focused 
on servlets, which doesn't help me much. Basically, my requirements are 
similar to my earlier questions on the list -- I want to be able to send 
out a request, with arguments, to the PHP interpreter, and either return 
nothing or return a string to the MUD server (which is Telnet-based).

	Has anybody written a SAPI for a straight Java application? I'm just about 
ready to get started on the project, but I can't find any examples or 
documentation for anybody doing anything like this, nor any really good 
documentation on writing SAPIs. I don't think the Embed SAPI is going to 
work for my purposes, but I'm willing to be convinced otherwise.

	Just to be clear: I don't want to make PHP use Java objects; I want a Java 
application to use PHP.

	Thoughts? Pointers? Help?

	Thanks!

--->Ben

---

## #21972 — Michael Vergoz — 2006-02-21T17:15:26+00:00

URL: https://externals.io/message/21967#21972 · In reply to: #21967

Hi,

Take a look at sapi/php_embed/
You'll need a good skill in PHP engine this SAPI module is a good example.

----- Original Message ----- 
From: "Ben Trafford" <ben@prodigal.ca>
To: <internals@lists.php.net>
Sent: Tuesday, February 21, 2006 11:31 AM
Subject: [PHP-DEV] Anybody written a Java SAPI?


>
> Hello!
>
> And here I am, back with more SAPI questions. Having abandoned my earlier 
> project as unworkable, I'm trying to build a MUD server in Java...and I 
> want people from within the MUD server to be able to access functions 
> written in PHP. Seems like an ideal situation for a SAPI.
>
> I've seen JSR 223 from the Java community, but it appears only be focused 
> on servlets, which doesn't help me much. Basically, my requirements are 
> similar to my earlier questions on the list -- I want to be able to send 
> out a request, with arguments, to the PHP interpreter, and either return 
> nothing or return a string to the MUD server (which is Telnet-based).
>
> Has anybody written a SAPI for a straight Java application? I'm just about 
> ready to get started on the project, but I can't find any examples or 
> documentation for anybody doing anything like this, nor any really good 
> documentation on writing SAPIs. I don't think the Embed SAPI is going to 
> work for my purposes, but I'm willing to be convinced otherwise.
>
> Just to be clear: I don't want to make PHP use Java objects; I want a Java 
> application to use PHP.
>
> Thoughts? Pointers? Help?
>
> Thanks!
>
> --->Ben

---

## #21994 — Wez Furlong — 2006-02-24T12:13:48+00:00

URL: https://externals.io/message/21967#21994 · In reply to: #21967

We used to have a servlet sapi in the core, but it now resides in CVS
under pecl/servlet.
I don't know what the status of that is, but it might be made workable
with a little bit of effort.

--Wez.


>
>         Hello!
>
>         And here I am, back with more SAPI questions. Having abandoned my earlier
> project as unworkable, I'm trying to build a MUD server in Java...and I
> want people from within the MUD server to be able to access functions
> written in PHP. Seems like an ideal situation for a SAPI.
>
>         I've seen JSR 223 from the Java community, but it appears only be focused
> on servlets, which doesn't help me much. Basically, my requirements are
> similar to my earlier questions on the list -- I want to be able to send
> out a request, with arguments, to the PHP interpreter, and either return
> nothing or return a string to the MUD server (which is Telnet-based).
>
>         Has anybody written a SAPI for a straight Java application? I'm just about
> ready to get started on the project, but I can't find any examples or
> documentation for anybody doing anything like this, nor any really good
> documentation on writing SAPIs. I don't think the Embed SAPI is going to
> work for my purposes, but I'm willing to be convinced otherwise.
>
>         Just to be clear: I don't want to make PHP use Java objects; I want a Java
> application to use PHP.
>
>         Thoughts? Pointers? Help?
>
>         Thanks!
>
> --->Ben
