concrete/src/File/Service/Zip.php
public function unzip($zipFile, $destinationDirectory, array $options = [])
    {
        $fs = $this->getFilesystem();
        $normalized = @realpath($zipFile);
        if ($normalized === false || !$fs->isFile($normalized)) {
            throw new Exception(t('Unable to find the ZIP file %s', $zipFile));
        }
        $zipFile = str_replace(DIRECTORY_SEPARATOR, '/', $normalized);
        $normalized = @realpath($destinationDirectory);
        if ($normalized === false || !$fs->isDirectory($normalized)) {
            throw new Exception(t('Unable to find the directory %s', $destinationDirectory));
        }
        if (!$fs->isWritable($normalized)) {
            throw new Exception(t('The directory "%s" is not writable', $destinationDirectory));
        }
        $destinationDirectory = str_replace(DIRECTORY_SEPARATOR, '/', $normalized);
        $options += [
            'skipCheck' => false,
        ];
        if ($this->mayUseNativeCommand('unzip')) {
            $this->unzipNative($zipFile, $destinationDirectory, $options);
        } else {
            $this->unzipPHP($zipFile, $destinationDirectory, $options);
        }
    }
public function unzip($zipFile, $destinationDirectory, array $options = [])
    {
        $fs = $this->getFilesystem();
        $normalized = @realpath($zipFile);
        if ($normalized === false || !$fs->isFile($normalized)) {
            throw new Exception(t('Unable to find the ZIP file %s', $zipFile));
        }
        $zipFile = str_replace(DIRECTORY_SEPARATOR, '/', $normalized);
        $normalized = @realpath($destinationDirectory);
        if ($normalized === false || !$fs->isDirectory($normalized)) {
            throw new Exception(t('Unable to find the directory %s', $destinationDirectory));
        }
        if (!$fs->isWritable($normalized)) {
            throw new Exception(t('The directory "%s" is not writable', $destinationDirectory));
        }
        $destinationDirectory = str_replace(DIRECTORY_SEPARATOR, '/', $normalized);
        $options += [
            'skipCheck' => false,
        ];
        if ($this->mayUseNativeCommand('unzip')) {
            $this->unzipNative($zipFile, $destinationDirectory, $options);
        } else {
            $this->unzipPHP($zipFile, $destinationDirectory, $options);
        }
    }
public function unzip ( $ zipFile , $ destinationDirectory , array $ options = [ ] ) { $ fs = $ this -> getFilesystem ( ) ; $ normalized = @ realpath ( $ zipFile ) ; if ( $ normalized === false || ! $ fs -> isFile ( $ normalized ) ) { throw new Exception ( t ( 'Unable to find the ZIP file %s' , $ zipFile ) ) ; } $ zipFile = str_replace ( DIRECTORY_SEPARATOR , '/' , $ normalized ) ; $ normalized = @ realpath ( $ destinationDirectory ) ; if ( $ normalized === false || ! $ fs -> isDirectory ( $ normalized ) ) { throw new Exception ( t ( 'Unable to find the directory %s' , $ destinationDirectory ) ) ; } if ( ! $ fs -> isWritable ( $ normalized ) ) { throw new Exception ( t ( 'The directory "%s" is not writable' , $ destinationDirectory ) ) ; } $ destinationDirectory = str_replace ( DIRECTORY_SEPARATOR , '/' , $ normalized ) ; $ options += [ 'skipCheck' => false , ] ; if ( $ this -> mayUseNativeCommand ( 'unzip' ) ) { $ this -> unzipNative ( $ zipFile , $ destinationDirectory , $ options ) ; } else { $ this -> unzipPHP ( $ zipFile , $ destinationDirectory , $ options ) ; } }
Decompress a ZIP archive to a directory.

@param string $zipFile the source ZIP archive
@param string $destinationDirectory the destination folder
@param array $options {
@var bool $skipCheck Skip test compressed archive data
}

@throws Exception
Decompress a ZIP archive to a directory .