public function getDocument()
    {
        if ( feof( $this->stream ) )
        {
            return false;
        }

        $document = '';
        while ( ( ( $line = fgets( $this->stream ) ) !== false ) &&
                ( trim( $line ) !== '--' . $this->options['boundary'] ) &&
                ( trim( $line ) !== '--' . $this->options['boundary'] . '--' ) )
        {
            $document .= $line;
        }

        if ( trim( $document ) === '' )
        {
            return false;
        }

        return $this->parseDocument( ltrim( $document ) );
    }
public function getDocument()
    {
        if ( feof( $this->stream ) )
        {
            return false;
        }

        $document = '';
        while ( ( ( $line = fgets( $this->stream ) ) !== false ) &&
                ( trim( $line ) !== '--' . $this->options['boundary'] ) &&
                ( trim( $line ) !== '--' . $this->options['boundary'] . '--' ) )
        {
            $document .= $line;
        }

        if ( trim( $document ) === '' )
        {
            return false;
        }

        return $this->parseDocument( ltrim( $document ) );
    }
public function getDocument ( ) { if ( feof ( $ this -> stream ) ) { return false ; } $ document = '' ; while ( ( ( $ line = fgets ( $ this -> stream ) ) !== false ) && ( trim ( $ line ) !== '--' . $ this -> options [ 'boundary' ] ) && ( trim ( $ line ) !== '--' . $ this -> options [ 'boundary' ] . '--' ) ) { $ document .= $ line ; } if ( trim ( $ document ) === '' ) { return false ; } return $ this -> parseDocument ( ltrim ( $ document ) ) ; }
Get document from stream

Get the (next) document from the stream. Will return an array with the
document properties and their values (like Content-Type), as well as an
'body' index, which contains the actual contents of the document.

Returns false, if the stream has ended or no document definition could
be found.

@return mixed
Get document from stream