public static function _pack(& $xpdo, $filename, $path, $source) {
        $packed = false;
        $packResults = false;
        $errors = array();
        if ($xpdo->getOption(xPDOTransport::ARCHIVE_WITH, null, 0) != xPDOTransport::ARCHIVE_WITH_PCLZIP && class_exists('ZipArchive')) {
            if ($xpdo->getDebug() === true) {
                $xpdo->log(xPDO::LOG_LEVEL_DEBUG, "Using xPDOZip / native ZipArchive", null, __METHOD__, __FILE__, __LINE__);
            }
            $archive = new xPDOZip($xpdo, $filename, array(xPDOZip::CREATE => true, xPDOZip::OVERWRITE => true));
            if ($archive) {
                $packResults = $archive->pack("{$path}{$source}", array(xPDOZip::ZIP_TARGET => "{$source}/"));
                $archive->close();
                if (!$archive->hasError() && !empty($packResults)) {
                    $packed = true;
                } else {
                    $errors = $archive->getErrors();
                }
            }
        } elseif (class_exists('PclZip') || include(XPDO_CORE_PATH . 'Compression/pclzip.lib.php')) {
            $archive = new \PclZip($filename);
            if ($archive) {
                $packResults = $archive->create("{$path}{$source}", PCLZIP_OPT_REMOVE_PATH, "{$path}");
                if ($packResults) {
                    $packed = true;
                } else {
                    $errors = $archive->errorInfo($xpdo->getDebug() === true);
                }
            }
        }
        if (!$packed) {
            $xpdo->log(xPDO::LOG_LEVEL_ERROR, "Error packing {$path}{$source} to {$filename}: " . print_r($errors, true));
        }
        if ($xpdo->getDebug() === true) {
            $xpdo->log(xPDO::LOG_LEVEL_DEBUG, "Results of packing {$path}{$source} to {$filename}: " . print_r($packResults, true), null, __METHOD__, __FILE__, __LINE__);
        }
        return $packed;
    }