From 2801107ca5c29a887874343c46d62bae81c4424b Mon Sep 17 00:00:00 2001 From: Michiel Rook Date: Thu, 4 Apr 2019 11:12:08 +0200 Subject: [PATCH] Whitespace/naming fixes --- Archive/Tar.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Archive/Tar.php b/Archive/Tar.php index 95ef55a..12aab63 100644 --- a/Archive/Tar.php +++ b/Archive/Tar.php @@ -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 @@ -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(); @@ -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() @@ -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 {