Project

General

Profile

1
<?php
2

    
3
/*
4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19

    
20
/**
21
 * Constants.php
22
 *
23
 * @category     Vendor
24
 * @package      Vendor_PclZip
25
 * @copyright    Manuela v.d.Decken <manuela@isteam.de>
26
 * @author       Manuela v.d.Decken <manuela@isteam.de>
27
 * @license      http://www.gnu.org/licenses/gpl.html   GPL License
28
 * @version      0.0.1
29
 * @revision     $Revision: 2 $
30
 * @link         $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/trunk/include/pclzip/Constants.php $
31
 * @lastmodified $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
32
 * @since        File available since 01.01.2016
33
 * @deprecated   This file is deprecated from beginning
34
 * @description compatibility layer
35
 */
36

    
37
    // ----- Constants
38
// (all set deprecated!!)
39

    
40
    if (!defined('PCLZIP_READ_BLOCK_SIZE')) { define( 'PCLZIP_READ_BLOCK_SIZE', 2048 ); }
41
    // ----- File list separator
42
    // In version 1.x of PclZip, the separator for file list is a space
43
    // (which is not a very smart choice, specifically for windows paths !).
44
    // A better separator should be a comma (,). This constant gives you the
45
    // abilty to change that.
46
    // However notice that changing this value, may have impact on existing
47
    // scripts, using space separated filenames.
48
    // Recommanded values for compatibility with older versions :
49
    //define( 'PCLZIP_SEPARATOR', ' ' );
50
    // Recommanded values for smart separation of filenames.
51
    if (!defined('PCLZIP_SEPARATOR')) { define( 'PCLZIP_SEPARATOR', ',' ); }
52
    // ----- Error configuration
53
    // 0 : PclZip Class integrated error handling
54
    // 1 : PclError external library error handling. By enabling this
55
    //     you must ensure that you have included PclError library.
56
    // [2,...] : reserved for futur use
57
    if (!defined('PCLZIP_ERROR_EXTERNAL')) { define( 'PCLZIP_ERROR_EXTERNAL', 0 ); }
58
    // ----- Optional static temporary directory
59
    //       By default temporary files are generated in the script current
60
    //       path.
61
    //       If defined :
62
    //       - MUST BE terminated by a '/'.
63
    //       - MUST be a valid, already created directory
64
    //       Samples :
65
    // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' );
66
    // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' );
67
    if (!defined('PCLZIP_TEMPORARY_DIR')) { define( 'PCLZIP_TEMPORARY_DIR', '' ); }
68
    // ----- Optional threshold ratio for use of temporary files
69
    //       Pclzip sense the size of the file to add/extract and decide to
70
    //       use or not temporary file. The algorythm is looking for
71
    //       memory_limit of PHP and apply a ratio.
72
    //       threshold = memory_limit * ratio.
73
    //       Recommended values are under 0.5. Default 0.47.
74
    //       Samples :
75
    // define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.5 );
76
    if (!defined('PCLZIP_TEMPORARY_FILE_RATIO')) { define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.47 ); }
77
// ----- Error codes -------------------------------------------------------------------
78
//    -1 : Unable to open file in binary write mode
79
//    -2 : Unable to open file in binary read mode
80
//    -3 : Invalid parameters
81
//    -4 : File does not exist
82
//    -5 : Filename is too long (max. 255)
83
//    -6 : Not a valid zip file
84
//    -7 : Invalid extracted file size
85
//    -8 : Unable to create directory
86
//    -9 : Invalid archive extension
87
//   -10 : Invalid archive format
88
//   -11 : Unable to delete file (unlink)
89
//   -12 : Unable to rename file (rename)
90
//   -13 : Invalid header checksum
91
//   -14 : Invalid archive size
92
    define( 'PCLZIP_ERR_USER_ABORTED', 2 );
93
    define( 'PCLZIP_ERR_NO_ERROR', 0 );
94
    define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 );
95
    define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 );
96
    define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 );
97
    define( 'PCLZIP_ERR_MISSING_FILE', -4 );
98
    define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 );
99
    define( 'PCLZIP_ERR_INVALID_ZIP', -6 );
100
    define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 );
