<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=Archive_Tar</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/16759" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13322" />
      <rdf:li rdf:resource="http://pear.php.net/bug/11258" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10589" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10145" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9520" />
      <rdf:li rdf:resource="http://pear.php.net/bug/4013" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/16759">
      <title>Archive_Tar: Bug 16759 [Assigned] No error thrown from missing PHP zlib functions</title>
      <link>http://pear.php.net/bugs/16759</link>
      <content:encoded><![CDATA[<pre>Archive_Tar Bug
Reported by bergie
2009-11-02T15:12:51+00:00
PHP: 5.2.5 OS: Ubuntu 9.10 Package Version: 1.3.3

Description:
------------
I tried to install PEAR packages on Ubuntu 9.10, but as there PHP comes without zlib (see https://bugs.launchpad.net/ubuntu/+source/php5/+bug/451405), Archive_Tar cannot open the packages.

But as the zlib functions are run in silent mode this doesn't throw any errors, making in look like install succeeded. Some error should be thrown if the function cannot be found!

Archive_Tar line 658: is the issue here
        if ($this-&gt;_compress_type == 'gz')
            $this-&gt;_file = @gzopen($v_filename, &quot;rb&quot;);</pre>]]></content:encoded>
      <description><![CDATA[<pre>Archive_Tar Bug
Reported by bergie
2009-11-02T15:12:51+00:00
PHP: 5.2.5 OS: Ubuntu 9.10 Package Version: 1.3.3

Description:
------------
I tried to install PEAR packages on Ubuntu 9.10, but as there PHP comes without zlib (see https://bugs.launchpad.net/ubuntu/+source/php5/+bug/451405), Archive_Tar cannot open the packages.

But as the zlib functions are run in silent mode this doesn't throw any errors, making in look like install succeeded. Some error should be thrown if the function cannot be found!

Archive_Tar line 658: is the issue here
        if ($this-&gt;_compress_type == 'gz')
            $this-&gt;_file = @gzopen($v_filename, &quot;rb&quot;);</pre>]]></description>
      <dc:date>2009-11-25T20:41:23+00:00</dc:date>
      <dc:creator>bergie &amp;#x61;&amp;#116; iki &amp;#x64;&amp;#111;&amp;#x74; fi</dc:creator>
      <dc:subject>Archive_Tar Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13322">
      <title>Archive_Tar: Bug 13322 [Assigned] Extracting of archive containing symlinks fails</title>
      <link>http://pear.php.net/bugs/13322</link>
      <content:encoded><![CDATA[<pre>Archive_Tar Bug
Reported by pascal
2008-03-06T02:43:19+00:00
PHP: 5.2.0 OS: Windows Package Version: 1.3.2

Description:
------------
Extracting a .tar.gz archive containing zero-size file fails. Extraction stops when a zero-size file is encountered (so the extraction only partially succeeds).</pre>]]></content:encoded>
      <description><![CDATA[<pre>Archive_Tar Bug
Reported by pascal
2008-03-06T02:43:19+00:00
PHP: 5.2.0 OS: Windows Package Version: 1.3.2

Description:
------------
Extracting a .tar.gz archive containing zero-size file fails. Extraction stops when a zero-size file is encountered (so the extraction only partially succeeds).</pre>]]></description>
      <dc:date>2009-08-11T19:34:08+00:00</dc:date>
      <dc:creator>pascal &amp;#x64;&amp;#111;&amp;#x74; vogels &amp;#x61;&amp;#116; philips &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Archive_Tar Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/11258">
      <title>Archive_Tar: Feature/Change Request 11258 [Open] Custom date/time in files added on-the-fly</title>
      <link>http://pear.php.net/bugs/11258</link>
      <content:encoded><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by dot
2007-06-09T12:10:36+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.3.2

Description:
------------
In some particular situations it is useful, if you can specify the modification date/time yourself. When taring existing files you can change those files' dates, but while creating files on-the-fly they use current date/time (in 1.3.1 they were created with 0 timestamp). My proposition is to add this functionality to next version of Archive_Tar package. I have created a patch adding this feature to Tar.php file.

For example when you keep your files in a database, or modify the files from disk before sending them to user, and want to send tar package of several files at once, you might want to tar them using original modification date/time.

Included diff file is a difference between original Archive_Tar 1.3.2 and version modified by me including this feature. It is fully backward-compatible, as added parameter $p_datetime is set to false by default and while false is provided it is interpreted the same way as original Tar.php.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by dot
2007-06-09T12:10:36+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.3.2

Description:
------------
In some particular situations it is useful, if you can specify the modification date/time yourself. When taring existing files you can change those files' dates, but while creating files on-the-fly they use current date/time (in 1.3.1 they were created with 0 timestamp). My proposition is to add this functionality to next version of Archive_Tar package. I have created a patch adding this feature to Tar.php file.

For example when you keep your files in a database, or modify the files from disk before sending them to user, and want to send tar package of several files at once, you might want to tar them using original modification date/time.

Included diff file is a difference between original Archive_Tar 1.3.2 and version modified by me including this feature. It is fully backward-compatible, as added parameter $p_datetime is set to false by default and while false is provided it is interpreted the same way as original Tar.php.</pre>]]></description>
      <dc:date>2007-06-09T12:10:36+00:00</dc:date>
      <dc:creator>adam &amp;#x61;&amp;#116; pilorz &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Archive_Tar Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10589">
      <title>Archive_Tar: Feature/Change Request 10589 [Open] Patch: allows to exclude files/directories when an archive is created</title>
      <link>http://pear.php.net/bugs/10589</link>
      <content:encoded><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by lucor
