Skip to content

Commit

Permalink
regression fix pear archive_tar destructor not php7 compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Mar 7, 2017
1 parent a3b6e9b commit 6812b3f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions external/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function __construct($p_tarname, $p_compress = null)
// }}}

// {{{ destructor
function _Archive_Tar()
function __destruct ()
{
$this->_close();
// ----- Look for a local copy to delete
Expand Down Expand Up @@ -363,7 +363,7 @@ function addString($p_filename, $p_string)
}
$this->_close();
}

if (!$this->_openAppend())
return false;

Expand Down Expand Up @@ -676,7 +676,7 @@ function _readBlock($p_len=null)
if ($this->_file) {
if ($p_len === null)
$p_len = 512;

if ($this->_compress_type == 'gz')
$v_block = @gzread($this->_file, 512);
else if ($this->_compress_type == 'bz2')
Expand Down Expand Up @@ -1417,7 +1417,7 @@ function _openAppend()
{
if (filesize($this->_tarname) == 0)
return $this->_openWrite();

if ($this->_compress) {
$this->_close();

Expand All @@ -1430,7 +1430,7 @@ function _openAppend()
$v_temp_tar = @gzopen($this->_tarname.".tmp", "rb");
elseif ($this->_compress_type == 'bz2')
$v_temp_tar = @bzopen($this->_tarname.".tmp", "rb");

if ($v_temp_tar == 0) {
$this->_error('Unable to open file \''.$this->_tarname.'.tmp\' in binary read mode');
@rename($this->_tarname.".tmp", $this->_tarname);
Expand Down Expand Up @@ -1493,7 +1493,7 @@ function _append($p_filelist, $p_add_dir='', $p_remove_dir='')
{
if (!$this->_openAppend())
return false;

if ($this->_addList($p_filelist, $p_add_dir, $p_remove_dir))
$this->_writeFooter();

Expand Down

0 comments on commit 6812b3f

Please sign in to comment.