<?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=File_Archive</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/16461" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15673" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14622" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14621" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14559" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14547" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12617" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10219" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10144" />
      <rdf:li rdf:resource="http://pear.php.net/bug/6546" />

     </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/16461">
      <title>File_Archive: Bug 16461 [Open] Error for large file sizes (over 3.5Mb)</title>
      <link>http://pear.php.net/bugs/16461</link>
      <content:encoded><![CDATA[<pre>File_Archive Bug
Reported by samudradaka
2009-07-22T10:46:32+00:00
PHP: 5.1.2 OS: linux apache server Package Version: 1.5.4

Description:
------------
I am using File_Archive (with Cache_lite) to create zip files of files uploaded to my server (Apache / Ubuntu).

The code i'm using works fine for files up to around 3.5Mb but file sizes over that fail.

Not sure if this is due to limitations with the package or with my server settings. The server works fine for large HTTP uploads.

Test script:
---------------
&lt;?php
require_once &quot;File/Archive.php&quot;;
require_once &quot;Cache/Lite.php&quot;;
echo &quot;&lt;p&gt;Begin Zipping File&lt;/p&gt;&quot;;
$cache = new Cache_Lite(array('cacheDir' =&gt; 'tmp'));
File_Archive::setOption('cache', $cache);
File_Archive::setOption('zipCompressionLevel', 9);
$getfiles = array('upload-test.mp3');
$zipfolder = &quot;test.zip&quot;;
File_Archive::extract(
    $src = $getfiles,
    $dest= $zipfolder
    //$bufferSize = 100000000000000
);
echo &quot;&lt;p&gt;File Zipped Successfully&lt;/p&gt;&quot;;
$cache-&gt;clean();
?&gt; 

Expected result:
----------------
Begin Zipping File

File Zipped Successfully

Actual result:
--------------
Begin Zipping File

(script fails for files over 3.5Mb before reaching final echo statement)</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Bug
Reported by samudradaka
2009-07-22T10:46:32+00:00
PHP: 5.1.2 OS: linux apache server Package Version: 1.5.4

Description:
------------
I am using File_Archive (with Cache_lite) to create zip files of files uploaded to my server (Apache / Ubuntu).

The code i'm using works fine for files up to around 3.5Mb but file sizes over that fail.

Not sure if this is due to limitations with the package or with my server settings. The server works fine for large HTTP uploads.

Test script:
---------------
&lt;?php
require_once &quot;File/Archive.php&quot;;
require_once &quot;Cache/Lite.php&quot;;
echo &quot;&lt;p&gt;Begin Zipping File&lt;/p&gt;&quot;;
$cache = new Cache_Lite(array('cacheDir' =&gt; 'tmp'));
File_Archive::setOption('cache', $cache);
File_Archive::setOption('zipCompressionLevel', 9);
$getfiles = array('upload-test.mp3');
$zipfolder = &quot;test.zip&quot;;
File_Archive::extract(
    $src = $getfiles,
    $dest= $zipfolder
    //$bufferSize = 100000000000000
);
echo &quot;&lt;p&gt;File Zipped Successfully&lt;/p&gt;&quot;;
$cache-&gt;clean();
?&gt; 

Expected result:
----------------
Begin Zipping File

File Zipped Successfully

Actual result:
--------------
Begin Zipping File

(script fails for files over 3.5Mb before reaching final echo statement)</pre>]]></description>
      <dc:date>2009-07-22T14:12:51+00:00</dc:date>
      <dc:creator>samudradaka &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>File_Archive Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15673">
      <title>File_Archive: Bug 15673 [Open] Directories in root of zip file are ignored.</title>
      <link>http://pear.php.net/bugs/15673</link>
      <content:encoded><![CDATA[<pre>File_Archive Bug
Reported by anonymous500r
2009-01-18T11:41:40+00:00
PHP: 5.2.1 OS: Windows Package Version: 1.5.4

Description:
------------
I'm running xampp on Windows with the file_Archive extension. 
It extracts all of the files in the archive perfectly and every 
directory that's not in the root of the directory - so a in a Zip 
file that looks like this

index.php
images/site/logo.gif
images/welcome.png
contact.php

It extracts all the files, but the images directory is missing. 
Any ideas? 

Test script:
---------------
Extracting file...index.phpArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...images/site/logo.gifArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/site/Array
(
    [7] =&gt; 0
    [9] =&gt; 1230684282
    [size] =&gt; 0
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/welcome.pngArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...contact.phpArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)

Expected result:
----------------
Extracting file...index.phpArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...images/site/logo.gifArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/site/Array
(
    [7] =&gt; 0
    [9] =&gt; 1230684282
    [size] =&gt; 0
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/welcome.pngArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...images/Array
(
    [7] =&gt; 0
    [9] =&gt; 1230044715
    [size] =&gt; 0
    [mtime] =&gt; 1230044715
)
Deleting temporary file...
Extracting file...contact.phpArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)



Actual result:
--------------
Extracting file...index.phpArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...images/site/logo.gifArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/site/Array
(
    [7] =&gt; 0
    [9] =&gt; 1230684282
    [size] =&gt; 0
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/welcome.pngArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...contact.phpArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Bug
Reported by anonymous500r
2009-01-18T11:41:40+00:00
PHP: 5.2.1 OS: Windows Package Version: 1.5.4

Description:
------------
I'm running xampp on Windows with the file_Archive extension. 
It extracts all of the files in the archive perfectly and every 
directory that's not in the root of the directory - so a in a Zip 
file that looks like this

index.php
images/site/logo.gif
images/welcome.png
contact.php

It extracts all the files, but the images directory is missing. 
Any ideas? 

Test script:
---------------
Extracting file...index.phpArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...images/site/logo.gifArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/site/Array
(
    [7] =&gt; 0
    [9] =&gt; 1230684282
    [size] =&gt; 0
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/welcome.pngArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...contact.phpArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)

Expected result:
----------------
Extracting file...index.phpArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...images/site/logo.gifArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/site/Array
(
    [7] =&gt; 0
    [9] =&gt; 1230684282
    [size] =&gt; 0
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/welcome.pngArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...images/Array
(
    [7] =&gt; 0
    [9] =&gt; 1230044715
    [size] =&gt; 0
    [mtime] =&gt; 1230044715
)
Deleting temporary file...
Extracting file...contact.phpArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)



Actual result:
--------------
Extracting file...index.phpArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...images/site/logo.gifArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/site/Array
(
    [7] =&gt; 0
    [9] =&gt; 1230684282
    [size] =&gt; 0
    [mtime] =&gt; 1230683286
)
Deleting temporary file...
Extracting file...images/welcome.pngArray
(
    [7] =&gt; 1354
    [9] =&gt; 1230044705
    [size] =&gt; 1354
    [mtime] =&gt; 1230044705
)
Deleting temporary file...
Extracting file...contact.phpArray
(
    [7] =&gt; 879
    [9] =&gt; 1230683286
    [size] =&gt; 879
    [mtime] =&gt; 1230683286
)</pre>]]></description>
      <dc:date>2009-01-18T11:41:40+00:00</dc:date>
      <dc:creator>anonymous500r &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>File_Archive Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14622">
      <title>File_Archive: Bug 14622 [Open] reading tar files with split filenames needs slash inserted</title>
      <link>http://pear.php.net/bugs/14622</link>
      <content:encoded><![CDATA[<pre>File_Archive Bug
Reported by sharoncorrell
2008-09-08T17:17:11+00:00
PHP: 5.2.5 OS: Windows XP Package Version: 1.5.4

Description:
------------
There is code in File_Archive_Writer_Tar::tarHeader to split a long filename (&gt; 100 chars) into two pieces, ie, separating the path out into a separate field. But that field is not written with a slash at the end; nor does the base part of the filename include the intervening slash. So in File_Archive_Reader_Tar::_nextAdvance, it reads the prefix (path) and prepends it on the filename, but since there is no 		slash, the filename gets messed up.

I don't know if (according to the TAR specification) the path SHOULD have the slash included or not. But regardless, if it is not there, it ought to be inserted when reading the file. Here is how I've patched it:

if ($header['magic'] == 'ustar') {
    $prefix = $header['prefix'];
    if ( strlen( $prefix ) &gt; 0
              &amp;&amp; $prefix[strlen($prefix) - 1] != &quot;/&quot; ) {
        $prefix .= &quot;/&quot;;
    }
    $this-&gt;currentFilename = $this-&gt;getStandardURL(
                                              $prefix . $header['filename']
    );
} else {
// etc.
}</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Bug
Reported by sharoncorrell
2008-09-08T17:17:11+00:00
PHP: 5.2.5 OS: Windows XP Package Version: 1.5.4

Description:
------------
There is code in File_Archive_Writer_Tar::tarHeader to split a long filename (&gt; 100 chars) into two pieces, ie, separating the path out into a separate field. But that field is not written with a slash at the end; nor does the base part of the filename include the intervening slash. So in File_Archive_Reader_Tar::_nextAdvance, it reads the prefix (path) and prepends it on the filename, but since there is no 		slash, the filename gets messed up.

I don't know if (according to the TAR specification) the path SHOULD have the slash included or not. But regardless, if it is not there, it ought to be inserted when reading the file. Here is how I've patched it:

if ($header['magic'] == 'ustar') {
    $prefix = $header['prefix'];
    if ( strlen( $prefix ) &gt; 0
              &amp;&amp; $prefix[strlen($prefix) - 1] != &quot;/&quot; ) {
        $prefix .= &quot;/&quot;;
    }
    $this-&gt;currentFilename = $this-&gt;getStandardURL(
                                              $prefix . $header['filename']
    );
} else {
// etc.
}</pre>]]></description>
      <dc:date>2008-12-08T04:32:45+00:00</dc:date>
      <dc:creator>sharon_correll &amp;#x61;&amp;#116; sil &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>File_Archive Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14621">
      <title>File_Archive: Bug 14621 [Open] unmodifyName mangles filename</title>
      <link>http://pear.php.net/bugs/14621</link>
      <content:encoded><![CDATA[<pre>File_Archive Bug
Reported by sharoncorrell
2008-09-08T15:47:56+00:00
PHP: 5.2.5 OS: Windows XP Package Version: 1.5.4

Description:
------------
When I run Directory::unmodifyName in some circumstances, the results seem obviously incorrect. My input is:

  $this-&gt;oldBaseName = &quot;importtest.tar&quot;
  $this-&gt;newBaseName = &quot;&quot;
  $name = &quot;ssproto-data-1220394271.xml&quot;

The value returned is    &quot;importtest.tar/sproto-data-1220394271.xml&quot;. Notice that the first character of the original filename ($name = &quot;ssproto-data-1220394271.xml&quot;) has been deleted. I don't really know how to patch it because I don't understand the purpose of this code:

  substr($name, strlen($this-&gt;newBaseName)+1)

The file &quot;ssproto-data-1220394271.xml&quot; is one of the files embedded in &quot;importtest.tar&quot;. The high level code looks like this:

  $zip_reader = File_Archive::read( &quot;importtest.tar&quot; . &quot;/&quot; );
  $xml_writer = File_Archive::toVariable( $result );
  $zip_reader-&gt;extractFile(&quot;ssproto-data-1220394271.xml&quot;, $xml_writer);

The embedded file has no path information attached.</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Bug
Reported by sharoncorrell
2008-09-08T15:47:56+00:00
PHP: 5.2.5 OS: Windows XP Package Version: 1.5.4

Description:
------------
When I run Directory::unmodifyName in some circumstances, the results seem obviously incorrect. My input is:

  $this-&gt;oldBaseName = &quot;importtest.tar&quot;
  $this-&gt;newBaseName = &quot;&quot;
  $name = &quot;ssproto-data-1220394271.xml&quot;

The value returned is    &quot;importtest.tar/sproto-data-1220394271.xml&quot;. Notice that the first character of the original filename ($name = &quot;ssproto-data-1220394271.xml&quot;) has been deleted. I don't really know how to patch it because I don't understand the purpose of this code:

  substr($name, strlen($this-&gt;newBaseName)+1)

The file &quot;ssproto-data-1220394271.xml&quot; is one of the files embedded in &quot;importtest.tar&quot;. The high level code looks like this:

  $zip_reader = File_Archive::read( &quot;importtest.tar&quot; . &quot;/&quot; );
  $xml_writer = File_Archive::toVariable( $result );
  $zip_reader-&gt;extractFile(&quot;ssproto-data-1220394271.xml&quot;, $xml_writer);

The embedded file has no path information attached.</pre>]]></description>
      <dc:date>2008-09-08T15:47:56+00:00</dc:date>
      <dc:creator>sharon_correll &amp;#x61;&amp;#116; sil &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>File_Archive Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14559">
      <title>File_Archive: Feature/Change Request 14559 [Open] Use PHP ZIP extension</title>
      <link>http://pear.php.net/bugs/14559</link>
      <content:encoded><![CDATA[<pre>File_Archive Feature/Change Request
Reported by cbrunet
2008-08-25T08:07:08+00:00
PHP: Irrelevant OS:  Package Version: 1.5.4

Description:
------------
The use of PHP ZIP extension should allow faster operations, support more ZIP compression schemes, and reduce number of bugs.</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Feature/Change Request
Reported by cbrunet
2008-08-25T08:07:08+00:00
PHP: Irrelevant OS:  Package Version: 1.5.4

Description:
------------
The use of PHP ZIP extension should allow faster operations, support more ZIP compression schemes, and reduce number of bugs.</pre>]]></description>
      <dc:date>2008-08-25T08:07:08+00:00</dc:date>
      <dc:creator>charles &amp;#x64;&amp;#111;&amp;#x74; fmj &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>File_Archive Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14547">
      <title>File_Archive: Feature/Change Request 14547 [Open] Unable to create archive with an empty directory</title>
      <link>http://pear.php.net/bugs/14547</link>
      <content:encoded><![CDATA[<pre>File_Archive Feature/Change Request
Reported by wwalc
2008-08-22T14:55:05+00:00
PHP: Irrelevant OS: Win XP/SP3 Package Version: 1.5.4

Description:
------------
I need to create empty directories inside of a zip archive. However it seems that it is impossible.

I've spent quite a lot of time on trying to resolve it, I'd appreciate if anyone could tell me how to do it... it seems that it is impossible at this moment.


Test script:
---------------
//create single file in subdirectory works:
$targetFile = &quot;test.zip&quot;;
require_once &quot;File/Archive.php&quot;;
$innerWriter = File_Archive::toFiles();
$dest = File_Archive::toArchive($targetFile, $innerWriter);
$dest-&gt;newFile(&quot;path/to/subdirectory/file.txt&quot;);
$dest-&gt;writeData(&quot;test&quot;);
$dest-&gt;close();

//but create single empty directory doesn't:
$targetFile = &quot;test.zip&quot;;
require_once &quot;File/Archive.php&quot;;
$innerWriter = File_Archive::toFiles();
$dest = File_Archive::toArchive($targetFile, $innerWriter);
$dest-&gt;newFile(&quot;path/to/subdirectory/&quot;);
$dest-&gt;close();


Expected result:
----------------
create a test.zip file with an empty directory structure in it

Actual result:
--------------
empty archive</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Feature/Change Request
Reported by wwalc
2008-08-22T14:55:05+00:00
PHP: Irrelevant OS: Win XP/SP3 Package Version: 1.5.4

Description:
------------
I need to create empty directories inside of a zip archive. However it seems that it is impossible.

I've spent quite a lot of time on trying to resolve it, I'd appreciate if anyone could tell me how to do it... it seems that it is impossible at this moment.


Test script:
---------------
//create single file in subdirectory works:
$targetFile = &quot;test.zip&quot;;
require_once &quot;File/Archive.php&quot;;
$innerWriter = File_Archive::toFiles();
$dest = File_Archive::toArchive($targetFile, $innerWriter);
$dest-&gt;newFile(&quot;path/to/subdirectory/file.txt&quot;);
$dest-&gt;writeData(&quot;test&quot;);
$dest-&gt;close();

//but create single empty directory doesn't:
$targetFile = &quot;test.zip&quot;;
require_once &quot;File/Archive.php&quot;;
$innerWriter = File_Archive::toFiles();
$dest = File_Archive::toArchive($targetFile, $innerWriter);
$dest-&gt;newFile(&quot;path/to/subdirectory/&quot;);
$dest-&gt;close();


Expected result:
----------------
create a test.zip file with an empty directory structure in it

Actual result:
--------------
empty archive</pre>]]></description>
      <dc:date>2008-08-22T14:55:05+00:00</dc:date>
      <dc:creator>wiktor &amp;#x61;&amp;#116; fckeditor &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>File_Archive Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12617">
      <title>File_Archive: Feature/Change Request 12617 [Analyzed] Incorrectly marks an archive/file as compressed when it's not</title>
      <link>http://pear.php.net/bugs/12617</link>
      <content:encoded><![CDATA[<pre>File_Archive Feature/Change Request
Reported by andersapt
2007-12-05T03:45:02+00:00
PHP: 5.2.3 OS: Windows Package Version: 1.5.3

Description:
------------
I'm trying to make an archive of jpeg files, and only want them stored, not compressed. The archive is supposed to be loaded into a Flash 9 application, with the FZip library. This library can progressivly read zip files if they're not compressed. However, the zip file created by File_Archive incorrectly states that the files are compressed, when they're  not.

Test script:
---------------
$file = &quot;test_archive.zip&quot;;

// Store test jpeg
File_Archive::setOption(&quot;zipCompressionLevel&quot;, 0);
$source = File_Archive::read('test_file.jpg',null,0,2);
$source-&gt;close();  //Move back to the begining of the source
File_Archive::extract( $source, File_Archive::toArchive( $file, File_Archive::toFiles() ) ); 

// Load to check compression level
$zip = new ZipArchive();
if( $zip-&gt;open( $file )!==true ) die( 'Could not open file '.$file );
for ($x=0; $x&lt;$zip-&gt;numFiles; $x++) echo '&lt;pre&gt;'.print_r( $zip-&gt;statIndex($x), 1).'&lt;/pre&gt;';
$zip-&gt;close();

Expected result:
----------------
I expect the value of [comp_method] from ZipArchive to be 0, not 8.

Actual result:
--------------
The value of [comp_method] is 8.</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Feature/Change Request
Reported by andersapt
2007-12-05T03:45:02+00:00
PHP: 5.2.3 OS: Windows Package Version: 1.5.3

Description:
------------
I'm trying to make an archive of jpeg files, and only want them stored, not compressed. The archive is supposed to be loaded into a Flash 9 application, with the FZip library. This library can progressivly read zip files if they're not compressed. However, the zip file created by File_Archive incorrectly states that the files are compressed, when they're  not.

Test script:
---------------
$file = &quot;test_archive.zip&quot;;

// Store test jpeg
File_Archive::setOption(&quot;zipCompressionLevel&quot;, 0);
$source = File_Archive::read('test_file.jpg',null,0,2);
$source-&gt;close();  //Move back to the begining of the source
File_Archive::extract( $source, File_Archive::toArchive( $file, File_Archive::toFiles() ) ); 

// Load to check compression level
$zip = new ZipArchive();
if( $zip-&gt;open( $file )!==true ) die( 'Could not open file '.$file );
for ($x=0; $x&lt;$zip-&gt;numFiles; $x++) echo '&lt;pre&gt;'.print_r( $zip-&gt;statIndex($x), 1).'&lt;/pre&gt;';
$zip-&gt;close();

Expected result:
----------------
I expect the value of [comp_method] from ZipArchive to be 0, not 8.

Actual result:
--------------
The value of [comp_method] is 8.</pre>]]></description>
      <dc:date>2008-05-29T15:54:04+00:00</dc:date>
      <dc:creator>anders &amp;#x61;&amp;#116; apt &amp;#x64;&amp;#111;&amp;#x74; no</dc:creator>
      <dc:subject>File_Archive Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10219">
      <title>File_Archive: Bug 10219 [Verified] Not any Archive inside an archive wont be recognises while extracting</title>
      <link>http://pear.php.net/bugs/10219</link>
      <content:encoded><![CDATA[<pre>File_Archive Bug
Reported by marius.metzler@...
2007-02-28T07:37:30+00:00
PHP: 5.0.4 OS: Windows xp Package Version: 1.5.3

Description:
------------
When I would like to read an archive's content the archives inside wont be recognised.

Having this structure:

test.zip                 // this is the archive I want to read
    test1.txt
    dontknowthename1.zip
    dontknowthename2.zip
    test2.txt


Test script:
---------------
$source=File_Archive::read(&quot;test.zip/&quot;);   // read the archive's content

$source-&gt;close();
while($source-&gt;next()) {
    echo $source-&gt;getFilename().&quot;&lt;br&gt;\n&quot;;  // output content files
}

Expected result:
----------------
test1.txt
dontknowthename1.zip
dontknowthename2.zip
test2.txt


Actual result:
--------------
test1.txt
test2.txt</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Bug
Reported by marius.metzler@...
2007-02-28T07:37:30+00:00
PHP: 5.0.4 OS: Windows xp Package Version: 1.5.3

Description:
------------
When I would like to read an archive's content the archives inside wont be recognised.

Having this structure:

test.zip                 // this is the archive I want to read
    test1.txt
    dontknowthename1.zip
    dontknowthename2.zip
    test2.txt


Test script:
---------------
$source=File_Archive::read(&quot;test.zip/&quot;);   // read the archive's content

$source-&gt;close();
while($source-&gt;next()) {
    echo $source-&gt;getFilename().&quot;&lt;br&gt;\n&quot;;  // output content files
}

Expected result:
----------------
test1.txt
dontknowthename1.zip
dontknowthename2.zip
test2.txt


Actual result:
--------------
test1.txt
test2.txt</pre>]]></description>
      <dc:date>2008-06-04T14:09:43+00:00</dc:date>
      <dc:creator>marius &amp;#x64;&amp;#111;&amp;#x74; metzler &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>File_Archive Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10144">
      <title>File_Archive: Bug 10144 [Verified] long filenames are not stored correctly</title>
      <link>http://pear.php.net/bugs/10144</link>
      <content:encoded><![CDATA[<pre>File_Archive Bug
Reported by fritsch+pear.php.net@...
2007-02-21T09:31:39+00:00
PHP: Irrelevant OS: Ubuntu Package Version: 1.5.3

Description:
------------
In Writer/Tar.php it reads like this:
        $filePrefix = '';
        if (strlen($filename) &gt; 255) {
            return PEAR::raiseError(
                &quot;$filename is too long to be put in a tar archive&quot;
            );
        } else if (strlen($filename) &gt; 100) {
            $filePrefix = substr($filename, 0, strlen($filename)-100);
            $filename = substr($filename, -100);
        }

Actually (at least unix tar handles archives like that) the prefix needs to be a path-component, so that &quot;$filePrefix/$filename&quot; is the actual filename. This is not handled correctly by the above code, so it will inject a slash at strlen()-100 for the filename, resulting in really messy tarfiles.



Test script:
---------------
A solution might look like this:
        } else if (strlen($filename) &gt; 100) {
	    #need a path component of max 155 bytes
            $pos = strrpos(substr($filename, 0, 155), '/');
	    if(strlen($filename) - $pos &gt; 100) #filename-component may not exceed 100 bytes
		return PEAR::raiseError(
                	&quot;$filename is too long to be put in a tar archive&quot;
            	);
	    $filePrefix = substr($filename, 0, $pos);
            $filename = substr($filename, $pos+1);
	    echo &quot;$filePrefix vs $filename&lt;br&gt;\n&quot;;
        }</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Bug
Reported by fritsch+pear.php.net@...
2007-02-21T09:31:39+00:00
PHP: Irrelevant OS: Ubuntu Package Version: 1.5.3

Description:
------------
In Writer/Tar.php it reads like this:
        $filePrefix = '';
        if (strlen($filename) &gt; 255) {
            return PEAR::raiseError(
                &quot;$filename is too long to be put in a tar archive&quot;
            );
        } else if (strlen($filename) &gt; 100) {
            $filePrefix = substr($filename, 0, strlen($filename)-100);
            $filename = substr($filename, -100);
        }

Actually (at least unix tar handles archives like that) the prefix needs to be a path-component, so that &quot;$filePrefix/$filename&quot; is the actual filename. This is not handled correctly by the above code, so it will inject a slash at strlen()-100 for the filename, resulting in really messy tarfiles.



Test script:
---------------
A solution might look like this:
        } else if (strlen($filename) &gt; 100) {
	    #need a path component of max 155 bytes
            $pos = strrpos(substr($filename, 0, 155), '/');
	    if(strlen($filename) - $pos &gt; 100) #filename-component may not exceed 100 bytes
		return PEAR::raiseError(
                	&quot;$filename is too long to be put in a tar archive&quot;
            	);
	    $filePrefix = substr($filename, 0, $pos);
            $filename = substr($filename, $pos+1);
	    echo &quot;$filePrefix vs $filename&lt;br&gt;\n&quot;;
        }</pre>]]></description>
      <dc:date>2008-06-04T14:15:57+00:00</dc:date>
      <dc:creator>fritsch+pear &amp;#x64;&amp;#111;&amp;#x74; php &amp;#x64;&amp;#111;&amp;#x74; net &amp;#x61;&amp;#116; in &amp;#x64;&amp;#111;&amp;#x74; tum &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>File_Archive Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/6546">
      <title>File_Archive: Bug 6546 [Assigned] File added twice</title>
      <link>http://pear.php.net/bugs/6546</link>
      <content:encoded><![CDATA[<pre>File_Archive Bug
Reported by david@...
2006-01-21T12:17:33+00:00
PHP: 5.1.2 OS: Red Hat Enterprise Linux Package Version: 

Description:
------------
If you archive a directory, the first file is added to the archive twice.

Test script:
---------------
Directory /home/frame4net/public_html/downloads/cart-2 contains:

-rw-r--r--  1 apache    apache    1024 Jan 21 12:02 1mb.test-file

&lt;?php
$tmpdir = '/home/frame4net/public_html/downloads/cart-2';
File_Archive::extract($tmpdir, File_Archive::toArchive('Cart-2.zip', File_Archive::toOutput()));
?&gt;

Expected result:
----------------
The output Cart-2.zip file should only contain 1 instance of 1mb.test-file

Actual result:
--------------
There are 2 instances of 1mb.test-file both exactly the same.</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_Archive Bug
Reported by david@...
2006-01-21T12:17:33+00:00
PHP: 5.1.2 OS: Red Hat Enterprise Linux Package Version: 

Description:
------------
If you archive a directory, the first file is added to the archive twice.

Test script:
---------------
Directory /home/frame4net/public_html/downloads/cart-2 contains:

-rw-r--r--  1 apache    apache    1024 Jan 21 12:02 1mb.test-file

&lt;?php
$tmpdir = '/home/frame4net/public_html/downloads/cart-2';
File_Archive::extract($tmpdir, File_Archive::toArchive('Cart-2.zip', File_Archive::toOutput()));
?&gt;

Expected result:
----------------
The output Cart-2.zip file should only contain 1 instance of 1mb.test-file

Actual result:
--------------
There are 2 instances of 1mb.test-file both exactly the same.</pre>]]></description>
      <dc:date>2007-01-16T21:29:49+00:00</dc:date>
      <dc:creator>david &amp;#x61;&amp;#116; olate &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>File_Archive Bug</dc:subject>
    </item>
</rdf:RDF>
