This extension is for working with zip. Based on comments to http://www.php.net/manual/en/function.zip-open.php
Documentation ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/extensions/zip
Usage ¶
Introduce EZip to Yii. Add definition to CWebApplication config file (main.php)
'components'=>array(
...
'zip'=>array(
'class'=>'application.extensions.zip.EZip',
),
...
),
Now you can access EZip methods as follows:
$zip = Yii::app()->zip;
$zip->makeZip('./','./toto.zip'); // make an ZIP archive
var_export($zip->infosZip('./toto.zip'), false); // get infos of this ZIP archive (without files content)
var_export($zip->infosZip('./toto.zip')); // get infos of this ZIP archive (with files content)
$zip->extractZip('./toto.zip', './1/'); //
Change Log ¶
May 31, 2010 ¶
- Initial release.
bug line 48
I've found a bug in line 48
incorrect:
$this->addZipItem($zip, realpath(dirname($item)).'/', realpath($item).'/');
correct:
$this->addZipItem($zip, realpath(dirname($item)).'/', realpath($item));
Maybe is useful for others
bye
Windows Server
Use DIRECTORY_SEPARATOR, instead of '/' on the line mentioned by the previous post.
So it will be similar to this:
$this->addZipItem($zip, realpath(dirname($item)).DIRECTORY_SEPARATOR, realpath($item));
Thanx for this extension
Thanx for this extension but please use <?php instead <? because if someone has short tags turned off error will occur.
How to download this file
Please help me How to download this file, no store in webroot
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.