Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94187 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91482 invoked from network); 21 Jun 2016 23:17:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2016 23:17:55 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.220.172 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.220.172 mail-qk0-f172.google.com Received: from [209.85.220.172] ([209.85.220.172:36857] helo=mail-qk0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6F/28-43024-12BC9675 for ; Tue, 21 Jun 2016 19:17:54 -0400 Received: by mail-qk0-f172.google.com with SMTP id p10so43209056qke.3 for ; Tue, 21 Jun 2016 16:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=d4ubjOBkhGSKkmBDeC9GEHzGP3jtb8tYwaNSGi6hgao=; b=Co/i5pGZpTr42rb9t4hCcLqHdKuOLYcGLt3XHtwFAgOJXsO6FLPFnSR1g+EmVv5eYD J5/2MrP83wekcn6/Oi68D4imRe4The8Rx02mAjUwe8KwFBeDNibNnkrQqYzL3m0ErvX4 fbvlDbL3y1NKWAPVp615MKSMew/15MeXq24IZE5MPf0ai/GpgCN0Q7YuBCCYyAW40neV 1SSshfBYoMAC4bCA4QOuUDK6UYZUMZ7zoPvxctZr4EkYThOP4j+O4Y4O/71veMsEVHaH HJrs+gsVEJNS28UK7DD43TAK63tgZjMqn/6VX2fncrZyn+zNGby5pYDOiC1y95T0+Azt HqWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=d4ubjOBkhGSKkmBDeC9GEHzGP3jtb8tYwaNSGi6hgao=; b=Pn/uztsUat33I0rgGJ033+G6pjjpK957htBqJOuaerEKAZNHQWpjFeHDI4M01TNRLy l9hieUHgpvpY4xYu/p431ZcPUjelvTF6eHC0o/b5STE0mS7UB8tTi1paIGyfTPhvOBis lMO6i6UEMer1Lhl93oNEYVJhLPc+xUC1lYB9XIdY30WsnMfKnYT3mEm8sOtuKtRQGbpH tPz7V9zA5+Twa2hAdx1JL0a3p9/RCetiF/PliPAyeaRaol/Gly8bZsuTLWGko0p4srb5 w7oGUTO+rAzg0uAjFU4f/4j4nKt+QEfEeQ++hplbcXkfrxKzQoC9exqUy/QVZX/tstAh 8KQg== X-Gm-Message-State: ALyK8tLdS4p9yLsar/8W1BO5v14H89yM1m5k8UaUMszi+c3BRtg+Nr4htQyLh4yOCBoLmzFvlLbgIZ7FWxvqyiur X-Received: by 10.200.37.9 with SMTP id 9mr14279687qtm.31.1466551071221; Tue, 21 Jun 2016 16:17:51 -0700 (PDT) MIME-Version: 1.0 Sender: me@daveyshafik.com Received: by 10.237.54.225 with HTTP; Tue, 21 Jun 2016 16:17:50 -0700 (PDT) In-Reply-To: References: Date: Tue, 21 Jun 2016 16:17:50 -0700 X-Google-Sender-Auth: kfu2cYH2sgs7K4FnQzYpl9B2OFs Message-ID: To: Alexander Moskalev Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113bcc44a5889a0535d20717 Subject: Re: [PHP-DEV] Re: Send files in CURL from string From: davey@php.net (Davey Shafik) --001a113bcc44a5889a0535d20717 Content-Type: text/plain; charset=UTF-8 On Tue, Jun 21, 2016 at 2:28 PM, Alexander Moskalev wrote: > Thank you! > > 2016-06-21 23:31 GMT+03:00 Davey Shafik : > >> you can use a memory stream > > I thought about something like that. But if we created memory stream > (php://memory ?), we have file pointer resource related to this stream. And > we cannot read or write something in this stream without such file pointer > provided. > > Example code: >> >> $fp = fopen("php://memory", 'r+'); >> fputs($fp, "foo\n"); >> rewind($fp); >> echo file_get_contents("php://memory"); // <- this doesn't work, and same >> will be in curl. >> echo stream_get_contents($fp); //<- this will work > > > > Or you mean something else? > In this one case, you would be _required_ to pass in the stream handle in. All other cases would work with either the resource URL (e.g. s3://) or a stream handle. - Davey --001a113bcc44a5889a0535d20717--