News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Wojciech Sznapka's Blog:
Power of PHP streams - decompress gz archives on the fly from remote server
November 24, 2010 @ 08:39:05

Wojciech Sznapka has a new post to his blog today looking at the "power of PHP streams" and how they can be used to decompress gzipped data from remote servers.

Probably most of us heard about streams in PHP. They are background of all files and network operations in PHP, even if we don't see it. Everytime when you use file_get_contents or fopen you are actually using streams. But there are many stream wrappers I haven't used, because they aren't well known.One of them is compress.zlib (and two other compression stream filters).

He includes a quick example (because, thankfully, that's all working with streams like this usually requires) about pulling in a file from his server and uses the stream to fetch and unzip the data to display the contents.

0 comments voice your opinion now!
streams tutorial gzip decompress archive


Thomas Weidner's Blog:
Compression and Decompression for ZF
September 23, 2009 @ 10:26:40

As Thomas Weidner mentions in a new blog post, starting with the 1.10 release of the Zend Framework there'll be a new component to help with compressing and decompressing files - Zend_Filter_Compress/Decompress.

The new components Zend_Filter_Compress and Zend_Filter_Decompress provide a unified API for several compression formats. Actually the formats BZ2, GZ, LZF, RAR, TAR and ZIP are implemented: You can not only work with Strings, but also with Files and also with complete Directories.

He includes a quick example of how it will work with both data (like a string) and writing out the information to a compressed file. You can find out more about the component from Thomas' proposal on the Zend Framework wiki.

0 comments voice your opinion now!
zendframework compress decompress


Zend Developer Zone:
Dynamically Creating Compressed Zip Archives With PHP
June 05, 2007 @ 11:54:00

The Zend Developer Zone has a new tutorial that focuses on the dynamic creation of zip archives in a PHP application.

PHP too has included support for the ZIP format since PHP 4.x but it was only recently when, idly browsing the PHP manual, I realized that PHP 5.2.0 includes a re-engineered version of the ext/zip extension, one based on the zlib library. Bored and not a little intrigued, I decided to try it out. And over the next few pages, I'm going to tell you what I found.

The tutorial does require that you have the zip extension installed before getting started. He starts with the basics (reading and opening a zip file) but quickly moves on to creating and decompressing them. All of the code needed is included of course, so you'll be up and working with your own zip files in no time.

1 comment voice your opinion now!
zip archive extension tutorial extract compress decompress zip archive extension tutorial extract compress decompress



Community Events





Don't see your event here?
Let us know!


deployment api introduction list zendserver bugfix library series interview language framework release conference community voicesoftheelephpant tips podcast developer laravel symfony

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework