function create_zip_plugin()
 {
     $result = false;
     $pdir = DIR_FS_PLUGINS . $this->key . '/';
     $zip_file = $pdir . $this->key . '.zip';
     $cZip = new pkzip();
     $cZip->addDir($pdir);
     if (tep_write_contents($zip_file, $cZip->file())) {
         $result = true;
     }
     return $result;
 }
function tep_compress(&$files_array)
{
    $cZip = new pkzip();
    $cZip->addArray($files_array);
    return $cZip->file();
}
Exemple #3
0
        $result_array = tep_decompress($plugins_compressed_array[$cplgID]['file'], $plugins_compressed_array[$cplgID]['path']);
        for ($i = 0, $j = count($result_array['messages']); $i < $j; $i++) {
            $messageStack->add_session($result_array['messages'][$i]);
        }
        tep_redirect(tep_href_link($g_script, tep_get_all_get_params('action', 'plgID', 'cplgID') . 'plgID=' . $cplgID));
        break;
    case 'archive_confirm':
        $pdir = DIR_FS_PLUGINS . tep_trail_path($plugin->key);
        $zip_file = $pdir . $plugin->key . '.zip';
        $cZip = new pkzip();
        if (isset($_POST['store'])) {
            $cZip->addDir($pdir);
        } else {
            $cZip->addDir($pdir, '', array());
        }
        $contents = $cZip->file();
        if (isset($_POST['store'])) {
            tep_write_contents($zip_file, $contents);
        }
        $archive = $plugin->key;
        $filename = $plugin->key . '.zip';
        header('Content-type: application/x-octet-stream');
        header('Content-disposition: attachment; filename=' . $filename);
        echo $contents;
        $g_session->close();
        break;
    case 'info':
        break;
    default:
        break;
}