Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85882 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77312 invoked from network); 22 Apr 2015 08:26:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2015 08:26:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=irker@irker.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=irker@irker.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain irker.net from 74.125.82.46 cause and error) X-PHP-List-Original-Sender: irker@irker.net X-Host-Fingerprint: 74.125.82.46 mail-wg0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:36371] helo=mail-wg0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/71-56941-34B57355 for ; Wed, 22 Apr 2015 04:26:45 -0400 Received: by wgen6 with SMTP id n6so23639564wge.3 for ; Wed, 22 Apr 2015 01:26:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=HcPfDn/OQOhJ6Bi1EtoZdZvbNofLKpx7a1H7Hjblwnw=; b=khFyijoPMY+JHCDZSF3w+w5FENlYO/5qH7PJxP8r4UnoEe+ZLpGS1QOWObajDPI9f5 lx824kaQzjJISqYr9k24fIe71RaCTf2GuapAETv8EvB2O42+0UEKAuLbk9PnnorLLFcT 4UwKc9wCXG+VRHWkAZ5mpt0KXe1Lb3qOSV6j0idUUj5yJZMVPJyU0N7+AFKbWO/3b9AJ YjOYkuTm91PNN9gYOfjk71vbY8xVFXrt4IVhxKFbYEdGzx+iGTpwMzwu7ld5rREcqkVX w8gz1oKGfOPa+FVgV9BZilManjiaNNtcUHgNXav9o4OTdCuUOLHRI6AASt6aEin8OEaH 9YOg== X-Gm-Message-State: ALoCoQmFmbzxMof8erxken0caeWsr/RrycXRmn1cg75HEJfWzqZefrUB6Gmuu/Z2Q9EzWw0Zkjlt X-Received: by 10.180.14.67 with SMTP id n3mr3645493wic.92.1429691200742; Wed, 22 Apr 2015 01:26:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.56.4 with HTTP; Wed, 22 Apr 2015 01:26:20 -0700 (PDT) In-Reply-To: References: <5532CE2E.1040607@gmail.com> Date: Wed, 22 Apr 2015 11:26:20 +0300 Message-ID: To: =?UTF-8?B?SmFrdWIgS3Viw63EjWVr?= Cc: Stanislav Malyshev , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d04138cd528b92c05144bece7 Subject: Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion From: irker@irker.net (Alexander Moskalev) --f46d04138cd528b92c05144bece7 Content-Type: text/plain; charset=UTF-8 Thanks to all for feedback! Let's try to integrate new feature to old class. We have constructor in CURLFile with one required parameter: $filename . To avoid BC break we cannot replace this parameter. So I suggest to do it optional and add setBuffer() method. So we can create CURLFile with empty parameters in constructor and fill it with setters. Have two more questions: 1) If we not fill all options or fille not compatible options, when we must throw error? ? And what level of this error? (Sorry, I'm just php coder and know about C language and php source so little) For file from disk(or other source) required $filename. For file from buffer required $buffer and $postname. 2) Curently CURLFile cannot be unserialized, because it contains $filename (see source code). How it compatible with our dicussion? Jakub, I think about static factory methods, but not sure if it will be great. I think using empty constructor more clear. --f46d04138cd528b92c05144bece7--