CI_Zip Class Reference

List of all members.

Public Member Functions

 CI_Zip ()
 add_dir ($directory)
 _add_dir ($dir)
 add_data ($filepath, $data=NULL)
 _add_data ($filepath, $data)
 read_file ($path, $preserve_filepath=FALSE)
 read_dir ($path)
 get_zip ()
 archive ($filepath)
 download ($filename= 'backup.zip')
 clear_data ()

Public Attributes

 $zipdata = ''
 $directory = ''
 $entries = 0
 $file_num = 0
 $offset = 0


Member Function Documentation

CI_Zip::_add_data ( filepath,
data 
)

Add Data to Zip

private

Parameters:
string the file name/path
string the data to be encoded
Returns:
void

CI_Zip::_add_dir ( dir  ) 

Add Directory

private

Parameters:
string the directory name
Returns:
void

CI_Zip::add_data ( filepath,
data = NULL 
)

Add Data to Zip

Lets you add files to the archive. If the path is included in the filename it will be placed within a directory. Make sure you use add_dir() first to create the folder.

public

Parameters:
mixed 
string 
Returns:
void

CI_Zip::add_dir ( directory  ) 

Add Directory

Lets you add a virtual directory into which you can place files.

public

Parameters:
mixed the directory name. Can be string or array
Returns:
void

CI_Zip::archive ( filepath  ) 

Write File to the specified directory

Lets you write a file

public

Parameters:
string the file name
Returns:
bool

CI_Zip::CI_Zip (  ) 

CI_Zip::clear_data (  ) 

Initialize Data

Lets you clear current zip data. Useful if you need to create multiple zips with different data.

public

Returns:
void

CI_Zip::download ( filename = 'backup.zip'  ) 

Download

public

Parameters:
string the file name
string the data to be encoded
Returns:
bool

CI_Zip::get_zip (  ) 

Get the Zip file

public

Returns:
binary string

CI_Zip::read_dir ( path  ) 

Read a directory and add it to the zip.

This function recursively reads a folder and everything it contains (including sub-folders) and creates a zip based on it. Whatever directory structure is in the original file path will be recreated in the zip file.

public

Parameters:
string path to source
Returns:
bool

CI_Zip::read_file ( path,
preserve_filepath = FALSE 
)

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

public

Returns:
bool


Member Data Documentation

CI_Zip::$directory = ''

CI_Zip::$entries = 0

CI_Zip::$file_num = 0

CI_Zip::$offset = 0

CI_Zip::$zipdata = ''


The documentation for this class was generated from the following file:

Generated on Sun Nov 16 16:09:19 2008 for CodeIgniter by  doxygen 1.5.7.1