From f3c5fea7a462c00780520a6a3e00dbd6aa19bfb9 Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Mon, 27 May 2002 11:59:09 +0000 Subject: [PATCH] * make Archive_Tar auto-detect whether zlib is needed based on file extension (.tar -> no zlib) --- pear/Archive/Tar.php | 14 +++++++++++--- pear/package-Archive_Tar.xml | 12 +++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/pear/Archive/Tar.php b/pear/Archive/Tar.php index b577fef959..86bf0ee07a 100644 --- a/pear/Archive/Tar.php +++ b/pear/Archive/Tar.php @@ -61,15 +61,23 @@ class Archive_Tar extends PEAR * @param boolean $p_compress if true, the archive will be gezip(ped) * @access public */ - function Archive_Tar($p_tarname, $p_compress = false) + function Archive_Tar($p_tarname, $p_compress = null) { $this->PEAR(); + if ($p_compress === null) { + if (substr($p_tarname, -4) == '.tar') { + $p_compress = false; + } + } $this->_tarname = $p_tarname; if ($p_compress) { // assert zlib extension support $extname = 'zlib'; if (!extension_loaded($extname)) { - $dlext = (OS_WINDOWS) ? '.dll' : '.so'; - @dl($extname . $dlext); + if (OS_WINDOWS) { + @dl("php_$extname.dll"); + } else { + @dl("$extname.so"); + } } if (!extension_loaded($extname)) { die("The extension '$extname' couldn't be found.\n". diff --git a/pear/package-Archive_Tar.xml b/pear/package-Archive_Tar.xml index c74e0fa21c..4fbb2191f4 100644 --- a/pear/package-Archive_Tar.xml +++ b/pear/package-Archive_Tar.xml @@ -24,9 +24,9 @@ loaded. - 0.4 - 2002-05-20 - Windows bugfix: use forward slashes inside archives + 0.5 + 2002-05-27 + Less dependant on the zlib extension stable @@ -35,6 +35,12 @@ loaded. + + 0.4 + 2002-05-20 + Windows bugfix: use forward slashes inside archives + stable + 0.2 2002-02-18 -- 2.40.0