2007-04-02T10:34:08+00:00
PHP: Irrelevant OS:  Package Version: 1.3.2

Description:
------------
This patch allows to exclude files/directories when an archive is created.

Test script:
---------------
--- Tar.php.1.3.2       2007-04-02 17:25:46.000000000 +0200
+++ Tar.php     2007-04-02 17:25:53.000000000 +0200
@@ -265,14 +265,17 @@
     * @param string $p_remove_dir   A string which contains a path to be
        *                               removed from the memorized path of each
        *                               element in the list, when relevant.
+       * @param array $exclude_filelist  An array which contains the filenames and directory names to exclude
     * @return boolean               true on success, false on error.
     * @access public
     * @see addModify()
     */
-    function createModify($p_filelist, $p_add_dir, $p_remove_dir='')
+    function createModify($p_filelist, $p_add_dir, $p_remove_dir='', $exclude_file_list=array())
     {
         $v_result = true;
-
+               if ($exclude_file_list=='')
+                       $exclude_file_list = array();
+
         if (!$this-&gt;_openWrite())
             return false;

@@ -287,7 +290,7 @@
                 return false;
             }

-            $v_result = $this-&gt;_addList($v_list, $p_add_dir, $p_remove_dir);
+            $v_result = $this-&gt;_addList($v_list, $p_add_dir, $p_remove_dir,$exclude_file_list);
         }

         if ($v_result) {
@@ -836,7 +839,7 @@
     // }}}

     // {{{ _addList()
-    function _addList($p_list, $p_add_dir, $p_remove_dir)
+    function _addList($p_list, $p_add_dir, $p_remove_dir, $exclude_file_list)
     {
       $v_result=true;
       $v_header = array();
@@ -857,11 +860,14 @@
           if (!$v_result) {
               break;
           }
-
+
         // ----- Skip the current tar name
         if ($v_filename == $this-&gt;_tarname)
             continue;
-
+
+               if (in_array(basename($v_filename),$exclude_file_list))
+            continue;
+
         if ($v_filename == '')
             continue;

@@ -888,7 +894,8 @@

                     $v_result = $this-&gt;_addList($p_temp_list,
                                                                    $p_add_dir,
-                                                                                               $p_remove_dir);
+                                                                                               $p_remove_dir,
+                                                                                               $exclude_file_list);
                 }
             }</pre>]]></content:encoded>
      <description><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by lucor
2007-04-02T10:34:08+00:00
PHP: Irrelevant OS:  Package Version: 1.3.2

Description:
------------
This patch allows to exclude files/directories when an archive is created.

