Jan Wieck wrote:
> I had been briefly talking with Marcus Boerger (included in CC) from the
> PHP team about it. He knows the PHP5 SAPI embed well. Can you include
> him into the team (if not already)?
Sure!
> From what I know about this SAPI I think the PL/Tcl implementation
> would be a good point to start from, as it looks very similar with
> respect to the possibilities.
I was going to start from PL/R, which is a descendent of PL/Tcl --
reason being, in PL/R I've already got SRF/table-function support and
polymorphic argument/return-type support working. Also, I've done a fair
amount of work to preserve arrays and composite types as they move
back-and-forth.
My plan is to add a few missing things to PL/R over the next couple (or
so) weeks, and then start PL/PHP from that:
1) Cache lookup based on function oid and argument signature ala the patch I recently sent in (and improved by Tom)
forPL/pgSQL -- this is needed to properly support polymorphic arguments.
2) Trigger support -- just haven't needed this so far, but we'll want it in PL/PHP, so I may as well add it to PL/R
too.
3) Re-add nested error handling -- I removed this from PL/R early on just to simplify life. Should be easy to drop
backin.
I've read some examples posted regarding the PHP embed SAPI, and it
looks very similar to the R interpreter also. It should be fairly easy
to drop the PHP embed calls in for the libR calls. The bulk of the work
will be in modifying the data conversion functions that map Postgres
composite types and arrays to similar structures in PHP.
Help on the PHP side of things would be most appreciated, because that's
the part I'm least familiar with.
Joe