Re: Implementing fdopen in PHP
| From: | Arnaud Le Blanc | Date: | Mon, 15 Mar 2010 18:16:27 +0000 |
| Subject: | Re: Implementing fdopen in PHP | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-47292@lists.php.net to get a copy of this message | ||
Le dimanche 14 mars 2010 à 17:38 +1100, Dennis Hotson a écrit :
> Hi all,
>
> It's my first post, so go easy on me. :-)
>
> I'm trying to implement PHP support for github's erlang RPC server called
> ernie.
> So basically I've been porting the following ruby code to PHP:
> http://github.com/mojombo/ernie/blob/master/lib/ernie.rb
>
> The problem I'm having is on line 127-128:
> input = IO.new(3)
>
> I believe this is equivalent to fdopen() in C, but there doesn't appear to
> be any way to do this in PHP.
>
> So basically, I'm a bit stuck and looking for advice on how to proceed.
> Should I implement this in core PHP or as an extension? What's the best way
> to get a function like this into PHP?
Hi,
I guess that this can go to some future PHP release, and in a small
extension if you want to have it in current / older versions too. You
can implement it with php_stream_fopen_from_fd().
Regards,