101
    define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 );
102
    define( 'PCLZIP_ERR_BAD_EXTENSION', -9 );
103
    define( 'PCLZIP_ERR_BAD_FORMAT', -10 );
104
    define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 );
105
    define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 );
106
    define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 );
107
    define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 );
108
    define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 );
109
    define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 );
110
    define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 );
111
    define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 );
112
    define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 );
113
    define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 );
114
    define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 );
115
    // ----- Options values ----------------------------------------------------------------
116
    define( 'PCLZIP_OPT_PATH', 77001 );
117
    define( 'PCLZIP_OPT_ADD_PATH', 77002 );
118
    define( 'PCLZIP_OPT_REMOVE_PATH', 77003 );
119
    define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 );
120
    define( 'PCLZIP_OPT_SET_CHMOD', 77005 );
121
    define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 );
122
    define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 );
123
    define( 'PCLZIP_OPT_BY_NAME', 77008 );
124
    define( 'PCLZIP_OPT_BY_INDEX', 77009 );
125
    define( 'PCLZIP_OPT_BY_EREG', 77010 );
126
    define( 'PCLZIP_OPT_BY_PREG', 77011 );
127
    define( 'PCLZIP_OPT_COMMENT', 77012 );
128
    define( 'PCLZIP_OPT_ADD_COMMENT', 77013 );
129
    define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 );
130
    define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 );
131
    define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 );
132
    define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 );
133
    // Having big trouble with crypt. Need to multiply 2 long int
134
    // which is not correctly supported by PHP ...
135
    //define( 'PCLZIP_OPT_CRYPT', 77018 );
136
    define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 );
137
    define( 'PCLZIP_OPT_TEMP_FILE_THRESHOLD', 77020 );
138
    define( 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD', 77020 ); // alias
139
    define( 'PCLZIP_OPT_TEMP_FILE_ON', 77021 );
140
    define( 'PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021 ); // alias
141
    define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 );
142
    define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias
143
    // ----- File description attributes ---------------------------------------------------
144
    define( 'PCLZIP_ATT_FILE_NAME', 79001 );
145
    define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );
146
    define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 );
147
    define( 'PCLZIP_ATT_FILE_MTIME', 79004 );
148
    define( 'PCLZIP_ATT_FILE_CONTENT', 79005 );
149
    define( 'PCLZIP_ATT_FILE_COMMENT', 79006 );
150
    // ----- Call backs values -------------------------------------------------------------
151
    define( 'PCLZIP_CB_PRE_EXTRACT', 78001 );
152
    define( 'PCLZIP_CB_POST_EXTRACT', 78002 );
153
    define( 'PCLZIP_CB_PRE_ADD', 78003 );
154
    define( 'PCLZIP_CB_POST_ADD', 78004 );
155
  /* For futur use -----------------------------------------------------------------------
156
  define( 'PCLZIP_CB_PRE_LIST', 78005 );
157
  define( 'PCLZIP_CB_POST_LIST', 78006 );
158
  define( 'PCLZIP_CB_PRE_DELETE', 78007 );
159
  define( 'PCLZIP_CB_POST_DELETE', 78008 );
160
  */
161

    
162
// compatibolity layer for utility functions
163
// (all set deprecated!!)
164
    function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) {
165
        return PclZip::UtilTranslateWinPath($p_path, $p_remove_disk_letter);
166
    }
167

    
168
    function PclZipUtilOptionText($p_option) {
169
        return PclZip::UtilOptionText($p_option);
170
    }
171

    
172
    function PclZipUtilRename($p_src, $p_dest) {
173
        return PclZip::UtilRename($p_src, $p_dest);
174
    }
175

    
176
    function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) {
177
        return PclZip::UtilCopyBlock($p_src, $p_dest, $p_size, $p_mode);
178
    }
179

    
180
    function PclZipUtilPathInclusion($p_dir, $p_path) {
181
        return PclZip::UtilPathInclusion($p_dir, $p_path);
182
    }
183

    
184
    function PclZipUtilPathReduction($p_dir) {
185
        return PclZip::UtilPathReduction($p_dir);
186
    }
187

    
188

    
189
// end of file
(1-1/4)