mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-01 13:19:12 +00:00
Merge pull request #136 from zachborboa/master
Fix #134: Fix "PHP Notice: Use of undefined constant STDOUT" when reading the PHP script from stdin
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@
|
||||
"name": "Zach Borboa"
|
||||
}
|
||||
],
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"ext-curl": "*"
|
||||
|
||||
+7
-1
@@ -4,7 +4,7 @@ namespace Curl;
|
||||
|
||||
class Curl
|
||||
{
|
||||
const VERSION = '3.0.0';
|
||||
const VERSION = '3.0.1';
|
||||
const DEFAULT_TIMEOUT = 30;
|
||||
|
||||
private $cookies = array();
|
||||
@@ -133,6 +133,12 @@ class Curl
|
||||
$this->get($url);
|
||||
fclose($fh);
|
||||
|
||||
// Fix "PHP Notice: Use of undefined constant STDOUT" when reading the
|
||||
// PHP script from stdin.
|
||||
if (!defined('STDOUT')) {
|
||||
define('STDOUT', null);
|
||||
}
|
||||
|
||||
// Reset CURLOPT_FILE with STDOUT to avoid: "curl_exec(): CURLOPT_FILE
|
||||
// resource has gone away, resetting to default". Using null causes
|
||||
// "curl_setopt(): supplied argument is not a valid File-Handle
|
||||
|
||||
Reference in New Issue
Block a user