Skip to content

rasclatt/ZipEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZipEngine

A quick and dirty save to disk or download zip archive class for PHP. Not frills, just add files and go. Uses the ZipArchive class (required).

Example of use:

<?php
  // Include the zip engine
	include_once(__DIR__.'/classes/class.ZipEngine.php');
	// Include the directory iterator
	include_once(__DIR__.'/functions/function.get_directory_list.php');
	// Save name
	$folder		=	'/zipfile.zip';
	// Retrieves the directory listing (recursive)
	$dir		=	get_directory_list(array("dir"=>__DIR__.'/myflies/'));
	// Creates a saveto folder
	$ZipEngine	=	new ZipEngine(__DIR__.'/crashcart/');
	// Adds all the files from the "myfiles" folder and adds them to an archive
	foreach($dir['host'] as $docs) {
			if(is_file($docs))
				$ZipEngine->AddFiles($docs);
		}
	// Stores them on the server
	$ZipEngine->ZipAndStore($folder);
	// Alternatively you can download them
	// $ZipEngine->Zipit($folder);

About

A quick and dirty save to disk or download zip archive class

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages