<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Syntux the geek &#187; PECL</title>
	<atom:link href="http://syntux.net/blog/category/pecl/feed/" rel="self" type="application/rss+xml" />
	<link>http://syntux.net/blog</link>
	<description>Your freedom is worth more than you think. Take advantage of it while you can.</description>
	<lastBuildDate>Mon, 27 Feb 2012 07:14:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Fun with PECL Zip 1.6 &#8211; Installation</title>
		<link>http://syntux.net/blog/2006/07/27/fun-with-pecl-zip-16-installation/</link>
		<comments>http://syntux.net/blog/2006/07/27/fun-with-pecl-zip-16-installation/#comments</comments>
		<pubDate>Thu, 27 Jul 2006 11:55:23 +0000</pubDate>
		<dc:creator>Syntux</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://syntux.net/blog/2006/07/27/fun-with-pecl-zip-16-installation/</guid>
		<description><![CDATA[With PECL Zip you can read, add, delete, set and read archive comment, it&#8217;s a very useful package for searching and managing Zipped archive kind of data. let&#8217;s begin with the installation fire up your PECL installer to install Zip; you&#8217;ll see some information verbosed while installed PECL Zip like the following wget http://pecl.php.net/get/zip &#038;&#038; [...]]]></description>
			<content:encoded><![CDATA[
<p class="FacebookLikeButton"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsyntux.net%2Fblog%2F2006%2F07%2F27%2Ffun-with-pecl-zip-16-installation%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height: 25px"></iframe></p>
<p>With PECL Zip you can read, add, delete, set and read archive comment, it&#8217;s a very useful package for searching and managing Zipped archive kind of data.<br />
let&#8217;s begin with the installation<br />
fire up your PECL installer to install Zip; you&#8217;ll see some information verbosed while installed PECL Zip like the following<br />
<coolcode lang="shell"><br />
wget http://pecl.php.net/get/zip &#038;&#038;  tar -zxvf zip &#038;&#038; cd zip-1.6.0/ &#038;&#038; phpize5 &#038;&#038; sudo ./configure &#038;&#038; sudo  make &#038;&#038; sudo make install<br />
</coolcode><br />
During the installation you will be flooded with verbosed information ; it&#8217;s useful to watch and try to understand what&#8217;s going behind the scene; keep your eye on the verbose to see if any error popup like missing library or permission problem, if the installation went fine; at the end you will see<br />
<span id="more-12"></span><br />
<coolcode lang="shell"><br />
Installing shared extensions:     /usr/lib/php5/20050922/<br />
</coolcode><br />
Now let&#8217;s edit php.ini<br />
<coolcode lang="shell"><br />
sudo vim /etc/php5/apache2/php.ini<br />
</coolcode><br />
and add<br />
<coolcode lang="ini">extension=zip.so</coolcode><br />
now you will only need to restart apache to get the new extension loaded<br />
<coolcode lang="shell"><br />
sudo /etc/init.d/apache2 restart<br />
</coolcode><br />
Now ZIP extension are installed so let&#8217;s explore the examples directory where you will see PHP code example of how to use ZIP extension</p>
<p>First let&#8217;s see what methods ZIP class have<br />
<coolcode lang="php"><br />
< ?php<br />
$Zip = New ZipArchive();<br />
print '
<pre>&#8216;.print_r(get_class_methods($Zip)).&#8221;;<br />
</coolcode><br />
This will output<br />
<coolcode lang="php"><br />
Array (<br />
[0] => open                      [1] => close<br />
[2] => addFromString         [3] => addFile<br />
[4] => renameIndex           [5] => renameName<br />
[6] => setArchiveComment [7] => getArchiveComment<br />
[8] => setCommentIndex    [9] => setCommentName<br />
[10] => getCommentIndex  [11] => getCommentName<br />
[12] => deleteIndex          [13] => deleteName<br />
[14] => statName             [15] => statIndex<br />
[16] => locateName          [17] => getNameIndex<br />
[18] => unchangeArchive   [19] => unchangeAll<br />
[20] => unchangeIndex      [21] => unchangeName<br />
[22] => extractTo             [23] => getFromName<br />
[24] => getFromIndex        [25] => getStream )<br />
</coolcode></p>
<p>Most of methods and functions are being used in the example folder of Zip extention<br />
<coolcode lang="shell"><br />
comment.php  create.php  dir.php  extractAll.php  extract.php  fopen.php  get_set_comments.php  odt.php  oldapi.php  test1.zip  test_with_comment.zip  test.zip  too.php<br />
</coolcode></p>
<p>Enjoy </p>
<p>Resources</p>
<ol>
<li><a href="http://pecl.php.net/package/zip">PECL Zip page</a></li>
<li><a href="http://www.php.net/zip">Zip documentation at PHP.net</a></li>
<li><a href="http://blog.thepimp.net/index.php/2006/07/14/88-pecl-zip-150-major-features-additions">PECL Zip &#8211; new features announcement</a></li>
</ol>
<p>Tags: <a href="http://syntux.net/blog/?s=PHP" rel="tag"> PHP</a>, <a href="http://syntux.net/blog/?s=PECL" rel="tag"> PECL</a>, <a href="http://syntux.net/blog/?s=Zip" rel="tag"> Zip </a></p>
<p>&copy;2012 <a href="http://syntux.net/blog">Syntux the geek</a>. All Rights Reserved.</p>.
<p class="FacebookLikeButton"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsyntux.net%2Fblog%2F2006%2F07%2F27%2Ffun-with-pecl-zip-16-installation%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height: 25px"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://syntux.net/blog/2006/07/27/fun-with-pecl-zip-16-installation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

