Compress Library



( ZN >= 2.0.0 )

It is a library that performs functions such as performing compression operations on data and decompressing compressed data. It has 6 drivers.

 

# Compression Drivers


GZ Predefined. Installation is not required.
bz Installation is not required.
lzf Installation is required. LZF Guide .
rar Installation is required. RAR Guide .
zip Installation is not required.
zlib Installation is not required.

 

# Configuration


File: Config / Storage.php
String $ driver = 'gz' One of the available compression schemes.
Options gz , bz , lzf , rar , zip , zlib

 

# Methods


Bool extract ( String $ source , String $ target = NULL , String $ password = NULL )
Bool write ( String $ file , String $ data )
String read ( String $ file )
String do ( String $ data ) 
String undo ( String $ data )
this driver ( String $ driver )

 

# Extract ( ZN >= 2.0.0 )


Used to extract archived files from a compressed file. For now, this method can use zip and rar drivers. Other drivers do not offer this support.

Parameters

String $ Source Source file.
String $ target Destination directory.
String $ password = NULL If there is a password.
return Bool  

uses

Compress::extract('archives.zip', 'achives/');

 

# Write ( ZN >= 2.0.0 )


Used to write compressed data to a file.

Parameters

String $ file File path.
String $ data Data.
return Bool  

uses

Compress::write('example-compress.txt', 'Example Data');

 

# Read ( ZN >= 2.0.0 )


Used to read the created file.

Parameters

String $ file File path.
return String  

uses

echo Compress::read('example-compress.txt');
Example Data

 

# Do ( ZN >= 4.0.22 )


It is used to compress the data.

Parameters

String $ data Data.
return String  

uses

echo $data = Compress::do('Example Data');
XSH-AEP is I ??? g 

 

# Undo ( ZN >= 4.0.22 )


It is used to restore the compressed data to its original state.

Parameters

String $ data Data.
return String  

uses

echo Compress::undo($data);
Example Data