namshi / cuzzle

This library let's you dump a Guzzle request to a cURL command for debug and log purpose.
https://github.com/namshi/cuzzle
331 stars 68 forks source link

support POST/multipart Guzzle requests #1

Open cirpo opened 10 years ago

Avariya commented 8 years ago

Start to fix this problem, but can't reproduce it anymore. May you test is it still reproducible?

cirpo commented 8 years ago

@Avariya will do

Avariya commented 8 years ago

Ok. I found out that it fails at big files through multipart because of PHP max command length is 8192 at Win and 4096 at Linux. https://github.com/php/php-src/blob/master/ext/standard/exec.c#L57 So escapeshellarg first of all checks is command it needs to escape longer than max one. Need add trimming. As an idea - trim to 4000 symbols or trim platformbase

Or use self written function like:

$input = str_replace('\'', '\\\'', $input);
return '\''.$input.'\'';

What kind of pull request should I create?