Class CMS_archive

Description

Class CMS_archive

This script aimed to manage TAR, GZIP, BZIP2, ZIP archives Needs inherited classes to become more efficient

Based on an original script "TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.0" from Devin Doucette mentionned in copyright

Located in /automne/classes/files/archive.php (line 33)

CMS_grandFather
   |
   --CMS_archive
Direct descendents
Class Description
 class CMS_tar_file Class CMS_archive
 class CMS_zip_file Class CMS_archive
Method Summary
 void CMS_archive ( $name, string $name,)
 void add_data (string $data)
 void add_files ( $list, array $list,)
 boolean create_archive ()
 binary download_file ()
 void exclude_files ( $list, array $list,)
 array, list_files ( $list, array $list,)
 void make_list ()
 array parse_dir ( $dirname, string $dirname,)
 void set_options ( $options)
 integer, sort_files (string $a, string $b)
 array, store_files ( $list, array $list,)
Methods
Constructor CMS_archive (line 76)

Constructor

void CMS_archive ( $name, string $name,)
  • string $name,: the full filename of the archive
  • $name
add_data (line 206)

Add raw data to archive

void add_data (string $data)
  • string $data
add_files (line 248)

Add files to archive

void add_files ( $list, array $list,)
  • array $list,: an array of files to add
  • $list
create_archive (line 136)

Creates the archive Not so well done. This method should be abstract and redefined by each class through inheritance, awaiting interfaces in PHP 5

  • return: true on success, false on failure
boolean create_archive ()
download_file (line 392)

Proceeds to archive download

  • return: file content to be downloaded
binary download_file ()
exclude_files (line 261)

Sets all files to exclude from archive

void exclude_files ( $list, array $list,)
  • array $list,: an array of files to add
  • $list
list_files (line 287)

List files of archive and sort them with sort_files method

  • return: files to list
array, list_files ( $list, array $list,)
  • array $list,: all files to list in an array
  • $list
make_list (line 220)

Build list of all files to manage respecting stored files and those to exlude

void make_list ()
parse_dir (line 336)

Parse a directory to get its content

  • return: founded in the directory
array parse_dir ( $dirname, string $dirname,)
  • string $dirname,: name of the directory to parse
  • $dirname
set_options (line 104)

Sets options array to this archive

  • var: array, @see $options attributes for details
void set_options ( $options)
  • $options
sort_files (line 370)

Sorts files

  • return: 0 if nothing sorted
integer, sort_files (string $a, string $b)
  • string $a
  • string $b
store_files (line 274)

Stores files into archive

  • return: sorted with sort_files method
array, store_files ( $list, array $list,)
  • array $list,: all files to list in an array
  • $list

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants

Documentation generated on Wed, 15 Feb 2012 15:28:22 +0100 by phpDocumentor 1.4.3