Skip to content

Commit

Permalink
Whitespace/naming fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrook committed Apr 4, 2019
1 parent d27ef96 commit 2801107
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions Archive/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Archive_Tar extends PEAR
/**
* @var int Length of the read buffer in bytes
*/
protected $length;
protected $buffer_length;

/**
* Archive_Tar Class constructor. This flavour of the constructor only
Expand All @@ -143,11 +143,11 @@ class Archive_Tar extends PEAR
* parameter indicates if gzip, bz2 or lzma2 compression
* is required. For compatibility reason the
* boolean value 'true' means 'gz'.
* @param int $length value to set to the {@link length} attribute
* @param int $buffer_length Length of the read buffer in bytes
*
* @return bool
*/
public function __construct($p_tarname, $p_compress = null, $length = 512)
public function __construct($p_tarname, $p_compress = null, $buffer_length = 512)
{
parent::__construct();

Expand Down Expand Up @@ -250,7 +250,7 @@ public function __construct($p_tarname, $p_compress = null, $length = 512)
}


$this->length = $length;
$this->buffer_length = $buffer_length;
}

public function __destruct()
Expand Down Expand Up @@ -1265,20 +1265,20 @@ public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $v_
return false;
}

while (($v_buffer = fread($v_file, $this->length)) != '') {
$buffer_length = strlen("$v_buffer");
if ($buffer_length != $this->length)
{
$pack_size = ((int)($buffer_length / 512) + 1) * 512;
$pack_format = sprintf('a%d', $pack_size);
}
else
{
$pack_format = sprintf('a%d', $this->length);
}
$v_binary_data = pack($pack_format, "$v_buffer");
$this->_writeBlock($v_binary_data);
}
while (($v_buffer = fread($v_file, $this->buffer_length)) != '') {
$buffer_length = strlen("$v_buffer");
if ($buffer_length != $this->buffer_length)
{
$pack_size = ((int)($buffer_length / 512) + 1) * 512;
$pack_format = sprintf('a%d', $pack_size);
}
else
{
$pack_format = sprintf('a%d', $this->buffer_length);
}
$v_binary_data = pack($pack_format, "$v_buffer");
$this->_writeBlock($v_binary_data);
}

fclose($v_file);
} else {
Expand Down

0 comments on commit 2801107

Please sign in to comment.