Allow specifying a buffer other than the default STDERR when using Curl::verbose().
Example usage
$buffer = fopen('php://memory', 'w+');
$curl = new Curl();
$curl->setOpt(CURLINFO_HEADER_OUT, false);
$curl->verbose(true, $buffer);
$curl->post('https://httpbin.org/get');
rewind($buffer);
$stderr = stream_get_contents($buffer);
fclose($buffer);
var_dump($stderr);
Implementation
public function verbose($on = true, $output=STDERR)
{
$this->setOpt(CURLOPT_VERBOSE, $on);
$this->setOpt(CURLOPT_STDERR, $output);
}
Allow specifying a buffer other than the default
STDERRwhen usingCurl::verbose().Example usage
Implementation