src/StreamWrappers/Http.php
private function populateResponseHeaders()
	{
		$done = FALSE;
		$line = NULL;
		$header = '';
		$buffer = NULL;

		// When using a file stream.
		if ( $this->resourceType === static::RESOURCE_TYPE_FILE ) {
			$done = \feof( $this->resource );
		}

		// Read the headers from the resource.
		while ( !$done )
		{
			$buffer = $this->readFromResource( 1 );
			// Update stream
			$this->content .= $buffer;
			$header = \strstr( $this->content, "\r\n\r\n", TRUE );
			// When you reach the end of the header, then exit the loop.
			if ( $buffer === '' || $header !== FALSE )
			{
				break;
			}
		}

		// Update cursor position.
		$this->position += \strlen( $this->content );
		// Parse header.
		if ( strlen(trim($header)) > 0 )
		{
			// Set header
			$this->wrapperData = explode( "\r\n", $header );
		}
	}
private function populateResponseHeaders()
	{
		$done = FALSE;
		$line = NULL;
		$header = '';
		$buffer = NULL;

		// When using a file stream.
		if ( $this->resourceType === static::RESOURCE_TYPE_FILE ) {
			$done = \feof( $this->resource );
		}

		// Read the headers from the resource.
		while ( !$done )
		{
			$buffer = $this->readFromResource( 1 );
			// Update stream
			$this->content .= $buffer;
			$header = \strstr( $this->content, "\r\n\r\n", TRUE );
			// When you reach the end of the header, then exit the loop.
			if ( $buffer === '' || $header !== FALSE )
			{
				break;
			}
		}

		// Update cursor position.
		$this->position += \strlen( $this->content );
		// Parse header.
		if ( strlen(trim($header)) > 0 )
		{
			// Set header
			$this->wrapperData = explode( "\r\n", $header );
		}
	}
private function populateResponseHeaders ( ) { $ done = FALSE ; $ line = NULL ; $ header = '' ; $ buffer = NULL ; // When using a file stream. if ( $ this -> resourceType === static :: RESOURCE_TYPE_FILE ) { $ done = \ feof ( $ this -> resource ) ; } // Read the headers from the resource. while ( ! $ done ) { $ buffer = $ this -> readFromResource ( 1 ) ; // Update stream $ this -> content .= $ buffer ; $ header = \ strstr ( $ this -> content , "\r\n\r\n" , TRUE ) ; // When you reach the end of the header, then exit the loop. if ( $ buffer === '' || $ header !== FALSE ) { break ; } } // Update cursor position. $ this -> position += \ strlen ( $ this -> content ) ; // Parse header. if ( strlen ( trim ( $ header ) ) > 0 ) { // Set header $ this -> wrapperData = explode ( "\r\n" , $ header ) ; } }
Parse the content for the headers.
Parse the content for the headers .