Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-admin/includes
File: class-pclzip.php
return 0;
[500] Fix | Delete
}
[501] Fix | Delete
}
[502] Fix | Delete
[503] Fix | Delete
// ----- Look for 2 args
[504] Fix | Delete
// Here we need to support the first historic synopsis of the
[505] Fix | Delete
// method.
[506] Fix | Delete
else {
[507] Fix | Delete
[508] Fix | Delete
// ----- Get the first argument
[509] Fix | Delete
$v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0];
[510] Fix | Delete
[511] Fix | Delete
// ----- Look for the optional second argument
[512] Fix | Delete
if ($v_size == 2) {
[513] Fix | Delete
$v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
[514] Fix | Delete
}
[515] Fix | Delete
else if ($v_size > 2) {
[516] Fix | Delete
// ----- Error log
[517] Fix | Delete
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
[518] Fix | Delete
[519] Fix | Delete
// ----- Return
[520] Fix | Delete
return 0;
[521] Fix | Delete
}
[522] Fix | Delete
}
[523] Fix | Delete
}
[524] Fix | Delete
[525] Fix | Delete
// ----- Look for default option values
[526] Fix | Delete
$this->privOptionDefaultThreshold($v_options);
[527] Fix | Delete
[528] Fix | Delete
// ----- Init
[529] Fix | Delete
$v_string_list = array();
[530] Fix | Delete
$v_att_list = array();
[531] Fix | Delete
$v_filedescr_list = array();
[532] Fix | Delete
$p_result_list = array();
[533] Fix | Delete
[534] Fix | Delete
// ----- Look if the $p_filelist is really an array
[535] Fix | Delete
if (is_array($p_filelist)) {
[536] Fix | Delete
[537] Fix | Delete
// ----- Look if the first element is also an array
[538] Fix | Delete
// This will mean that this is a file description entry
[539] Fix | Delete
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
[540] Fix | Delete
$v_att_list = $p_filelist;
[541] Fix | Delete
}
[542] Fix | Delete
[543] Fix | Delete
// ----- The list is a list of string names
[544] Fix | Delete
else {
[545] Fix | Delete
$v_string_list = $p_filelist;
[546] Fix | Delete
}
[547] Fix | Delete
}
[548] Fix | Delete
[549] Fix | Delete
// ----- Look if the $p_filelist is a string
[550] Fix | Delete
else if (is_string($p_filelist)) {
[551] Fix | Delete
// ----- Create a list from the string
[552] Fix | Delete
$v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
[553] Fix | Delete
}
[554] Fix | Delete
[555] Fix | Delete
// ----- Invalid variable type for $p_filelist
[556] Fix | Delete
else {
[557] Fix | Delete
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist");
[558] Fix | Delete
return 0;
[559] Fix | Delete
}
[560] Fix | Delete
[561] Fix | Delete
// ----- Reformat the string list
[562] Fix | Delete
if (sizeof($v_string_list) != 0) {
[563] Fix | Delete
foreach ($v_string_list as $v_string) {
[564] Fix | Delete
$v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
[565] Fix | Delete
}
[566] Fix | Delete
}
[567] Fix | Delete
[568] Fix | Delete
// ----- For each file in the list check the attributes
[569] Fix | Delete
$v_supported_attributes
[570] Fix | Delete
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
[571] Fix | Delete
,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'
[572] Fix | Delete
,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'
[573] Fix | Delete
,PCLZIP_ATT_FILE_MTIME => 'optional'
[574] Fix | Delete
,PCLZIP_ATT_FILE_CONTENT => 'optional'
[575] Fix | Delete
,PCLZIP_ATT_FILE_COMMENT => 'optional'
[576] Fix | Delete
);
[577] Fix | Delete
foreach ($v_att_list as $v_entry) {
[578] Fix | Delete
$v_result = $this->privFileDescrParseAtt($v_entry,
[579] Fix | Delete
$v_filedescr_list[],
[580] Fix | Delete
$v_options,
[581] Fix | Delete
$v_supported_attributes);
[582] Fix | Delete
if ($v_result != 1) {
[583] Fix | Delete
return 0;
[584] Fix | Delete
}
[585] Fix | Delete
}
[586] Fix | Delete
[587] Fix | Delete
// ----- Expand the filelist (expand directories)
[588] Fix | Delete
$v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
[589] Fix | Delete
if ($v_result != 1) {
[590] Fix | Delete
return 0;
[591] Fix | Delete
}
[592] Fix | Delete
[593] Fix | Delete
// ----- Call the create fct
[594] Fix | Delete
$v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options);
[595] Fix | Delete
if ($v_result != 1) {
[596] Fix | Delete
return 0;
[597] Fix | Delete
}
[598] Fix | Delete
[599] Fix | Delete
// ----- Return
[600] Fix | Delete
return $p_result_list;
[601] Fix | Delete
}
[602] Fix | Delete
// --------------------------------------------------------------------------------
[603] Fix | Delete
[604] Fix | Delete
// --------------------------------------------------------------------------------
[605] Fix | Delete
// Function : listContent()
[606] Fix | Delete
// Description :
[607] Fix | Delete
// This public method, gives the list of the files and directories, with their
[608] Fix | Delete
// properties.
[609] Fix | Delete
// The properties of each entries in the list are (used also in other functions) :
[610] Fix | Delete
// filename : Name of the file. For a create or add action it is the filename
[611] Fix | Delete
// given by the user. For an extract function it is the filename
[612] Fix | Delete
// of the extracted file.
[613] Fix | Delete
// stored_filename : Name of the file / directory stored in the archive.
[614] Fix | Delete
// size : Size of the stored file.
[615] Fix | Delete
// compressed_size : Size of the file's data compressed in the archive
[616] Fix | Delete
// (without the headers overhead)
[617] Fix | Delete
// mtime : Last known modification date of the file (UNIX timestamp)
[618] Fix | Delete
// comment : Comment associated with the file
[619] Fix | Delete
// folder : true | false
[620] Fix | Delete
// index : index of the file in the archive
[621] Fix | Delete
// status : status of the action (depending of the action) :
[622] Fix | Delete
// Values are :
[623] Fix | Delete
// ok : OK !
[624] Fix | Delete
// filtered : the file / dir is not extracted (filtered by user)
[625] Fix | Delete
// already_a_directory : the file can not be extracted because a
[626] Fix | Delete
// directory with the same name already exists
[627] Fix | Delete
// write_protected : the file can not be extracted because a file
[628] Fix | Delete
// with the same name already exists and is
[629] Fix | Delete
// write protected
[630] Fix | Delete
// newer_exist : the file was not extracted because a newer file exists
[631] Fix | Delete
// path_creation_fail : the file is not extracted because the folder
[632] Fix | Delete
// does not exist and can not be created
[633] Fix | Delete
// write_error : the file was not extracted because there was an
[634] Fix | Delete
// error while writing the file
[635] Fix | Delete
// read_error : the file was not extracted because there was an error
[636] Fix | Delete
// while reading the file
[637] Fix | Delete
// invalid_header : the file was not extracted because of an archive
[638] Fix | Delete
// format error (bad file header)
[639] Fix | Delete
// Note that each time a method can continue operating when there
[640] Fix | Delete
// is an action error on a file, the error is only logged in the file status.
[641] Fix | Delete
// Return Values :
[642] Fix | Delete
// 0 on an unrecoverable failure,
[643] Fix | Delete
// The list of the files in the archive.
[644] Fix | Delete
// --------------------------------------------------------------------------------
[645] Fix | Delete
function listContent()
[646] Fix | Delete
{
[647] Fix | Delete
$v_result=1;
[648] Fix | Delete
[649] Fix | Delete
// ----- Reset the error handler
[650] Fix | Delete
$this->privErrorReset();
[651] Fix | Delete
[652] Fix | Delete
// ----- Check archive
[653] Fix | Delete
if (!$this->privCheckFormat()) {
[654] Fix | Delete
return(0);
[655] Fix | Delete
}
[656] Fix | Delete
[657] Fix | Delete
// ----- Call the extracting fct
[658] Fix | Delete
$p_list = array();
[659] Fix | Delete
if (($v_result = $this->privList($p_list)) != 1)
[660] Fix | Delete
{
[661] Fix | Delete
unset($p_list);
[662] Fix | Delete
return(0);
[663] Fix | Delete
}
[664] Fix | Delete
[665] Fix | Delete
// ----- Return
[666] Fix | Delete
return $p_list;
[667] Fix | Delete
}
[668] Fix | Delete
// --------------------------------------------------------------------------------
[669] Fix | Delete
[670] Fix | Delete
// --------------------------------------------------------------------------------
[671] Fix | Delete
// Function :
[672] Fix | Delete
// extract($p_path="./", $p_remove_path="")
[673] Fix | Delete
// extract([$p_option, $p_option_value, ...])
[674] Fix | Delete
// Description :
[675] Fix | Delete
// This method supports two synopsis. The first one is historical.
[676] Fix | Delete
// This method extract all the files / directories from the archive to the
[677] Fix | Delete
// folder indicated in $p_path.
[678] Fix | Delete
// If you want to ignore the 'root' part of path of the memorized files
[679] Fix | Delete
// you can indicate this in the optional $p_remove_path parameter.
[680] Fix | Delete
// By default, if a newer file with the same name already exists, the
[681] Fix | Delete
// file is not extracted.
[682] Fix | Delete
//
[683] Fix | Delete
// If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH options
[684] Fix | Delete
// are used, the path indicated in PCLZIP_OPT_ADD_PATH is append
[685] Fix | Delete
// at the end of the path value of PCLZIP_OPT_PATH.
[686] Fix | Delete
// Parameters :
[687] Fix | Delete
// $p_path : Path where the files and directories are to be extracted
[688] Fix | Delete
// $p_remove_path : First part ('root' part) of the memorized path
[689] Fix | Delete
// (if any similar) to remove while extracting.
[690] Fix | Delete
// Options :
[691] Fix | Delete
// PCLZIP_OPT_PATH :
[692] Fix | Delete
// PCLZIP_OPT_ADD_PATH :
[693] Fix | Delete
// PCLZIP_OPT_REMOVE_PATH :
[694] Fix | Delete
// PCLZIP_OPT_REMOVE_ALL_PATH :
[695] Fix | Delete
// PCLZIP_CB_PRE_EXTRACT :
[696] Fix | Delete
// PCLZIP_CB_POST_EXTRACT :
[697] Fix | Delete
// Return Values :
[698] Fix | Delete
// 0 or a negative value on failure,
[699] Fix | Delete
// The list of the extracted files, with a status of the action.
[700] Fix | Delete
// (see PclZip::listContent() for list entry format)
[701] Fix | Delete
// --------------------------------------------------------------------------------
[702] Fix | Delete
function extract()
[703] Fix | Delete
{
[704] Fix | Delete
$v_result=1;
[705] Fix | Delete
[706] Fix | Delete
// ----- Reset the error handler
[707] Fix | Delete
$this->privErrorReset();
[708] Fix | Delete
[709] Fix | Delete
// ----- Check archive
[710] Fix | Delete
if (!$this->privCheckFormat()) {
[711] Fix | Delete
return(0);
[712] Fix | Delete
}
[713] Fix | Delete
[714] Fix | Delete
// ----- Set default values
[715] Fix | Delete
$v_options = array();
[716] Fix | Delete
// $v_path = "./";
[717] Fix | Delete
$v_path = '';
[718] Fix | Delete
$v_remove_path = "";
[719] Fix | Delete
$v_remove_all_path = false;
[720] Fix | Delete
[721] Fix | Delete
// ----- Look for variable options arguments
[722] Fix | Delete
$v_size = func_num_args();
[723] Fix | Delete
[724] Fix | Delete
// ----- Default values for option
[725] Fix | Delete
$v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
[726] Fix | Delete
[727] Fix | Delete
// ----- Look for arguments
[728] Fix | Delete
if ($v_size > 0) {
[729] Fix | Delete
// ----- Get the arguments
[730] Fix | Delete
$v_arg_list = func_get_args();
[731] Fix | Delete
[732] Fix | Delete
// ----- Look for first arg
[733] Fix | Delete
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
[734] Fix | Delete
[735] Fix | Delete
// ----- Parse the options
[736] Fix | Delete
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
[737] Fix | Delete
array (PCLZIP_OPT_PATH => 'optional',
[738] Fix | Delete
PCLZIP_OPT_REMOVE_PATH => 'optional',
[739] Fix | Delete
PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
[740] Fix | Delete
PCLZIP_OPT_ADD_PATH => 'optional',
[741] Fix | Delete
PCLZIP_CB_PRE_EXTRACT => 'optional',
[742] Fix | Delete
PCLZIP_CB_POST_EXTRACT => 'optional',
[743] Fix | Delete
PCLZIP_OPT_SET_CHMOD => 'optional',
[744] Fix | Delete
PCLZIP_OPT_BY_NAME => 'optional',
[745] Fix | Delete
PCLZIP_OPT_BY_EREG => 'optional',
[746] Fix | Delete
PCLZIP_OPT_BY_PREG => 'optional',
[747] Fix | Delete
PCLZIP_OPT_BY_INDEX => 'optional',
[748] Fix | Delete
PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
[749] Fix | Delete
PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',
[750] Fix | Delete
PCLZIP_OPT_REPLACE_NEWER => 'optional'
[751] Fix | Delete
,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
[752] Fix | Delete
,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
[753] Fix | Delete
PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
[754] Fix | Delete
PCLZIP_OPT_TEMP_FILE_ON => 'optional',
[755] Fix | Delete
PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
[756] Fix | Delete
));
[757] Fix | Delete
if ($v_result != 1) {
[758] Fix | Delete
return 0;
[759] Fix | Delete
}
[760] Fix | Delete
[761] Fix | Delete
// ----- Set the arguments
[762] Fix | Delete
if (isset($v_options[PCLZIP_OPT_PATH])) {
[763] Fix | Delete
$v_path = $v_options[PCLZIP_OPT_PATH];
[764] Fix | Delete
}
[765] Fix | Delete
if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
[766] Fix | Delete
$v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
[767] Fix | Delete
}
[768] Fix | Delete
if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
[769] Fix | Delete
$v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
[770] Fix | Delete
}
[771] Fix | Delete
if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
[772] Fix | Delete
// ----- Check for '/' in last path char
[773] Fix | Delete
if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
[774] Fix | Delete
$v_path .= '/';
[775] Fix | Delete
}
[776] Fix | Delete
$v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
[777] Fix | Delete
}
[778] Fix | Delete
}
[779] Fix | Delete
[780] Fix | Delete
// ----- Look for 2 args
[781] Fix | Delete
// Here we need to support the first historic synopsis of the
[782] Fix | Delete
// method.
[783] Fix | Delete
else {
[784] Fix | Delete
[785] Fix | Delete
// ----- Get the first argument
[786] Fix | Delete
$v_path = $v_arg_list[0];
[787] Fix | Delete
[788] Fix | Delete
// ----- Look for the optional second argument
[789] Fix | Delete
if ($v_size == 2) {
[790] Fix | Delete
$v_remove_path = $v_arg_list[1];
[791] Fix | Delete
}
[792] Fix | Delete
else if ($v_size > 2) {
[793] Fix | Delete
// ----- Error log
[794] Fix | Delete
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
[795] Fix | Delete
[796] Fix | Delete
// ----- Return
[797] Fix | Delete
return 0;
[798] Fix | Delete
}
[799] Fix | Delete
}
[800] Fix | Delete
}
[801] Fix | Delete
[802] Fix | Delete
// ----- Look for default option values
[803] Fix | Delete
$this->privOptionDefaultThreshold($v_options);
[804] Fix | Delete
[805] Fix | Delete
// ----- Trace
[806] Fix | Delete
[807] Fix | Delete
// ----- Call the extracting fct
[808] Fix | Delete
$p_list = array();
[809] Fix | Delete
$v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path,
[810] Fix | Delete
$v_remove_all_path, $v_options);
[811] Fix | Delete
if ($v_result < 1) {
[812] Fix | Delete
unset($p_list);
[813] Fix | Delete
return(0);
[814] Fix | Delete
}
[815] Fix | Delete
[816] Fix | Delete
// ----- Return
[817] Fix | Delete
return $p_list;
[818] Fix | Delete
}
[819] Fix | Delete
// --------------------------------------------------------------------------------
[820] Fix | Delete
[821] Fix | Delete
[822] Fix | Delete
// --------------------------------------------------------------------------------
[823] Fix | Delete
// Function :
[824] Fix | Delete
// extractByIndex($p_index, $p_path="./", $p_remove_path="")
[825] Fix | Delete
// extractByIndex($p_index, [$p_option, $p_option_value, ...])
[826] Fix | Delete
// Description :
[827] Fix | Delete
// This method supports two synopsis. The first one is historical.
[828] Fix | Delete
// This method is doing a partial extract of the archive.
[829] Fix | Delete
// The extracted files or folders are identified by their index in the
[830] Fix | Delete
// archive (from 0 to n).
[831] Fix | Delete
// Note that if the index identify a folder, only the folder entry is
[832] Fix | Delete
// extracted, not all the files included in the archive.
[833] Fix | Delete
// Parameters :
[834] Fix | Delete
// $p_index : A single index (integer) or a string of indexes of files to
[835] Fix | Delete
// extract. The form of the string is "0,4-6,8-12" with only numbers
[836] Fix | Delete
// and '-' for range or ',' to separate ranges. No spaces or ';'
[837] Fix | Delete
// are allowed.
[838] Fix | Delete
// $p_path : Path where the files and directories are to be extracted
[839] Fix | Delete
// $p_remove_path : First part ('root' part) of the memorized path
[840] Fix | Delete
// (if any similar) to remove while extracting.
[841] Fix | Delete
// Options :
[842] Fix | Delete
// PCLZIP_OPT_PATH :
[843] Fix | Delete
// PCLZIP_OPT_ADD_PATH :
[844] Fix | Delete
// PCLZIP_OPT_REMOVE_PATH :
[845] Fix | Delete
// PCLZIP_OPT_REMOVE_ALL_PATH :
[846] Fix | Delete
// PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and
[847] Fix | Delete
// not as files.
[848] Fix | Delete
// The resulting content is in a new field 'content' in the file
[849] Fix | Delete
// structure.
[850] Fix | Delete
// This option must be used alone (any other options are ignored).
[851] Fix | Delete
// PCLZIP_CB_PRE_EXTRACT :
[852] Fix | Delete
// PCLZIP_CB_POST_EXTRACT :
[853] Fix | Delete
// Return Values :
[854] Fix | Delete
// 0 on failure,
[855] Fix | Delete
// The list of the extracted files, with a status of the action.
[856] Fix | Delete
// (see PclZip::listContent() for list entry format)
[857] Fix | Delete
// --------------------------------------------------------------------------------
[858] Fix | Delete
//function extractByIndex($p_index, options...)
[859] Fix | Delete
function extractByIndex($p_index)
[860] Fix | Delete
{
[861] Fix | Delete
$v_result=1;
[862] Fix | Delete
[863] Fix | Delete
// ----- Reset the error handler
[864] Fix | Delete
$this->privErrorReset();
[865] Fix | Delete
[866] Fix | Delete
// ----- Check archive
[867] Fix | Delete
if (!$this->privCheckFormat()) {
[868] Fix | Delete
return(0);
[869] Fix | Delete
}
[870] Fix | Delete
[871] Fix | Delete
// ----- Set default values
[872] Fix | Delete
$v_options = array();
[873] Fix | Delete
// $v_path = "./";
[874] Fix | Delete
$v_path = '';
[875] Fix | Delete
$v_remove_path = "";
[876] Fix | Delete
$v_remove_all_path = false;
[877] Fix | Delete
[878] Fix | Delete
// ----- Look for variable options arguments
[879] Fix | Delete
$v_size = func_num_args();
[880] Fix | Delete
[881] Fix | Delete
// ----- Default values for option
[882] Fix | Delete
$v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
[883] Fix | Delete
[884] Fix | Delete
// ----- Look for arguments
[885] Fix | Delete
if ($v_size > 1) {
[886] Fix | Delete
// ----- Get the arguments
[887] Fix | Delete
$v_arg_list = func_get_args();
[888] Fix | Delete
[889] Fix | Delete
// ----- Remove form the options list the first argument
[890] Fix | Delete
array_shift($v_arg_list);
[891] Fix | Delete
$v_size--;
[892] Fix | Delete
[893] Fix | Delete
// ----- Look for first arg
[894] Fix | Delete
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
[895] Fix | Delete
[896] Fix | Delete
// ----- Parse the options
[897] Fix | Delete
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
[898] Fix | Delete
array (PCLZIP_OPT_PATH => 'optional',
[899] Fix | Delete
PCLZIP_OPT_REMOVE_PATH => 'optional',
[900] Fix | Delete
PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
[901] Fix | Delete
PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
[902] Fix | Delete
PCLZIP_OPT_ADD_PATH => 'optional',
[903] Fix | Delete
PCLZIP_CB_PRE_EXTRACT => 'optional',
[904] Fix | Delete
PCLZIP_CB_POST_EXTRACT => 'optional',
[905] Fix | Delete
PCLZIP_OPT_SET_CHMOD => 'optional',
[906] Fix | Delete
PCLZIP_OPT_REPLACE_NEWER => 'optional'
[907] Fix | Delete
,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
[908] Fix | Delete
,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
[909] Fix | Delete
PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
[910] Fix | Delete
PCLZIP_OPT_TEMP_FILE_ON => 'optional',
[911] Fix | Delete
PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
[912] Fix | Delete
));
[913] Fix | Delete
if ($v_result != 1) {
[914] Fix | Delete
return 0;
[915] Fix | Delete
}
[916] Fix | Delete
[917] Fix | Delete
// ----- Set the arguments
[918] Fix | Delete
if (isset($v_options[PCLZIP_OPT_PATH])) {
[919] Fix | Delete
$v_path = $v_options[PCLZIP_OPT_PATH];
[920] Fix | Delete
}
[921] Fix | Delete
if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
[922] Fix | Delete
$v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
[923] Fix | Delete
}
[924] Fix | Delete
if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
[925] Fix | Delete
$v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
[926] Fix | Delete
}
[927] Fix | Delete
if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
[928] Fix | Delete
// ----- Check for '/' in last path char
[929] Fix | Delete
if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
[930] Fix | Delete
$v_path .= '/';
[931] Fix | Delete
}
[932] Fix | Delete
$v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
[933] Fix | Delete
}
[934] Fix | Delete
if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {
[935] Fix | Delete
$v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
[936] Fix | Delete
}
[937] Fix | Delete
else {
[938] Fix | Delete
}
[939] Fix | Delete
}
[940] Fix | Delete
[941] Fix | Delete
// ----- Look for 2 args
[942] Fix | Delete
// Here we need to support the first historic synopsis of the
[943] Fix | Delete
// method.
[944] Fix | Delete
else {
[945] Fix | Delete
[946] Fix | Delete
// ----- Get the first argument
[947] Fix | Delete
$v_path = $v_arg_list[0];
[948] Fix | Delete
[949] Fix | Delete
// ----- Look for the optional second argument
[950] Fix | Delete
if ($v_size == 2) {
[951] Fix | Delete
$v_remove_path = $v_arg_list[1];
[952] Fix | Delete
}
[953] Fix | Delete
else if ($v_size > 2) {
[954] Fix | Delete
// ----- Error log
[955] Fix | Delete
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
[956] Fix | Delete
[957] Fix | Delete
// ----- Return
[958] Fix | Delete
return 0;
[959] Fix | Delete
}
[960] Fix | Delete
}
[961] Fix | Delete
}
[962] Fix | Delete
[963] Fix | Delete
// ----- Trace
[964] Fix | Delete
[965] Fix | Delete
// ----- Trick
[966] Fix | Delete
// Here I want to reuse extractByRule(), so I need to parse the $p_index
[967] Fix | Delete
// with privParseOptions()
[968] Fix | Delete
$v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index);
[969] Fix | Delete
$v_options_trick = array();
[970] Fix | Delete
$v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick,
[971] Fix | Delete
array (PCLZIP_OPT_BY_INDEX => 'optional' ));
[972] Fix | Delete
if ($v_result != 1) {
[973] Fix | Delete
return 0;
[974] Fix | Delete
}
[975] Fix | Delete
$v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];
[976] Fix | Delete
[977] Fix | Delete
// ----- Look for default option values
[978] Fix | Delete
$this->privOptionDefaultThreshold($v_options);
[979] Fix | Delete
[980] Fix | Delete
// ----- Call the extracting fct
[981] Fix | Delete
if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) {
[982] Fix | Delete
return(0);
[983] Fix | Delete
}
[984] Fix | Delete
[985] Fix | Delete
// ----- Return
[986] Fix | Delete
return $p_list;
[987] Fix | Delete
}
[988] Fix | Delete
// --------------------------------------------------------------------------------
[989] Fix | Delete
[990] Fix | Delete
// --------------------------------------------------------------------------------
[991] Fix | Delete
// Function :
[992] Fix | Delete
// delete([$p_option, $p_option_value, ...])
[993] Fix | Delete
// Description :
[994] Fix | Delete
// This method removes files from the archive.
[995] Fix | Delete
// If no parameters are given, then all the archive is emptied.
[996] Fix | Delete
// Parameters :
[997] Fix | Delete
// None or optional arguments.
[998] Fix | Delete
// Options :
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function