Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65535 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15634 invoked from network); 31 Jan 2013 11:04:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2013 11:04:28 -0000 Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:46563] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 62/83-09318-BBF4A015 for ; Thu, 31 Jan 2013 06:04:27 -0500 Received: from Hwhost2.local (adsl-84-227-209-114.adslplus.ch [84.227.209.114]) by host1.trois-doubles.net (Postfix) with ESMTPSA id 190E220AC10 for ; Thu, 31 Jan 2013 12:04:24 +0100 (CET) Message-ID: <510A4FB7.2080107@hoa-project.net> Date: Thu, 31 Jan 2013 12:04:23 +0100 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: <510A3B71.7060508@hoa-project.net> <075AE850888292488D400D9632DFE6E102400AA5@DC01.aquacool.local> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Proposal: php://memory/ (& ://temp/) From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") On 31/01/13 12:00, Sebastian Krebs wrote: > 2013/1/31 Chris Wright > >>> I propose the following syntax: >>> >>> php://memory/ >>> php://temp//maxmemory: >> I would very much like to see this as well. >> >> Would this also allow you to open multiple pointers to the same bucket= ? >> >> For example would this work? >> >> > >> $fp =3D fopen('php://memory/foo', 'w+'); >> >> file_put_contents('php://memory/foo', 'data'); >> >> rewind($fp); // would this be necessary? >> >> echo stream_get_contents($fp); // outputs 'data' >> > > Everything else wouldn't make much sense, because why else should you n= eed > to define an id for it? > > Bu whats about > > > file_put_contents('php://memory/foo', 'data'); > $fp =3D fopen('php://memory/foo', 'w+'); > > 'file_put_contents()' closes the stream after writing. I would expect, = that > the engine will cleanup the memory (at least sooner or later), but then= I > open it again. Yup, I also expect the engine to clean memory when closing php://memory=20 or php://temp, but this is another proposal I think, no? > Additional why don't you just pass the open stream around, if you need = to > access it at multiple places? Is this question for me or Chris? If it is for me, I don't want multiple = accesses to the same =93bucket=94/space, I want multiple =93buckets=94/sp= aces. Best regards. --=20 Ivan Enderlin Developer of Hoa http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/