Forum OpenACS Development: Re: Tcl calls from PHP?
Wow, I hadn't realized the PHP engine design was that brain-dead. Hm, if someone really needed to be able to call PHP from Tcl, would there be some relatively easy way to make that work reasonably efficiently?
Back in 2000, Jim Davidson mentioned Digital City's Proxy, which is basically a separate tclsh helper process, which can send messages back and forth to AOLserver, and which forks on demand so that the main AOLserver process doesn't have to. Seems like that sort of thing would be useful for running PHP commands as well?
The proxy mechanism would only help by not forking the AOLserver process, but it still doesn't address the issue of each PHP script evaluation means getting a fresh PHP interpreter.
However, this just occurred to me: one could write a "PHP server" -- a long-running daemon-like process written in PHP that listened on a socket, where clients would connect to it and feed it a PHP script which PHP would pass through eval() and return the result.
*shudder* I think I'm going to have nightmares now. Maybe I'll implement something like this for shits and giggles, but frankly it's Just Not Right(tm).