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:
Zach Borboa
2015-02-12 23:34:23 +07:00
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
"name": "Zach Borboa"
}
],
"version": "3.0.0",
"version": "3.0.1",
"require": {
"php": ">=5.3",
"ext-curl": "*"
+7 -1
View File
@@ -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