protected function fetchHeaders($file) {
    $buffer = array();
    while ($header = fgets($file)) {
      $header = trim($header);
      if ($header == 'HTTP/1.1 100 Continue') {
        // Obey the command.
        continue;
      }
      if (!empty($header)) {
        $buffer[] = $header;
      }
    }
    return $buffer;
  }
protected function fetchHeaders($file) {
    $buffer = array();
    while ($header = fgets($file)) {
      $header = trim($header);
      if ($header == 'HTTP/1.1 100 Continue') {
        // Obey the command.
        continue;
      }
      if (!empty($header)) {
        $buffer[] = $header;
      }
    }
    return $buffer;
  }
protected function fetchHeaders ( $ file ) { $ buffer = array ( ) ; while ( $ header = fgets ( $ file ) ) { $ header = trim ( $ header ) ; if ( $ header == 'HTTP/1.1 100 Continue' ) { // Obey the command. continue ; } if ( ! empty ( $ header ) ) { $ buffer [ ] = $ header ; } } return $ buffer ; }
This function reads the header file into an array.

This format mataches the format returned by the stream handlers, so
we can re-use the header parsing logic in Response.

@param resource $file
A file pointer to the file that has the headers.
@retval array
@return array
An array of headers, one header per line.
This function reads the header file into an array .