Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64476 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87932 invoked from network); 2 Jan 2013 16:05:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2013 16:05:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.43 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.43 mail-oa0-f43.google.com Received: from [209.85.219.43] ([209.85.219.43:54922] helo=mail-oa0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/58-12868-1DA54E05 for ; Wed, 02 Jan 2013 11:05:37 -0500 Received: by mail-oa0-f43.google.com with SMTP id k1so13092365oag.2 for ; Wed, 02 Jan 2013 08:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7FIrP2Npce0Z1G25CKpUDCsiVNAUevMR3LMWN0lt4ao=; b=cYaEtCAfH9oGqwkTUyhiza13xVxUXF4oKbsFTGc7XXeN64IzGo7/2xBtVk8d7Lcimi HfRWrEZiWo7hpfn85trLwXOovXEZ7iXoUTUJbfw75PLAyY/ztCMih9cLN/FqnESUplhs g1ISnzuGUVVg/eCuhrKScsSo2aAIcg8tyPz5hCqzXSeNFQbEiWva/ghu0HbX6w6L8XEy Bpgw9KcCHaFPsI8Z0HGItdnRjMeGhcLZR2GH6E/b3vvN/18FXPbAQffgPVtCRWRg67k4 2awuFPze2jiA7mhm5ZF+8BP2fG3eJ8UKzr+bVmgLjMXS2nVJn4lSOCsgMnEQQDyRNC4x uwDg== MIME-Version: 1.0 Received: by 10.182.194.2 with SMTP id hs2mr37343572obc.97.1357142735134; Wed, 02 Jan 2013 08:05:35 -0800 (PST) Received: by 10.76.82.234 with HTTP; Wed, 2 Jan 2013 08:05:35 -0800 (PST) In-Reply-To: References: <4F5C5540.8010204@sugarcrm.com> <4F5D3569.8050307@sugarcrm.com> <50DE4A01.8050006@sugarcrm.com> <50E3DEA8.3090509@sugarcrm.com> Date: Wed, 2 Jan 2013 09:05:35 -0700 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: Stas Malyshev , Pierrick Charron , Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] CURL file posting From: morrison.levi@gmail.com (Levi Morrison) On Wed, Jan 2, 2013 at 8:39 AM, Johannes Schl=FCter wrote: > Stas Malyshev wrote: > >I'm thinking maybe the best solution is to have a new class - say, > >CurlFile - and do this: > > > >$file =3D new CurlFile("myface.png", "image/png"); > >curl_setopt($ch, CURLOPT_POSTFIELDS, array("foo" =3D> "bar", "picture" = =3D> > >$file); > > What I wonder about in this thread: If we struggle here why not take the > full step and abstract curl details comletely away and provide something > like pecl/http by default instead? Personally I've always hated using the cURL API in PHP and would love to see a solid implementation included by default, but I would guess that the general consensus would be that it could/should be done in user-land. Anyone know if Guzzle (http://guzzlephp.org/) handles this? I know it's a popular HTTP client for PHP and is included in the Amazon Web Service SDK (https://github.com/aws/aws-sdk-php).