-
Notifications
You must be signed in to change notification settings - Fork 818
Closed
Description
$this->setOpt(CURLINFO_HEADER_OUT, true);
This code causes the php-cli mode console to output a lot of useless information,
such as * Closing connection 0
Add the following code to avoid output
$this->setOpt(CURLOPT_VERBOSE, 0); //set verbose mode off
Modify code Curl\Curl::initialize
/**
* Initialize
*
* @access public
* @param $base_url
*/
public function initialize($base_url = null)
{
$this->id = uniqid('', true);
$this->setDefaultUserAgent();
$this->setDefaultTimeout();
$this->setOpt(CURLINFO_HEADER_OUT, true);
$this->setOpt(CURLOPT_VERBOSE, 0); //set verbose mode off
// Create a placeholder to temporarily store the header callback data.
$header_callback_data = new \stdClass();
$header_callback_data->rawResponseHeaders = '';
$header_callback_data->responseCookies = array();
$this->headerCallbackData = $header_callback_data;
$this->setOpt(CURLOPT_HEADERFUNCTION, createHeaderCallback($header_callback_data));
$this->setOpt(CURLOPT_RETURNTRANSFER, true);
$this->headers = new CaseInsensitiveArray();
$this->setUrl($base_url);
}
gvlasov
Metadata
Metadata
Assignees
Labels
No labels