WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

PclZip::privAddFileList() public WP 1.0

Function : privAddFileList() Description : Parameters : $p_filedescr_list : An array containing the file description or directory names to add in the zip $p_result_list : list of added files with their properties (specially the status field) Return Values :

Это метод класса: PclZip{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$PclZip = new PclZip();
$PclZip->privAddFileList( $p_filedescr_list, $p_result_list, $p_options );

Код PclZip::privAddFileList: wp-admin/includes/class-pclzip.php WP 5.5.1

<?php
function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options)
{
  $v_result=1;
  $v_header = array();

  // ----- Recuperate the current number of elt in list
  $v_nb = sizeof($p_result_list);

  // ----- Loop on the files
  for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) {
    // ----- Format the filename
    $p_filedescr_list[$j]['filename']
    = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);


    // ----- Skip empty file names
    // TBC : Can this be possible ? not checked in DescrParseAtt ?
    if ($p_filedescr_list[$j]['filename'] == "") {
      continue;
    }

    // ----- Check the filename
    if (   ($p_filedescr_list[$j]['type'] != 'virtual_file')
        && (!file_exists($p_filedescr_list[$j]['filename']))) {
      PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exist");
      return PclZip::errorCode();
    }

    // ----- Look if it is a file or a dir with no all path remove option
    // or a dir with all its path removed
//      if (   (is_file($p_filedescr_list[$j]['filename']))
//          || (   is_dir($p_filedescr_list[$j]['filename'])
    if (   ($p_filedescr_list[$j]['type'] == 'file')
        || ($p_filedescr_list[$j]['type'] == 'virtual_file')
        || (   ($p_filedescr_list[$j]['type'] == 'folder')
            && (   !isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])
                || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))
        ) {

      // ----- Add the file
      $v_result = $this->privAddFile($p_filedescr_list[$j], $v_header,
                                     $p_options);
      if ($v_result != 1) {
        return $v_result;
      }

      // ----- Store the file infos
      $p_result_list[$v_nb++] = $v_header;
    }
  }

  // ----- Return
  return $v_result;
}