Skip to content

halon-extras/zip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZIP archive

This plugins allows you to create ZIP archives.

Installation

Follow the instructions in our manual to add our package repository and then run the below command.

Ubuntu

apt-get install halon-extras-zip

RHEL

yum install halon-extras-zip

Azure Linux

tdnf install -y halon-extras-zip

Exported classes

These classes needs to be imported from the extras://zip module path.

ZIP()

Create a new ZIP archive.

Returns: class object

$x = ZIP();
$x->addFile("test.txt", "hello");
$x->addFile("test2.txt", "world");
echo $x->toString(["password" => "12345678"]);

addFile(name, data)

Add a file to the ZIP archive options. On error an exception is thrown.

Params

  • name string - the name
  • data string - the data

Returns: this

Return type: ZIP

toString([options])

Return the ZIP file as a string. On error an exception is thrown.

Params

  • options array - an options array

The following options are available in the options array.

  • password string - A password if the file should be encrypted (AES256)

Returns: zip data

Return type: string

About

ZIP plugin

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors