Code Duplication    Length = 7-11 lines in 6 locations

app/Vendor/PHPExcel/PHPExcel/Shared/PCLZip/pclzip.lib.php 6 locations

@@ 2250-2256 (lines=7) @@
2247
2248
    // ----- Copy the block of file headers from the old archive
2249
    $v_size = $v_central_dir['size'];
2250
    while ($v_size != 0)
2251
    {
2252
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
2253
      $v_buffer = @fread($v_zip_temp_fd, $v_read_size);
2254
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
2255
      $v_size -= $v_read_size;
2256
    }
2257
2258
    // ----- Create the Central Dir files header
2259
    for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)
@@ 2882-2889 (lines=8) @@
2879
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
2880
    fseek($v_file_compressed, 10);
2881
    $v_size = $p_header['compressed_size'];
2882
    while ($v_size != 0)
2883
    {
2884
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
2885
      $v_buffer = @fread($v_file_compressed, $v_read_size);
2886
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
2887
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
2888
      $v_size -= $v_read_size;
2889
    }
2890
2891
    // ----- Close the file
2892
    @fclose($v_file_compressed);
@@ 3840-3850 (lines=11) @@
3837
3838
          // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
3839
          $v_size = $p_entry['compressed_size'];
3840
          while ($v_size != 0)
3841
          {
3842
            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
3843
            $v_buffer = @fread($this->zip_fd, $v_read_size);
3844
            /* Try to speed up the code
3845
            $v_binary_data = pack('a'.$v_read_size, $v_buffer);
3846
            @fwrite($v_dest_file, $v_binary_data, $v_read_size);
3847
            */
3848
            @fwrite($v_dest_file, $v_buffer, $v_read_size);            
3849
            $v_size -= $v_read_size;
3850
          }
3851
3852
          // ----- Closing the destination file
3853
          fclose($v_dest_file);
@@ 3985-3992 (lines=8) @@
3982
3983
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
3984
    $v_size = $p_entry['compressed_size'];
3985
    while ($v_size != 0)
3986
    {
3987
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
3988
      $v_buffer = @fread($this->zip_fd, $v_read_size);
3989
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
3990
      @fwrite($v_dest_file, $v_buffer, $v_read_size);
3991
      $v_size -= $v_read_size;
3992
    }
3993
3994
    // ----- Write gz file format footer
3995
    $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);
@@ 5154-5160 (lines=7) @@
5151
5152
    // ----- Copy the block of file headers from the old archive
5153
    $v_size = $v_central_dir['size'];
5154
    while ($v_size != 0)
5155
    {
5156
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
5157
      $v_buffer = @fread($this->zip_fd, $v_read_size);
5158
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
5159
      $v_size -= $v_read_size;
5160
    }
5161
5162
    // ----- Copy the block of file headers from the archive_to_add
5163
    $v_size = $v_central_dir_to_add['size'];
@@ 5164-5170 (lines=7) @@
5161
5162
    // ----- Copy the block of file headers from the archive_to_add
5163
    $v_size = $v_central_dir_to_add['size'];
5164
    while ($v_size != 0)
5165
    {
5166
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
5167
      $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
5168
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
5169
      $v_size -= $v_read_size;
5170
    }
5171
5172
    // ----- Merge the file comments
5173
    $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];