src/Chee/Module/CheeModule.php
protected function extractZip($archive, $target, $deleteSource = false)
    {
        if (!$this->files->exists($target))
        {
            $this->files->makeDirectory($target, 0777, true);
        }

        $archive = new Pclzip($archive);

        if ($archive->extract(PCLZIP_OPT_PATH, $target) == 0)
        {
            $this->errors->add('extract_zip', $archive->error_string);
            return false;
        }

        if ($deleteSource)
            $this->files->delete($archive->zipname);

        return $archive;
    }
protected function extractZip($archive, $target, $deleteSource = false)
    {
        if (!$this->files->exists($target))
        {
            $this->files->makeDirectory($target, 0777, true);
        }

        $archive = new Pclzip($archive);

        if ($archive->extract(PCLZIP_OPT_PATH, $target) == 0)
        {
            $this->errors->add('extract_zip', $archive->error_string);
            return false;
        }

        if ($deleteSource)
            $this->files->delete($archive->zipname);

        return $archive;
    }
protected function extractZip ( $ archive , $ target , $ deleteSource = false ) { if ( ! $ this -> files -> exists ( $ target ) ) { $ this -> files -> makeDirectory ( $ target , 0777 , true ) ; } $ archive = new Pclzip ( $ archive ) ; if ( $ archive -> extract ( PCLZIP_OPT_PATH , $ target ) == 0 ) { $ this -> errors -> add ( 'extract_zip' , $ archive -> error_string ) ; return false ; } if ( $ deleteSource ) $ this -> files -> delete ( $ archive -> zipname ) ; return $ archive ; }
Extract zip file

@param string $archive path of archive
@param string $target
@param bool $deleteSource
@return Chee\Pclzip\Pclzip|false
Extract zip file