PhpConcept

Developers Tools

  • Increase font size
  • Default font size
  • Decrease font size
Home PclZip

PclZip User Guide - Optional Arguments

Print PDF

Optional Arguments

1 - Overview

The optional arguments can be separated in two main families. The first one are classical arguments that give informations or instructions to the method. The second one are call-back functions, hooks that give the user the ability to perform specific actions during PclZip processing. "Call-backs" are more complex to understand, but gives a better control of archived files.

The optional arguments are identified by a name, which is in reality a static integer value. The value of the argument can be a single value or a list of values. In some cases they don't take any value, their name is enough to indicate a specific action to the method.

In the following sections we will describe the arguments of the two families.

2 - Optional arguments

Today the defined optional arguments are :

PCLZIP_OPT_PATH
PCLZIP_OPT_ADD_PATH
PCLZIP_OPT_REMOVE_PATH
PCLZIP_OPT_REMOVE_ALL_PATH
PCLZIP_OPT_SET_CHMOD
PCLZIP_OPT_BY_NAME
PCLZIP_OPT_BY_EREG
PCLZIP_OPT_BY_PREG
PCLZIP_OPT_BY_INDEX
PCLZIP_OPT_EXTRACT_AS_STRING
PCLZIP_OPT_EXTRACT_IN_OUTPUT
PCLZIP_OPT_NO_COMPRESSION
PCLZIP_OPT_COMMENT
PCLZIP_OPT_ADD_COMMENT
PCLZIP_OPT_PREPEND_COMMENT
PCLZIP_OPT_REPLACE_NEWER
PCLZIP_OPT_EXTRACT_DIR_RESTRICTION
PCLZIP_OPT_STOP_ON_ERROR
PCLZIP_OPT_TEMP_FILE_ON
PCLZIP_OPT_TEMP_FILE_THRESHOLD
PCLZIP_OPT_TEMP_FILE_OFF

3 - "Call-back" functions

'Call-back' functions are specific arguments, because the value is a function name. The call-back function have a strict synopsis that must be respected, and the possible actions inside it are delimited. The algorithm inside the call-back function can be anything, it must respect the argument list and the returned value. However the call-back function must respect the core method processing, some actions may interfere with it (like deleting the archive file during process).

PCLZIP_CB_PRE_EXTRACT
PCLZIP_CB_POST_EXTRACT
PCLZIP_CB_PRE_ADD
PCLZIP_CB_POST_ADD

 

Understanding How it Works [Table Of Content] Class and Methods

 

Last Updated on Tuesday, 15 December 2009 19:06