src/Gzip.php
public function getFilePosition()
	{
		// Gzipped file... unpack it first
		$position = 0;
		$info     = @ unpack('CCM/CFLG/VTime/CXFL/COS', substr($this->data, $position + 2));

		if (!$info)
		{
			throw new \RuntimeException('Unable to decompress data.');
		}

		$position += 10;

		if ($info['FLG'] & $this->flags['FEXTRA'])
		{
			$XLEN = unpack('vLength', substr($this->data, $position + 0, 2));
			$XLEN = $XLEN['Length'];
			$position += $XLEN + 2;
		}

		if ($info['FLG'] & $this->flags['FNAME'])
		{
			$filenamePos = strpos($this->data, "\x0", $position);
			$position    = $filenamePos + 1;
		}

		if ($info['FLG'] & $this->flags['FCOMMENT'])
		{
			$commentPos = strpos($this->data, "\x0", $position);
			$position   = $commentPos + 1;
		}

		if ($info['FLG'] & $this->flags['FHCRC'])
		{
			$hcrc = unpack('vCRC', substr($this->data, $position + 0, 2));
			$hcrc = $hcrc['CRC'];
			$position += 2;
		}

		return $position;
	}
public function getFilePosition()
	{
		// Gzipped file... unpack it first
		$position = 0;
		$info     = @ unpack('CCM/CFLG/VTime/CXFL/COS', substr($this->data, $position + 2));

		if (!$info)
		{
			throw new \RuntimeException('Unable to decompress data.');
		}

		$position += 10;

		if ($info['FLG'] & $this->flags['FEXTRA'])
		{
			$XLEN = unpack('vLength', substr($this->data, $position + 0, 2));
			$XLEN = $XLEN['Length'];
			$position += $XLEN + 2;
		}

		if ($info['FLG'] & $this->flags['FNAME'])
		{
			$filenamePos = strpos($this->data, "\x0", $position);
			$position    = $filenamePos + 1;
		}

		if ($info['FLG'] & $this->flags['FCOMMENT'])
		{
			$commentPos = strpos($this->data, "\x0", $position);
			$position   = $commentPos + 1;
		}

		if ($info['FLG'] & $this->flags['FHCRC'])
		{
			$hcrc = unpack('vCRC', substr($this->data, $position + 0, 2));
			$hcrc = $hcrc['CRC'];
			$position += 2;
		}

		return $position;
	}
public function getFilePosition ( ) { // Gzipped file... unpack it first $ position = 0 ; $ info = @ unpack ( 'CCM/CFLG/VTime/CXFL/COS' , substr ( $ this -> data , $ position + 2 ) ) ; if ( ! $ info ) { throw new \ RuntimeException ( 'Unable to decompress data.' ) ; } $ position += 10 ; if ( $ info [ 'FLG' ] & $ this -> flags [ 'FEXTRA' ] ) { $ XLEN = unpack ( 'vLength' , substr ( $ this -> data , $ position + 0 , 2 ) ) ; $ XLEN = $ XLEN [ 'Length' ] ; $ position += $ XLEN + 2 ; } if ( $ info [ 'FLG' ] & $ this -> flags [ 'FNAME' ] ) { $ filenamePos = strpos ( $ this -> data , "\x0" , $ position ) ; $ position = $ filenamePos + 1 ; } if ( $ info [ 'FLG' ] & $ this -> flags [ 'FCOMMENT' ] ) { $ commentPos = strpos ( $ this -> data , "\x0" , $ position ) ; $ position = $ commentPos + 1 ; } if ( $ info [ 'FLG' ] & $ this -> flags [ 'FHCRC' ] ) { $ hcrc = unpack ( 'vCRC' , substr ( $ this -> data , $ position + 0 , 2 ) ) ; $ hcrc = $ hcrc [ 'CRC' ] ; $ position += 2 ; } return $ position ; }
Get file data offset for archive

@return  integer  Data position marker for archive

@since   1.0
@throws  \RuntimeException
Get file data offset for archive