concrete/src/File/Service/Zip.php
protected function unzipPHP($zipFile, $destinationDirectory, array $options)
    {
        if (!class_exists('ZipArchive')) {
            throw new Exception('Unable to unzip files using ZipArchive. Please ensure the Zip extension is installed.');
        }
        $zip = new ZipArchive();
        try {
            $flags = 0;
            if (!$options['skipCheck']) {
                $flags |= ZipArchive::CHECKCONS;
            }
            $zipErr = @$zip->open($zipFile, $flags);
            if ($zipErr !== true) {
                throw new Exception($this->describeZipArchiveError($zip, $zipErr));
            }
            if (@$zip->extractTo($destinationDirectory) !== true) {
                throw new Exception($this->describeZipArchiveError($zip, ZipArchive::ER_OK));
            }
            @$zip->close();
            $zip = null;
        } catch (Exception $x) {
            if ($zip !== null) {
                try {
                    @$zip->close();
                } catch (\Exception $foo) {
                }
                $zip = null;
            }
            throw $x;
        }
    }
protected function unzipPHP($zipFile, $destinationDirectory, array $options)
    {
        if (!class_exists('ZipArchive')) {
            throw new Exception('Unable to unzip files using ZipArchive. Please ensure the Zip extension is installed.');
        }
        $zip = new ZipArchive();
        try {
            $flags = 0;
            if (!$options['skipCheck']) {
                $flags |= ZipArchive::CHECKCONS;
            }
            $zipErr = @$zip->open($zipFile, $flags);
            if ($zipErr !== true) {
                throw new Exception($this->describeZipArchiveError($zip, $zipErr));
            }
            if (@$zip->extractTo($destinationDirectory) !== true) {
                throw new Exception($this->describeZipArchiveError($zip, ZipArchive::ER_OK));
            }
            @$zip->close();
            $zip = null;
        } catch (Exception $x) {
            if ($zip !== null) {
                try {
                    @$zip->close();
                } catch (\Exception $foo) {
                }
                $zip = null;
            }
            throw $x;
        }
    }
protected function unzipPHP ( $ zipFile , $ destinationDirectory , array $ options ) { if ( ! class_exists ( 'ZipArchive' ) ) { throw new Exception ( 'Unable to unzip files using ZipArchive. Please ensure the Zip extension is installed.' ) ; } $ zip = new ZipArchive ( ) ; try { $ flags = 0 ; if ( ! $ options [ 'skipCheck' ] ) { $ flags |= ZipArchive :: CHECKCONS ; } $ zipErr = @ $ zip -> open ( $ zipFile , $ flags ) ; if ( $ zipErr !== true ) { throw new Exception ( $ this -> describeZipArchiveError ( $ zip , $ zipErr ) ) ; } if ( @ $ zip -> extractTo ( $ destinationDirectory ) !== true ) { throw new Exception ( $ this -> describeZipArchiveError ( $ zip , ZipArchive :: ER_OK ) ) ; } @ $ zip -> close ( ) ; $ zip = null ; } catch ( Exception $ x ) { if ( $ zip !== null ) { try { @ $ zip -> close ( ) ; } catch ( \ Exception $ foo ) { } $ zip = null ; } throw $ x ; } }
Decompress a ZIP archive to a directory using the PHP functions.

@param string $zipFile
@param string $destinationDirectory
@param array $options

@throws Exception
Decompress a ZIP archive to a directory using the PHP functions .