Skip to content

Commit

Permalink
Merge pull request #17 from greg-1-anderson/composer-fix
Browse files Browse the repository at this point in the history
Fix PEAR.php loading for Composer custom installers
  • Loading branch information
mrook committed Feb 25, 2016
2 parents cd317da + 3fb166d commit ad83a76
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Archive/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
* @link http://pear.php.net/package/Archive_Tar
*/

require_once 'PEAR.php';
// If the PEAR class cannot be loaded via the autoloader,
// then try to require_once it from the PHP include path.
if (!class_exists('PEAR')) {
require_once 'PEAR.php';
}

define('ARCHIVE_TAR_ATT_SEPARATOR', 90001);
define('ARCHIVE_TAR_END_BLOCK', pack("a512", ''));
Expand Down Expand Up @@ -139,7 +143,7 @@ class Archive_Tar extends PEAR
public function __construct($p_tarname, $p_compress = null)
{
parent::__construct();

$this->_compress = false;
$this->_compress_type = 'none';
if (($p_compress === null) || ($p_compress == '')) {
Expand Down Expand Up @@ -238,7 +242,7 @@ public function __construct($p_tarname, $p_compress = null)
"Z32uname/Z32gname/Z8devmajor/Z8devminor/Z131prefix";
}


}

public function __destruct()
Expand Down

0 comments on commit ad83a76

Please sign in to comment.