cvs: php4 /pear package-Archive_Tar.xml /pear/Archive Tar.php

From: Date: Mon, 27 May 2002 11:59:17 +0000
Subject: cvs: php4 /pear package-Archive_Tar.xml /pear/Archive Tar.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4140@lists.php.net to get a copy of this message
ssb Mon May 27 07:59:17 2002 EDT Modified files: /php4/pear package-Archive_Tar.xml /php4/pear/Archive Tar.php Log: * make Archive_Tar auto-detect whether zlib is needed based on file extension (.tar -> no zlib) Index: php4/pear/package-Archive_Tar.xml diff -u php4/pear/package-Archive_Tar.xml:1.5 php4/pear/package-Archive_Tar.xml:1.6 --- php4/pear/package-Archive_Tar.xml:1.5 Mon May 20 06:21:01 2002 +++ php4/pear/package-Archive_Tar.xml Mon May 27 07:59:06 2002 @@ -24,9 +24,9 @@ </maintainer> </maintainers> <release> - <version>0.4</version> - <date>2002-05-20</date> - <notes>Windows bugfix: use forward slashes inside archives</notes> + <version>0.5</version> + <date>2002-05-27</date> + <notes>Less dependant on the zlib extension</notes> <state>stable</state> <filelist> <dir name="Archive"> @@ -35,6 +35,12 @@ </filelist> </release> <changelog> + <release> + <version>0.4</version> + <date>2002-05-20</date> + <notes>Windows bugfix: use forward slashes inside archives</notes> + <state>stable</state> + </release> <release> <version>0.2</version> <date>2002-02-18</date> Index: php4/pear/Archive/Tar.php diff -u php4/pear/Archive/Tar.php:1.9 php4/pear/Archive/Tar.php:1.10 --- php4/pear/Archive/Tar.php:1.9 Mon May 20 05:05:45 2002 +++ php4/pear/Archive/Tar.php Mon May 27 07:59:09 2002 @@ -16,7 +16,7 @@ // | Author: Vincent Blavet <vincent@blavet.net> | // +----------------------------------------------------------------------+ // -// $Id: Tar.php,v 1.9 2002/05/20 09:05:45 ssb Exp $ +// $Id: Tar.php,v 1.10 2002/05/27 11:59:09 ssb Exp $ require_once 'PEAR.php'; @@ -24,7 +24,7 @@ * Creates a (compressed) Tar archive * * @author Vincent Blavet <vincent@blavet.net> -* @version $Revision: 1.9 $ +* @version $Revision: 1.10 $ * @package Archive */ class Archive_Tar extends PEAR @@ -61,15 +61,23 @@ * @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".

« previous php.pear.cvs (#4140) next »