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

PclZip::privDuplicate() public WP 1.0

Function : privDuplicate() Description : Parameters : Return Values :

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

Хуков нет.

Возвращает

Null. Ничего.

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

$PclZip = new PclZip();
$PclZip->privDuplicate( $p_archive_filename );

Код PclZip::privDuplicate() WP 5.5.1

wp-admin/includes/class-pclzip.php
<?php
function privDuplicate($p_archive_filename)
{
  $v_result=1;

  // ----- Look if the $p_archive_filename exists
  if (!is_file($p_archive_filename))
  {

    // ----- Nothing to duplicate, so duplicate is a success.
    $v_result = 1;

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

  // ----- Open the zip file
  if (($v_result=$this->privOpenFd('wb')) != 1)
  {
    // ----- Return
    return $v_result;
  }

  // ----- Open the temporary file in write mode
  if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0)
  {
    $this->privCloseFd();

    PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode');

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

  // ----- Copy the files from the archive to the temporary file
  // TBC : Here I should better append the file and go back to erase the central dir
  $v_size = filesize($p_archive_filename);
  while ($v_size != 0)
  {
    $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
    $v_buffer = fread($v_zip_temp_fd, $v_read_size);
    @fwrite($this->zip_fd, $v_buffer, $v_read_size);
    $v_size -= $v_read_size;
  }

  // ----- Close
  $this->privCloseFd();

  // ----- Close the temporary file
  @fclose($v_zip_temp_fd);

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