concrete/src/File/Service/Zip.php
protected function unzipNative($zipFile, $destinationDirectory, array $options)
    {
        $cmd = 'unzip';
        $cmd .= ' -o'; // overwrite files WITHOUT prompting
        $cmd .= ' -q'; // quiet mode, to avoid overflow of stdout
        $cmd .= ' ' . escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $zipFile)); // file to extract
        $cmd .= ' -d ' . escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $destinationDirectory)); // destination directory
        $rc = 1;
        $output = [];
        @exec($cmd . ' 2>&1', $output, $rc);
        if ($rc !== 0) {
            $error = trim(implode("\n", $output)) ?: t('Unknown error decompressing a ZIP archive');
            throw new Exception($error);
        }
    }
protected function unzipNative($zipFile, $destinationDirectory, array $options)
    {
        $cmd = 'unzip';
        $cmd .= ' -o'; // overwrite files WITHOUT prompting
        $cmd .= ' -q'; // quiet mode, to avoid overflow of stdout
        $cmd .= ' ' . escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $zipFile)); // file to extract
        $cmd .= ' -d ' . escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $destinationDirectory)); // destination directory
        $rc = 1;
        $output = [];
        @exec($cmd . ' 2>&1', $output, $rc);
        if ($rc !== 0) {
            $error = trim(implode("\n", $output)) ?: t('Unknown error decompressing a ZIP archive');
            throw new Exception($error);
        }
    }
protected function unzipNative ( $ zipFile , $ destinationDirectory , array $ options ) { $ cmd = 'unzip' ; $ cmd .= ' -o' ; // overwrite files WITHOUT prompting $ cmd .= ' -q' ; // quiet mode, to avoid overflow of stdout $ cmd .= ' ' . escapeshellarg ( str_replace ( '/' , DIRECTORY_SEPARATOR , $ zipFile ) ) ; // file to extract $ cmd .= ' -d ' . escapeshellarg ( str_replace ( '/' , DIRECTORY_SEPARATOR , $ destinationDirectory ) ) ; // destination directory $ rc = 1 ; $ output = [ ] ; @ exec ( $ cmd . ' 2>&1' , $ output , $ rc ) ; if ( $ rc !== 0 ) { $ error = trim ( implode ( "\n" , $ output ) ) ? : t ( 'Unknown error decompressing a ZIP archive' ) ; throw new Exception ( $ error ) ; } }
Decompress a ZIP archive to a directory using the native 'unzip' command.

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

@throws Exception
Decompress a ZIP archive to a directory using the native unzip command .