CI_Zip::read_file()

read_file($path[, $archive_filepath = FALSE]) Parameters: $path (string) – Path to file $archive_filepath (mixed) – New file name/path (string) or (boolean) whether to maintain the original filepath Returns: TRUE on success, FALSE on failure Return type: bool Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will read it and add it to the archive: $path = '/path/to/photo.jpg'; $this->zip->read_file($path); // D

CodeIgniter Features

Features in and of themselves are a very poor way to judge an application since they tell you nothing about the user experience, or how intuitively or intelligently it is designed. Features don’t reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. The only way to really judge an app is to try it and get to know the code. Installing CodeIgniter is child’s play so we encourage you to do just that. In the mean time here’s a list of

CodeIgniter Overview

The following pages describe the broad concepts behind CodeIgniter: Getting Started CodeIgniter at a Glance Supported Features Application Flow Chart Model-View-Controller Architectural Goals

CI_Zip::get_zip()

get_zip() Returns: Zip file content Return type: string Returns the Zip-compressed file data. Generally you will not need this method unless you want to do something unique with the data. Example: $name = 'my_bio.txt'; $data = 'I was born in an elevator...'; $this->zip->add_data($name, $data); $zip_file = $this->zip->get_zip();

CI_Zip::read_dir()

read_dir($path[, $preserve_filepath = TRUE[, $root_path = NULL]]) Parameters: $path (string) – Path to directory $preserve_filepath (bool) – Whether to maintain the original path $root_path (string) – Part of the path to exclude from the archive directory Returns: TRUE on success, FALSE on failure Return type: bool Permits you to compress a directory (and its contents) that already exists somewhere on your server. Supply a path to the directory and the zip class will recursively r

CodeIgniter at a Glance

CodeIgniter is an Application Framework CodeIgniter is a toolkit for people who build web applications using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task. CodeIgniter is Fre

CI_Zip::download()

download($filename = 'backup.zip') Parameters: $filename (string) – Archive file name Return type: void Causes the Zip file to be downloaded from your server. You must pass the name you would like the zip file called. Example: $this->zip->download('latest_stuff.zip'); // File will be named "latest_stuff.zip" Note Do not display any data in the controller in which you call this method since it sends various server headers that cause the download to happen and the file to be tre

CI_Zip

class CI_Zip $compression_level = 2 The compression level to use. It can range from 0 to 9, with 9 being the highest and 0 effectively disabling compression: $this->zip->compression_level = 0; add_data($filepath[, $data = NULL]) Parameters: $filepath (mixed) – A single file path or an array of file => data pairs $data (array) – File contents (ignored if $filepath is an array) Return type: void Adds data to the Zip archive. Can work both in single and multiple files m

CI_Zip::add_data()

add_data($filepath[, $data = NULL]) Parameters: $filepath (mixed) – A single file path or an array of file => data pairs $data (array) – File contents (ignored if $filepath is an array) Return type: void Adds data to the Zip archive. Can work both in single and multiple files mode. When adding a single file, the first parameter must contain the name you would like given to the file and the second must contain the file contents: $name = 'mydata1.txt'; $data = 'A Data String!'; $thi

CI_Zip::archive()

archive($filepath) Parameters: $filepath (string) – Path to target zip archive Returns: TRUE on success, FALSE on failure Return type: bool Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the directory is writable (755 is usually OK). Example: $this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip