Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.5

Bug #4548 $_File_Archive_Options not global
Submitted: 2005-06-07 22:54 UTC
From: tier at gregor-widuch dot de Assigned: vincentlascaux
Status: Closed Package: File_Archive
PHP Version: 4.3.8 OS: Windows XP Pro
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 46 - 37 = ?

 
 [2005-06-07 22:54 UTC] tier at gregor-widuch dot de
Description: ------------ In file Archive.php variable $_File_Archive_Options needs to be set global: global $_File_Archive_Options; $_File_Archive_Options = array( 'zipCompressionLevel' => 9, 'gzCompressionLevel' => 9, 'tmpDirectory' => '.', 'cache' => null, 'appendRemoveDuplicates' => false );

Comments

 [2005-06-07 23:10 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-06-08 08:05 UTC] tier at gregor-widuch dot de
$_File_Archive_Options should be set global because some people maybe wants to use File_Archive inside a function or class. function zipMyData($filename, $exportFilename, $data) { require_once "File/Archive.php"; $rd = ""; $zipfile = File_Archive::toArchive($filename, File_Archive::toVariable($rd)); $zipfile->newFile($exportFilename, array()); $zipfile->writeData($renderedData); $zipfile->close(); return $rd; } if $_File_Archive_Options is not set to global the code generates a zip archive but the data is not zipped (I think compressed with level 0). The zipped file is really larger than the original data (but it is not corrupt)
 [2005-06-08 09:33 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-06-08 11:46 UTC] tier at gregor-widuch dot de
First let me say: it´s a great great class you wrote. What I reported is maybe not a bug. But it me hours to get it to work. So it would be nice for users to know it. A last remark: In your last sample you put the line require_once "File/Archive.php"; outside the function zipMyData. That is not what I wanted do. If I have the require_once line only in the function no compression is made: function zipMyData($filename, $exportFilename, $data) { require_once "File/Archive.php"; $rd = ""; $zipfile = File_Archive::toArchive($filename, File_Archive::toVariable($rd)); $zipfile->newFile($exportFilename, array()); $zipfile->writeData($data); $zipfile->close(); return $rd; } $data = ''; for($i=0; $i<10000; $i++) $data .= 'a'; $compressed = zipMyData('test.zip', 'inner.txt', $data); echo strlen($compressed).'/'.strlen($data)."\n"; Outputs: 10121/10000
 [2005-06-08 11:58 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-06-08 12:24 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-06-08 13:12 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!