From f847128cf39148c8ccfd5a31484e9fa6c3faf07a Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Thu, 12 Feb 2015 23:20:52 +0700 Subject: [PATCH] Fix "PHP Notice: Use of undefined constant STDOUT" when reading the PHP script from stdin --- src/Curl/Curl.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 0e87fc5..4b2377a 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -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