linslin\yii2\curl\Curl::_extractAdditionalCurlParameter PHP Method

_extractAdditionalCurlParameter() private method

Extract additional curl params private class helper
    private function _extractAdditionalCurlParameter()
    {
        /**
         * retrieve response code
         */
        $this->responseCode = curl_getinfo($this->_curl, CURLINFO_HTTP_CODE);
        /**
         * try extract response type & charset.
         */
        $this->responseType = curl_getinfo($this->_curl, CURLINFO_CONTENT_TYPE);
        if (!is_null($this->responseType) && count(explode(';', $this->responseType)) > 1) {
            list($this->responseType, $possibleCharset) = explode(';', $this->responseType);
            //extract charset
            if (preg_match('~^charset=(.+?)$~', trim($possibleCharset), $matches) && isset($matches[1])) {
                $this->responseCharset = strtolower($matches[1]);
            }
        }
        /**
         * try extract response length
         */
        $this->responseLength = curl_getinfo($this->_curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
        if ((int) $this->responseLength == -1) {
            $this->responseLength = strlen($this->response);
        }
    }