Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47292 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6332 invoked from network); 15 Mar 2010 18:16:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2010 18:16:38 -0000 Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.216 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 209.85.218.216 mail-bw0-f216.google.com Received: from [209.85.218.216] ([209.85.218.216:42756] helo=mail-bw0-f216.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/7D-34010-4897E9B4 for ; Mon, 15 Mar 2010 13:16:36 -0500 Received: by bwz8 with SMTP id 8so3358250bwz.23 for ; Mon, 15 Mar 2010 11:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=qBN1mLeaIzt4EyM5aEFKLlVhH3itqybhSyyA8Xh/P2w=; b=AlXXeBIJCMsn0sG0a+5zugbBPoWd08OeTnU24XT5mKwVrRIQOClu5UpDghn/pPvw4N iOF+O0fnTfEsDXhuWtfWqEbnkckTyfcWmKwilOphuHfDjbFYOSXExATQ6pSDtuXCsjt6 5z2iKZ3NhqnarHxZYB+E6C5DquYizxiDQWPTY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=kfxxr3+VslNIH2MY7k//2c3f50C3LageT4dcGkqKaRiEIjabLXe6dkkIf/LIz4aUlf EyT/BtS4OeTBPodtuQAZD3IRtDDCiTpREA6m/p4ma32pXVV+F2KD7UGB6eUY8+5ZDThD wE5sQo0o9OLIbGpKw9+1nbiNdQMltGAyVvEcI= Received: by 10.204.34.203 with SMTP id m11mr1436107bkd.173.1268676992867; Mon, 15 Mar 2010 11:16:32 -0700 (PDT) Received: from [192.168.1.10] (130-244-168-88.selfip.net [88.168.244.130]) by mx.google.com with ESMTPS id s17sm22075422bkd.10.2010.03.15.11.16.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 15 Mar 2010 11:16:31 -0700 (PDT) Sender: Arnaud LB To: Dennis Hotson Cc: internals@lists.php.net In-Reply-To: <469956791003132238p4bc841a0sd0c8a09e3ee1b084@mail.gmail.com> References: <469956791003132238p4bc841a0sd0c8a09e3ee1b084@mail.gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 15 Mar 2010 19:16:27 +0100 Message-ID: <1268676987.2945.18.camel@noch2> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Implementing fdopen in PHP From: lbarnaud@php.net (Arnaud Le Blanc) 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,