Sets debug information from last curl.

@param resource $curl Curl handle
351133
private function setDebug($curl)
    {
        $this->debug = [
            'errorNum' => curl_errno($curl),
            'error' => curl_error($curl),
            'info' => curl_getinfo($curl),
            'raw' => $this->contents,
        ];
    }
1084854
public function setDebug($debug, $handler = null)
    {
        $this->debug         = $debug;
        $this->debug_handler = $handler;
    }
602075
protected function initCurl()
    {
        if (empty($this->curl)) {
            $this->curl = curl_init();
            curl_setopt_array($this->curl, $this->curlOpts);
            $this->log->debug('cURL object initialized', $this->curlOpts);
        }
    }
128012
public function setProxy($host, $port=false)
	{
		$this->options[CURLOPT_PROXY] = $host;

		if ($port) {
			$this->options[CURLOPT_PROXYPORT] = $port;
		}
	}
1198370
protected function processCurlResponse(int $statusCode, $curlHandle)
    {
        foreach ($this->runningRequests as $index => $request) {
            if ($request->getCurl()->getHandle() === $curlHandle) {
                $this->parseResponse($request, $statusCode)
                     ->triggerCallback($request->getOnCompleteCallback(), $request);

                $this->multiCurl->removeCurl($request->getCurl());
                unset($this->runningRequests[$index]);
                break;
            }
        }
        return $this;
    }
400207
private function setOptions(&$curl, $options)
    {
        $header = [];
        foreach ($options as $key => $item) {
            switch ($key) {
                case 'timeout':
                    if (is_int($item)) {
                        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $item);
                    }
                    break;
                case 'headers':
                    if (is_array($item)) {
                        foreach ($item as $k => $v) {
                            array_push($header, $k . ': ' . $v);
                        }
                        curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
                    }
                    break;
                case 'query':
                    if (is_array($item)) {
                        $url = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL);
                        $url .= '?' . http_build_query($options['query']);
                        curl_setopt($curl, CURLOPT_URL, $url);
                    }
                    break;
                case 'data':
                    $fields = is_array($item) ? http_build_query($item) : $item;
                    array_push($header, 'Content-Length: ' . strlen($fields));
                    curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
                    curl_setopt($curl, CURLOPT_POSTFIELDS, $fields);
            }
        }
    }
847110
protected function setCurlOpts(&$curlHandle) {
        \curl_setopt($curlHandle, CURLOPT_TIMEOUT, 10);
        \curl_setopt($curlHandle, CURLOPT_URL, $this->url);
        \curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
        \curl_setopt($curlHandle, CURLOPT_VERBOSE, false);
        \curl_setopt($curlHandle, CURLOPT_HEADER, true);
        \curl_setopt($curlHandle, CURLOPT_COOKIEFILE, '/dev/null');
        \curl_setopt($curlHandle, CURLOPT_HTTPHEADER, $this->getDefaultHeader());
    }
1123532
private function __setCurlOptions($curl, array $options)
    {
        foreach ($options as $option => $value)
        {
            if (false !== curl_setopt($curl, $option, $value))
            {
                continue;
            }
            throw new ClientException(
                sprintf('Failed setting CURL option %d to %s', $option, var_export($value, true))
            );
        }
    }
581231
private function curlDelete($curl_url)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $curl_url);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_exec($ch);
        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        if ($http_code != 200) {
            throw new Exception('curlDelete responded with '.$http_code.': '.$json_result->msg);
        }

        return true;
    }
108348
public function setCurlDebugging($debug = true) {
        $this->options['debug'] = $debug;

        $this->guzzle = $this->createGuzzleClient();
    }
398293
protected function _initialize() {
        $this->_ch = curl_init();
        $this->_last_info = FALSE;
        curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($this->_ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($this->_ch, CURLOPT_TIMEOUT, 60);
        curl_setopt($this->_ch, CURLOPT_CONNECTTIMEOUT, 60);
        curl_setopt($this->_ch, CURLOPT_USERPWD, "{$this->_username}:{$this->_password}");

        return;
    }
1348747
public function setProxy($host = null, $port = null)
    {
        parent::setProxy($host, $port);

        if ($this->curl) {
            if ($this->proxyHost) {
                curl_setopt($this->curl, CURLOPT_PROXY, $this->proxyHost);
                curl_setopt($this->curl, CURLOPT_PROXYPORT, $this->proxyPort);
            } else {
                curl_setopt($this->curl, CURLOPT_PROXY, '');
            }
        }
    }
914405
public function setDebug($debug)
    {
        if(!is_resource($debug) && !is_bool($debug))
        {
            return $this;
        }

        $this->options['debug'] = $debug;
        return $this;
    }
513211
private function curlExec($curlHandle, $endPointUrl)
    {
        curl_setopt($curlHandle, CURLOPT_URL, $endPointUrl);

        if (($response = @curl_exec($curlHandle)) === false) {
            throw new \RuntimeException(
                sprintf(
                    'cURL Error (%d): %s',
                    curl_errno($curlHandle),
                    curl_error($curlHandle)
                )
            );
        }

		curl_close($curlHandle);

        $response_parts = explode("\r\n\r\n", $response);

        $content = array_pop($response_parts);

        $headers = explode("\r\n", array_pop($response_parts));

        return new Response($endPointUrl, $content, $headers);
    }
886763
private function setOpt($ch) {
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        curl_setopt($ch, CURLOPT_HEADER, FALSE);
        curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
        curl_setopt($ch, CURLOPT_USERPWD, $this->apiKey);
        curl_setopt($ch, CURLOPT_POST, TRUE);
    }
1195214
protected static function debugSet(string $key, $value): void
    {
        Debug::setCache(static::$type, 'set', $key, is_string($value) ? $value : json($value));
    }
173433
def set_debug(self, status):
        """"""
        if status:
            self.logger.setLevel('DEBUG')
        else:
            self.logger.setLevel('INFO')