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

PclZip::privFileDescrExpand() public WP 1.0

Function : privFileDescrExpand() Description : This method look for each item of the list to see if its a file, a folder or a string to be added as file. For any other type of files (link, other) just ignore the item. Then prepare the information that will be stored for that file. When its a folder, expand the folder with all the files that are in that folder (recursively). Parameters : Return Values :
1 on success.
0 on failure.

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

Хуков нет.

Возвращает

Null. Ничего.

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

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

Код PclZip::privFileDescrExpand() WP 5.5.1

wp-admin/includes/class-pclzip.php
<?php
function privFileDescrExpand(&$p_filedescr_list, &$p_options)
{
  $v_result=1;

  // ----- Create a result list
  $v_result_list = array();

  // ----- Look each entry
  for ($i=0; $i<sizeof($p_filedescr_list); $i++) {

    // ----- Get filedescr
    $v_descr = $p_filedescr_list[$i];

    // ----- Reduce the filename
    $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false);
    $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);

    // ----- Look for real file or folder
    if (file_exists($v_descr['filename'])) {
      if (@is_file($v_descr['filename'])) {
        $v_descr['type'] = 'file';
      }
      else if (@is_dir($v_descr['filename'])) {
        $v_descr['type'] = 'folder';
      }
      else if (@is_link($v_descr['filename'])) {
        // skip
        continue;
      }
      else {
        // skip
        continue;
      }
    }

    // ----- Look for string added as file
    else if (isset($v_descr['content'])) {
      $v_descr['type'] = 'virtual_file';
    }

    // ----- Missing file
    else {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$v_descr['filename']."' does not exist");

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Calculate the stored filename
    $this->privCalculateStoredFilename($v_descr, $p_options);

    // ----- Add the descriptor in result list
    $v_result_list[sizeof($v_result_list)] = $v_descr;

    // ----- Look for folder
    if ($v_descr['type'] == 'folder') {
      // ----- List of items in folder
      $v_dirlist_descr = array();
      $v_dirlist_nb = 0;
      if ($v_folder_handler = @opendir($v_descr['filename'])) {
        while (($v_item_handler = @readdir($v_folder_handler)) !== false) {

          // ----- Skip '.' and '..'
          if (($v_item_handler == '.') || ($v_item_handler == '..')) {
              continue;
          }

          // ----- Compose the full filename
          $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;

          // ----- Look for different stored filename
          // Because the name of the folder was changed, the name of the
          // files/sub-folders also change
          if (($v_descr['stored_filename'] != $v_descr['filename'])
               && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) {
            if ($v_descr['stored_filename'] != '') {
              $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
            }
            else {
              $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;
            }
          }

          $v_dirlist_nb++;
        }

        @closedir($v_folder_handler);
      }
      else {
        // TBC : unable to open folder in read mode
      }

      // ----- Expand each element of the list
      if ($v_dirlist_nb != 0) {
        // ----- Expand
        if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) {
          return $v_result;
        }

        // ----- Concat the resulting list
        $v_result_list = array_merge($v_result_list, $v_dirlist_descr);
      }
      else {
      }

      // ----- Free local array
      unset($v_dirlist_descr);
    }
  }

  // ----- Get the result list
  $p_filedescr_list = $v_result_list;

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