Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-05-16 Thread Alexander Moskalev
Hi! PR: https://github.com/php/php-src/pull/1283 -- With regards, Alexander Moskalev ir...@irker.net ir...@php.net a.moska...@corp.badoo.com

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-05-08 Thread Alexander Moskalev
Hi! I try rewrite feature to use exists class: https://github.com/php/php-src/commit/6319f954ca0674c77bb1f8f8409c9ac841fe301d Please, take a look at this commit. 1) constructor does not require params 2) added curl_buffer_file_create function (like curl_file_create) 3) setters changed to allow b

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-26 Thread Jakub Kubíček
Hey Alexander! 2015-04-22 10:26 GMT+02:00 Alexander Moskalev : > Jakub, I think about static factory methods, but not sure if it will be > great. > I think using empty constructor more clear. > So we can add a setter, which, however, will return $this, to allow chaining and prevent one redundan

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-24 Thread Alexey Zakhlestin
> On 23 Apr 2015, at 14:26, Alexander Moskalev wrote: > > Because currently CURLFile have this constructor: > public __construct ( > string $filename [, string $mimetype [, string $postname ]] ) > > And we cannot replace this arguments to avoid

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-23 Thread Alexander Moskalev
Because currently CURLFile have this constructor: public __construct ( string $filename [, string $mimetype [, string $postname ]] ) And we cannot replace this arguments to avoid BC break. 2015-04-23 11:59 GMT+03:00 Michael Wallner : > > On 22 Ap

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-23 Thread Alexey Zakhlestin
> On 23 Apr 2015, at 11:59, Michael Wallner wrote: > > Why not a ctor as in: > > function __construct ($filename, $buffer = null) { >if (isset ($ buffer)) { >// use $ buffer >} else { >// use file contents >} > } > > The file name parameter can be of use anyway for

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-23 Thread Michael Wallner
On 22 Apr 2015 10:27, "Alexander Moskalev" wrote: > > 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

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-22 Thread Alexander Moskalev
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 empt

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-19 Thread Jakub Kubíček
So, get directly to your questions: > > 1) Can we still integrate this functionality to existing class CURLFile? I think it would be possible, because like @smalyshev said, CURLFile represents symbolic file, that is going to be uploaded with CURL. So my suggestion would be creating a static fact

Re: [PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-18 Thread Stanislav Malyshev
Hi! > I have few questions for my pull request: > https://github.com/php/php-src/pull/1217 > > Short story: in some special cases we need to upload just created small > file(s) by CURL. For example it's autogenerated image or pdf. And libcurl > give for us this options: CURLFORM_BUFFER, CURLFORM_

[PHP-DEV] PR 1217: Add support for upload files from buffer string in curl extenion

2015-04-18 Thread Alexander Moskalev
Hi all! I have few questions for my pull request: https://github.com/php/php-src/pull/1217 Short story: in some special cases we need to upload just created small file(s) by CURL. For example it's autogenerated image or pdf. And libcurl give for us this options: CURLFORM_BUFFER, CURLFORM_BUFFERPT