Login   Register  
PHP Classes
elePHPant
Icontem

File: tests/MergeZip.File.Example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Asbjorn Grandt  >  PHP Zip Merge  >  tests/MergeZip.File.Example1.php  >  Download  
File: tests/MergeZip.File.Example1.php
Role: Example script
Content type: text/plain
Description: Stepping to version 1.0.2 Added class to write to file ZipMerge always streams to the client, the new ZipMergeToFile will write directly to a file instead, phpclasses accidentally said the package could do this... :P
Class: PHP Zip Merge
Merge and stream multiple ZIP files
Author: By
Last change:
Date: 3 months ago
Size: 569 bytes
 

Contents

Class file image Download
<?php
error_reporting
(E_ALL E_STRICT);
ini_set('error_reporting'E_ALL E_STRICT);
ini_set('display_errors'1);

include 
"../vendor/autoload.php";

$outFile "ZipMerge.File.test1.zip";

$zipMerge = new \ZipMerge\Zip\File\ZipMergeToFile($outFile);
$zipMerge->appendZip("../testData/500k.zip""TrueCryptRandomFile/");
$zipMerge->appendZip("../testData/test.zip""A-book");
/*
$handle = fopen("ZipStreamExample1.zip", 'r');
$zipMerge->appendZip($handle, "ZipStreamExample1.zip");
fclose($handle);
*/
$zipMerge->finalize();

print 
"<p>File $outFile written</p>\n";