Test script:
---------------
--- Tar.php.1.3.2       2007-04-02 17:25:46.000000000 +0200
+++ Tar.php     2007-04-02 17:25:53.000000000 +0200
@@ -265,14 +265,17 @@
     * @param string $p_remove_dir   A string which contains a path to be
        *                               removed from the memorized path of each
        *                               element in the list, when relevant.
+       * @param array $exclude_filelist  An array which contains the filenames and directory names to exclude
     * @return boolean               true on success, false on error.
     * @access public
     * @see addModify()
     */
-    function createModify($p_filelist, $p_add_dir, $p_remove_dir='')
+    function createModify($p_filelist, $p_add_dir, $p_remove_dir='', $exclude_file_list=array())
     {
         $v_result = true;
-
+               if ($exclude_file_list=='')
+                       $exclude_file_list = array();
+
         if (!$this-&gt;_openWrite())
             return false;

@@ -287,7 +290,7 @@
                 return false;
             }

-            $v_result = $this-&gt;_addList($v_list, $p_add_dir, $p_remove_dir);
+            $v_result = $this-&gt;_addList($v_list, $p_add_dir, $p_remove_dir,$exclude_file_list);
         }

         if ($v_result) {
@@ -836,7 +839,7 @@
     // }}}

     // {{{ _addList()
-    function _addList($p_list, $p_add_dir, $p_remove_dir)
+    function _addList($p_list, $p_add_dir, $p_remove_dir, $exclude_file_list)
     {
       $v_result=true;
       $v_header = array();
@@ -857,11 +860,14 @@
           if (!$v_result) {
               break;
           }
-
+
         // ----- Skip the current tar name
         if ($v_filename == $this-&gt;_tarname)
             continue;
-
+
+               if (in_array(basename($v_filename),$exclude_file_list))
+            continue;
+
         if ($v_filename == '')
             continue;

@@ -888,7 +894,8 @@

                     $v_result = $this-&gt;_addList($p_temp_list,
                                                                    $p_add_dir,
-                                                                                               $p_remove_dir);
+                                                                                               $p_remove_dir,
+                                                                                               $exclude_file_list);
                 }
             }</pre>]]></description>
      <dc:date>2007-04-02T10:34:08+00:00</dc:date>
      <dc:creator>lu &amp;#x64;&amp;#111;&amp;#x74; corbo &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Archive_Tar Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10145">
      <title>Archive_Tar: Feature/Change Request 10145 [Open] Patch to return a Pear Error Object on failure</title>
      <link>http://pear.php.net/bugs/10145</link>
      <content:encoded><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by lucor
2007-02-21T10:22:41+00:00
PHP: Irrelevant OS:  Package Version: 1.3.2

Description:
------------
This patch allows to return a Pear Error Object on failure

