mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-13 20:06:43 +00:00
Fix use of undefined constant STDERR under certain conditions.
Error message:
Use of undefined constant STDERR - assumed 'STDERR' (this will throw
an Error in a future version of PHP)
This commit is contained in:
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user