Merge pull request #623 from zachborboa/621

Fix use of undefined constant STDERR
This commit is contained in:
Zach Borboa
2020-02-21 08:37:55 -08:00
committed by GitHub
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -288,7 +288,7 @@ Curl::setXmlDecoder($mixed)
Curl::success($callback)
Curl::unsetHeader($key)
Curl::unsetProxy()
Curl::verbose($on = true, $output = STDERR)
Curl::verbose($on = true, $output = 'STDERR')
MultiCurl::__construct($base_url = null)
MultiCurl::__destruct()
MultiCurl::addCurl(Curl $curl)
+8 -1
View File
@@ -1296,8 +1296,15 @@ class Curl
* @param bool $on
* @param resource $output
*/
public function verbose($on = true, $output = STDERR)
public function verbose($on = true, $output = 'STDERR')
{
if ($output === 'STDERR') {
if (!defined('STDERR')) {
define('STDERR', fopen('php://stderr', 'wb'));
}
$output = STDERR;
}
// Turn off CURLINFO_HEADER_OUT for verbose to work. This has the side
// effect of causing Curl::requestHeaders to be empty.
if ($on) {