src/xPDO/Transport/xPDOTransport.php
public static function _unpack(& $xpdo, $from, $to) {
        $resources = false;
        if ($xpdo->getOption(xPDOTransport::ARCHIVE_WITH, null, 0) != xPDOTransport::ARCHIVE_WITH_PCLZIP && class_exists('ZipArchive')) {
            $archive = new xPDOZip($xpdo, $from);
            if ($archive) {
                $resources = $archive->unpack($to);
                $archive->close();
            }
        } elseif (class_exists('PclZip') || include(XPDO_CORE_PATH . 'Compression/pclzip.lib.php')) {
            $archive = new \PclZip($from);
            if ($archive) {
                $resources = $archive->extract(PCLZIP_OPT_PATH, $to);
            }
        }
        return $resources;
    }
public static function _unpack(& $xpdo, $from, $to) {
        $resources = false;
        if ($xpdo->getOption(xPDOTransport::ARCHIVE_WITH, null, 0) != xPDOTransport::ARCHIVE_WITH_PCLZIP && class_exists('ZipArchive')) {
            $archive = new xPDOZip($xpdo, $from);
            if ($archive) {
                $resources = $archive->unpack($to);
                $archive->close();
            }
        } elseif (class_exists('PclZip') || include(XPDO_CORE_PATH . 'Compression/pclzip.lib.php')) {
            $archive = new \PclZip($from);
            if ($archive) {
                $resources = $archive->extract(PCLZIP_OPT_PATH, $to);
            }
        }
        return $resources;
    }
public static function _unpack ( & $ xpdo , $ from , $ to ) { $ resources = false ; if ( $ xpdo -> getOption ( xPDOTransport :: ARCHIVE_WITH , null , 0 ) != xPDOTransport :: ARCHIVE_WITH_PCLZIP && class_exists ( 'ZipArchive' ) ) { $ archive = new xPDOZip ( $ xpdo , $ from ) ; if ( $ archive ) { $ resources = $ archive -> unpack ( $ to ) ; $ archive -> close ( ) ; } } elseif ( class_exists ( 'PclZip' ) || include ( XPDO_CORE_PATH . 'Compression/pclzip.lib.php' ) ) { $ archive = new \ PclZip ( $ from ) ; if ( $ archive ) { $ resources = $ archive -> extract ( PCLZIP_OPT_PATH , $ to ) ; } } return $ resources ; }
Unpack a zip archive to a specified location.

@uses compression.xPDOZip OR compression.PclZip
@todo Refactor this to be implemented in a service class external to xPDOTransport.

@param xPDO &$xpdo A reference to an xPDO instance.
@param string $from An absolute file system location to a valid zip archive.
@param string $to A file system location to extract the contents of the archive to.
@return array|boolean An array of unpacked resources or false on failure.
Unpack a zip archive to a specified location .