src/Tar.php
public function open($file)
    {
        $this->file = $file;

        // update compression to mach file
        if ($this->comptype == Tar::COMPRESS_AUTO) {
            $this->setCompression($this->complevel, $this->filetype($file));
        }

        // open file handles
        if ($this->comptype === Archive::COMPRESS_GZIP) {
            $this->fh = @gzopen($this->file, 'rb');
        } elseif ($this->comptype === Archive::COMPRESS_BZIP) {
            $this->fh = @bzopen($this->file, 'r');
        } else {
            $this->fh = @fopen($this->file, 'rb');
        }

        if (!$this->fh) {
            throw new ArchiveIOException('Could not open file for reading: '.$this->file);
        }
        $this->closed = false;
    }
public function open($file)
    {
        $this->file = $file;

        // update compression to mach file
        if ($this->comptype == Tar::COMPRESS_AUTO) {
            $this->setCompression($this->complevel, $this->filetype($file));
        }

        // open file handles
        if ($this->comptype === Archive::COMPRESS_GZIP) {
            $this->fh = @gzopen($this->file, 'rb');
        } elseif ($this->comptype === Archive::COMPRESS_BZIP) {
            $this->fh = @bzopen($this->file, 'r');
        } else {
            $this->fh = @fopen($this->file, 'rb');
        }

        if (!$this->fh) {
            throw new ArchiveIOException('Could not open file for reading: '.$this->file);
        }
        $this->closed = false;
    }
public function open ( $ file ) { $ this -> file = $ file ; // update compression to mach file if ( $ this -> comptype == Tar :: COMPRESS_AUTO ) { $ this -> setCompression ( $ this -> complevel , $ this -> filetype ( $ file ) ) ; } // open file handles if ( $ this -> comptype === Archive :: COMPRESS_GZIP ) { $ this -> fh = @ gzopen ( $ this -> file , 'rb' ) ; } elseif ( $ this -> comptype === Archive :: COMPRESS_BZIP ) { $ this -> fh = @ bzopen ( $ this -> file , 'r' ) ; } else { $ this -> fh = @ fopen ( $ this -> file , 'rb' ) ; } if ( ! $ this -> fh ) { throw new ArchiveIOException ( 'Could not open file for reading: ' . $ this -> file ) ; } $ this -> closed = false ; }
Open an existing TAR file for reading

@param string $file
@throws ArchiveIOException
@throws ArchiveIllegalCompressionException
Open an existing TAR file for reading