Code Duplication    Length = 7-11 lines in 6 locations

main/inc/lib/pclzip/pclzip.lib.php 6 locations

@@ 2270-2276 (lines=7) @@
2267
2268
    // ----- Copy the block of file headers from the old archive
2269
    $v_size = $v_central_dir['size'];
2270
    while ($v_size != 0)
2271
    {
2272
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
2273
      $v_buffer = @fread($v_zip_temp_fd, $v_read_size);
2274
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
2275
      $v_size -= $v_read_size;
2276
    }
2277
2278
    // ----- Create the Central Dir files header
2279
    for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)
@@ 2902-2909 (lines=8) @@
2899
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
2900
    fseek($v_file_compressed, 10);
2901
    $v_size = $p_header['compressed_size'];
2902
    while ($v_size != 0)
2903
    {
2904
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
2905
      $v_buffer = @fread($v_file_compressed, $v_read_size);
2906
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
2907
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
2908
      $v_size -= $v_read_size;
2909
    }
2910
2911
    // ----- Close the file
2912
    @fclose($v_file_compressed);
@@ 3860-3870 (lines=11) @@
3857
3858
          // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
3859
          $v_size = $p_entry['compressed_size'];
3860
          while ($v_size != 0)
3861
          {
3862
            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
3863
            $v_buffer = @fread($this->zip_fd, $v_read_size);
3864
            /* Try to speed up the code
3865
            $v_binary_data = pack('a'.$v_read_size, $v_buffer);
3866
            @fwrite($v_dest_file, $v_binary_data, $v_read_size);
3867
            */
3868
            @fwrite($v_dest_file, $v_buffer, $v_read_size);
3869
            $v_size -= $v_read_size;
3870
          }
3871
3872
          // ----- Closing the destination file
3873
          fclose($v_dest_file);
@@ 4005-4012 (lines=8) @@
4002
4003
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
4004
    $v_size = $p_entry['compressed_size'];
4005
    while ($v_size != 0)
4006
    {
4007
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
4008
      $v_buffer = @fread($this->zip_fd, $v_read_size);
4009
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
4010
      @fwrite($v_dest_file, $v_buffer, $v_read_size);
4011
      $v_size -= $v_read_size;
4012
    }
4013
4014
    // ----- Write gz file format footer
4015
    $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);
@@ 5181-5187 (lines=7) @@
5178
5179
    // ----- Copy the block of file headers from the old archive
5180
    $v_size = $v_central_dir['size'];
5181
    while ($v_size != 0)
5182
    {
5183
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
5184
      $v_buffer = @fread($this->zip_fd, $v_read_size);
5185
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
5186
      $v_size -= $v_read_size;
5187
    }
5188
5189
    // ----- Copy the block of file headers from the archive_to_add
5190
    $v_size = $v_central_dir_to_add['size'];
@@ 5191-5197 (lines=7) @@
5188
5189
    // ----- Copy the block of file headers from the archive_to_add
5190
    $v_size = $v_central_dir_to_add['size'];
5191
    while ($v_size != 0)
5192
    {
5193
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
5194
      $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
5195
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
5196
      $v_size -= $v_read_size;
5197
    }
5198
5199
    // ----- Merge the file comments
5200
    $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];