FOF30\Download\Adapter\Curl::reponseHeaderCallback PHP Méthode

reponseHeaderCallback() protected méthode

Handles the HTTP headers returned by cURL
protected reponseHeaderCallback ( resource &$ch, string &$data ) : integer
$ch resource cURL resource handle (unused)
$data string Each header line, as returned by the server
Résultat integer The length of the $data string
    protected function reponseHeaderCallback(&$ch, &$data)
    {
        $strlen = strlen($data);
        if ($strlen <= 2) {
            return $strlen;
        }
        if (substr($data, 0, 4) == 'HTTP') {
            return $strlen;
        }
        list($header, $value) = explode(': ', trim($data), 2);
        $this->headers[$header] = $value;
        return $strlen;
    }