yana

phpDocumentor v 1.4.0

/plugins/pclzip/pclzip.lib.php

Description

PhpConcept Library - Zip Module 2.6
--------------------------------------------------------------------------------
License GNU/LGPL - Vincent Blavet - July 2007 http://www.phpconcept.net
--------------------------------------------------------------------------------
PclZip is a library that creates and manage ZIP formatted archives.
The library defines a class (PclZip). An object of that class represent a single ZIP archive. The methods documented in this manual manage the archive. Please notice that only the public methods are documented and will be maintained from one version to an other (or the modifications will be advertised in the release notes). The private internal methods can be modified without any warning from one version to an other, they must not be directly used.
PclZip is made by a single file pclzip.lib.php, which is enough to have the full features of PclZip.
Presentation :
PclZip is a PHP library that manage ZIP archives. So far tests show that archives generated by PclZip are readable by WinZip application and other tools.
Warning :
This library and the associated files are non commercial, non professional work. It should not have unexpected results. However if any damage is caused by this software the author can not be responsible. The use of this software is at the risk of the user.
--------------------------------------------------------------------------------
This is a modified version of PCL-Zip Module 2.6
--------------------------------------------------------------------------------
Modifications added by Thomas Meyer (www.yanaframework.net)
  • Code clean-up
  • PHPDoc comments introduced
  • added examples and some english translation
  • encapsulated functions in global namespace in utility class
  • made the global var $p_pclzip_version a constant named PCLZIP_VERSION
  • replaced calls to eval() (this should avoid problems with PHP-extensions like 'Suhosin')

Classes

Class Description
PclZip Class : PclZip

Constants

PCLZIP_ATT_FILE_COMMENT = 79006
PCLZIP_ATT_FILE_CONTENT = 79005
PCLZIP_ATT_FILE_MTIME = 79004
PCLZIP_ATT_FILE_NAME = 79001
File description attributes
PCLZIP_ATT_FILE_NEW_FULL_NAME = 79003
PCLZIP_ATT_FILE_NEW_SHORT_NAME = 79002
PCLZIP_CB_POST_ADD = 78004
PCLZIP_CB_POST_EXTRACT = 78002
PCLZIP_CB_PRE_ADD = 78003
PCLZIP_CB_PRE_EXTRACT = 78001
Callback values
PCLZIP_ERROR_EXTERNAL = 0
Error configuration
  1. : PclZip Class integrated error handling
  2. : PclError external library error handling. By enabling this you must ensure that you have included PclError library.
[2,...] : reserved for future use
PCLZIP_ERR_ALREADY_A_DIRECTORY = -17
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_BAD_CHECKSUM = -13
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_BAD_EXTENSION = -9
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_BAD_EXTRACTED_FILE = -7
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_BAD_FORMAT = -10
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_DELETE_FILE_FAIL = -11
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_DIRECTORY_RESTRICTION = -21
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_DIR_CREATE_FAIL = -8
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_FILENAME_TOO_LONG = -5
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_INVALID_ARCHIVE_ZIP = -14
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE = -20
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_INVALID_OPTION_VALUE = -16
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_INVALID_PARAMETER = -3
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_INVALID_ZIP = -6
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_MISSING_FILE = -4
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_MISSING_OPTION_VALUE = -15
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_NO_ERROR = 0
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_READ_OPEN_FAIL = -2
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_RENAME_FILE_FAIL = -12
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_UNSUPPORTED_COMPRESSION = -18
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_UNSUPPORTED_ENCRYPTION = -19
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_USER_ABORTED = 2
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_ERR_WRITE_OPEN_FAIL = -1
Error codes
  • 0 : no error
  • -1 : Unable to open file in binary write mode
  • -2 : Unable to open file in binary read mode
  • -3 : Invalid parameters
  • -4 : File does not exist
  • -5 : Filename is too long (max. 255)
  • -6 : Not a valid zip file
  • -7 : Invalid extracted file size
  • -8 : Unable to create directory
  • -9 : Invalid archive extension
  • -10 : Invalid archive format
  • -11 : Unable to delete file (unlink)
  • -12 : Unable to rename file (rename)
  • -13 : Invalid header checksum
  • -14 : Invalid archive size
PCLZIP_OPT_ADD_COMMENT = 77013
Options values
PCLZIP_OPT_ADD_PATH = 77002
Options values
PCLZIP_OPT_BY_EREG = 77010
Options values
PCLZIP_OPT_BY_INDEX = 77009
Options values
PCLZIP_OPT_BY_NAME = 77008
Options values
PCLZIP_OPT_BY_PREG = 77011
Options values
PCLZIP_OPT_COMMENT = 77012
Options values
PCLZIP_OPT_EXTRACT_AS_STRING = 77006
Options values
PCLZIP_OPT_EXTRACT_DIR_RESTRICTION = 77019
Options values
PCLZIP_OPT_EXTRACT_IN_OUTPUT = 77015
Options values
PCLZIP_OPT_NO_COMPRESSION = 77007
Options values
PCLZIP_OPT_PATH = 77001
Options values
PCLZIP_OPT_PREPEND_COMMENT = 77014
Options values
PCLZIP_OPT_REMOVE_ALL_PATH = 77004
Options values
PCLZIP_OPT_REMOVE_PATH = 77003
Options values
PCLZIP_OPT_REPLACE_NEWER = 77016
Options values
PCLZIP_OPT_SET_CHMOD = 77005
Options values
PCLZIP_OPT_STOP_ON_ERROR = 77017
Options values
PCLZIP_READ_BLOCK_SIZE = 2048
Block size in byte
PCLZIP_SEPARATOR = ','
File list separator
In version 1.x of PclZip, the separator for file list is a space (which is not a very smart choice, specifically for windows paths !). A better separator should be a comma (,). This constant gives you the abilty to change that. However notice that changing this value, may have impact on existing scripts, using space separated filenames. Recommanded values for compatibility with older versions : define( 'PCLZIP_SEPARATOR', ' ' ); Recommanded values for smart separation of filenames.
PCLZIP_TEMPORARY_DIR = ''
Optional static temporary directory
By default temporary files are generated in the script current path.
If defined :
  • MUST BE terminated by a '/'.
  • MUST be a valid, already created directory
Samples:
  1.  define'PCLZIP_TEMPORARY_DIR''/temp/' );
  2.  define'PCLZIP_TEMPORARY_DIR''C:/Temp/' );
PCLZIP_VERSION = '2.6'
Version of PCL-Zip

Documentation generated on Sat, 03 Jan 2009 22:22:38 +0100 by phpDocumentor 1.4.0

yana author: Thomas MeyerHomepage: www.yanaframework.net