Test script:
---------------
--- Tar.php.orig        2007-02-21 15:23:10.000000000 +0100
+++ Tar.php     2007-02-21 15:22:23.000000000 +0100
@@ -62,6 +62,11 @@
     * @var string Local Tar name of a remote Tar (http:// or ftp://)
     */
     var $_temp_tarname='';
+
+    /**
+    * @var object PEAR_Error object
+    */
+    var $error_object=NULL;

     // {{{ constructor
     /**
@@ -569,11 +574,14 @@
     // {{{ _error()
     function _error($p_message)
     {
-        // ----- To be completed
-        $this-&gt;raiseError($p_message);
+       if (isset($this) &amp;&amp; is_a($this, 'PEAR')) {
+            $this-&gt;error_object = &amp;$this-&gt;raiseError($p_message, null, null, null, null);
+        } else {
+            $this-&gt;error_object = &amp;PEAR::raiseError($p_message, null, null, null, null);
+        }
     }
     // }}}
-
+
     // {{{ _warning()
     function _warning($p_message)
     {</pre>]]></content:encoded>
      <description><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by lucor
2007-02-21T10:22:41+00:00
PHP: Irrelevant OS:  Package Version: 1.3.2

Description:
------------
This patch allows to return a Pear Error Object on failure

Test script:
---------------
--- Tar.php.orig        2007-02-21 15:23:10.000000000 +0100
+++ Tar.php     2007-02-21 15:22:23.000000000 +0100
@@ -62,6 +62,11 @@
     * @var string Local Tar name of a remote Tar (http:// or ftp://)
     */
     var $_temp_tarname='';
+
+    /**
+    * @var object PEAR_Error object
+    */
+    var $error_object=NULL;

     // {{{ constructor
     /**
@@ -569,11 +574,14 @@
     // {{{ _error()
     function _error($p_message)
     {
-        // ----- To be completed
-        $this-&gt;raiseError($p_message);
+       if (isset($this) &amp;&amp; is_a($this, 'PEAR')) {
+            $this-&gt;error_object = &amp;$this-&gt;raiseError($p_message, null, null, null, null);
+        } else {
+            $this-&gt;error_object = &amp;PEAR::raiseError($p_message, null, null, null, null);
+        }
     }
     // }}}
-
+
     // {{{ _warning()
     function _warning($p_message)
     {</pre>]]></description>
      <dc:date>2007-04-18T22:06:00+00:00</dc:date>
      <dc:creator>lu &amp;#x64;&amp;#111;&amp;#x74; corbo &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Archive_Tar Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9520">
      <title>Archive_Tar: Feature/Change Request 9520 [Open] Doesn't allow in-memory manipulation of tar files</title>
      <link>http://pear.php.net/bugs/9520</link>
      <content:encoded><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by cbutler@...
2006-12-01T11:20:38+00:00
PHP: Irrelevant OS: Linux Package Version: 1.3.1

Description:
------------
It would be nice if Archive_Tar was able to manipulate tar archives in memory rather than writing to disk all the time. For example, if you want to create a tar archive and send it straight to the browser, you don't need to save it to disk.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by cbutler@...
2006-12-01T11:20:38+00:00
PHP: Irrelevant OS: Linux Package Version: 1.3.1

Description:
------------
It would be nice if Archive_Tar was able to manipulate tar archives in memory rather than writing to disk all the time. For example, if you want to create a tar archive and send it straight to the browser, you don't need to save it to disk.</pre>]]></description>
      <dc:date>2006-12-01T11:20:38+00:00</dc:date>
      <dc:creator>cbutler &amp;#x61;&amp;#116; technophobia &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>Archive_Tar Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/4013">
      <title>Archive_Tar: Feature/Change Request 4013 [Open] Ignoring files and directories on creating an archive.</title>
      <link>http://pear.php.net/bugs/4013</link>
      <content:encoded><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by roth@...
2005-03-31T02:13:05+00:00
PHP: 5.0.3 OS: Linux Package Version: 

Description:
------------
Version 1.3.1

I added the functionality to define a regular expression that describes files and directories that should be ignored when creating an archive with Archive_Tar. Full Downgrade compatibility.

Patch:
Index: Archive_Tar/Archive/Tar.php
===================================================================
--- Archive_Tar/Archive/Tar.php	(revision 11325)
+++ Archive_Tar/Archive/Tar.php	(working copy)
@@ -62,6 +62,11 @@
     */
     var $_temp_tarname='';
 
+    /**
+    * @var string regular expression for ignoring files or directories
+    */
+    var $_ignore_regexp='';
+
     // {{{ constructor
     /**
     * Archive_Tar Class constructor. This flavour of the constructor only
@@ -545,6 +550,36 @@
     }
     // }}}
 
+    // {{{ setIgnoreRegexp()
+    /**
+    * This method sets the regular expression for ignoring files and directories
+    * at import, for example:
+    * $arch-&gt;setIgnoreRegexp(&quot;#CVS|\.svn#&quot;);
+    * @param string $regexp         regular expression defining which files or directories to ignore
+    * @access public
+    */
+    function setIgnoreRegexp($regexp)
+    {
+    	$this-&gt;_ignore_regexp = $regexp;
+    }
+    // }}}
+
+    // {{{ setIgnoreList()
+    /**
+    * This method sets the regular expression for ignoring all files and directories
+    * matching the filenames in the array list at import, for example:
+    * $arch-&gt;setIgnoreList(array('CVS', '.svn', 'bin/tool'));
+    * @param array $list         a list of file or directory names to ignore
+    * @access public
+    */
+    function setIgnoreList($list)
+    {
+    	$regexp = str_replace(array('#', '.', '^', '$'), array('\#', '\.', '\^', '\$'), $list);
+    	$regexp = '#/'.join('$|/', $list).'#';
+    	$this-&gt;setIgnoreRegexp($regexp);
+    }
+    // }}}
+
     // {{{ _error()
     function _error($p_message)
     {
@@ -814,6 +849,12 @@
         if ($v_filename == '')
             continue;
 
+       	// ----- ignore files and directories matching the ignore regular expression
+       	if ($this-&gt;_ignore_regexp &amp;&amp; preg_match($this-&gt;_ignore_regexp, '/'.$v_filename)) {
+            $this-&gt;_warning(&quot;File '$v_filename' ignored&quot;);
+       	    continue;
+       	}
+
         if (!file_exists($v_filename)) {
             $this-&gt;_warning(&quot;File '$v_filename' does not exist&quot;);
             continue;</pre>]]></content:encoded>
      <description><![CDATA[<pre>Archive_Tar Feature/Change Request
Reported by roth@...
2005-03-31T02:13:05+00:00
PHP: 5.0.3 OS: Linux Package Version: 

Description:
------------
Version 1.3.1

I added the functionality to define a regular expression that describes files and directories that should be ignored when creating an archive with Archive_Tar. Full Downgrade compatibility.

Patch:
Index: Archive_Tar/Archive/Tar.php
===================================================================
--- Archive_Tar/Archive/Tar.php	(revision 11325)
+++ Archive_Tar/Archive/Tar.php	(working copy)
@@ -62,6 +62,11 @@
     */
     var $_temp_tarname='';
 
+    /**
+    * @var string regular expression for ignoring files or directories
+    */
+    var $_ignore_regexp='';
+
     // {{{ constructor
     /**
     * Archive_Tar Class constructor. This flavour of the constructor only
@@ -545,6 +550,36 @@
     }
     // }}}
 
+    // {{{ setIgnoreRegexp()
+    /**
+    * This method sets the regular expression for ignoring files and directories
+    * at import, for example:
+    * $arch-&gt;setIgnoreRegexp(&quot;#CVS|\.svn#&quot;);
+    * @param string $regexp         regular expression defining which files or directories to ignore
+    * @access public
+    */
+    function setIgnoreRegexp($regexp)
+    {
+    	$this-&gt;_ignore_regexp = $regexp;
+    }
+    // }}}
+
+    // {{{ setIgnoreList()
+    /**
+    * This method sets the regular expression for ignoring all files and directories
+    * matching the filenames in the array list at import, for example:
+    * $arch-&gt;setIgnoreList(array('CVS', '.svn', 'bin/tool'));
+    * @param array $list         a list of file or directory names to ignore
+    * @access public
+    */
+    function setIgnoreList($list)
+    {
+    	$regexp = str_replace(array('#', '.', '^', '$'), array('\#', '\.', '\^', '\$'), $list);
+    	$regexp = '#/'.join('$|/', $list).'#';
+    	$this-&gt;setIgnoreRegexp($regexp);
+    }
+    // }}}
+
     // {{{ _error()
     function _error($p_message)
     {
@@ -814,6 +849,12 @@
         if ($v_filename == '')
             continue;
 
+       	// ----- ignore files and directories matching the ignore regular expression
+       	if ($this-&gt;_ignore_regexp &amp;&amp; preg_match($this-&gt;_ignore_regexp, '/'.$v_filename)) {
+            $this-&gt;_warning(&quot;File '$v_filename' ignored&quot;);
+       	    continue;
+       	}
+
         if (!file_exists($v_filename)) {
             $this-&gt;_warning(&quot;File '$v_filename' does not exist&quot;);
             continue;</pre>]]></description>
      <dc:date>2005-03-31T02:13:05+00:00</dc:date>
      <dc:creator>roth &amp;#x61;&amp;#116; egotec &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Archive_Tar Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
