Documentation

Zip


The zip helper allows you to interact with the Zip files.


factory()


Zip factory


Zip::factory();

addDir(mixed $directory)


Add Directory


Zip::factory()->addDir('test');

addData(mixed $filepath, [string $data = null])


Add Data to Zip


Zip::factory()->addData('test.txt', 'Some test text here');

readFile(mixed $path, [boolean $preserve_filepath = false])


Read the contents of a file and add it to the zip


Zip::factory()->readFile('test.txt');

readDir(mixed $path, [boolean $preserve_filepath = false, [string $root_path = null]])


Read a directory and add it to the zip.


Zip::factory()->readDir('test/');

getZip()


Get the Zip file.


Zip::factory()->getZip();

archive(string $filepath)


Write File to the specified directory


Zip::factory()->readDir('test1/')->readDir('test2/')->archive('test.zip');

clearData()


Initialize Data


Zip::factory()->clearData();