<?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>Tellaw.org &#187; zip</title>
	<atom:link href="http://www.tellaw.org/tag/zip/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tellaw.org</link>
	<description>La technologie doit devenir simple...</description>
	<lastBuildDate>Fri, 02 Apr 2010 14:48:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Utiliser des archives ZIP ou TAR dans un projet PHP</title>
		<link>http://www.tellaw.org/2008/04/21/utiliser-des-archives-zip-ou-tar-dans-un-projet-php/</link>
		<comments>http://www.tellaw.org/2008/04/21/utiliser-des-archives-zip-ou-tar-dans-un-projet-php/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 14:50:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://www.tellaw.org/?p=36</guid>
		<description><![CDATA[PHP 4 et PHP 5 permettent la création, extraction ou modification d&#8217;archive de type TAR ou ZIP via les librairies PCLZip et PCLTar. Ceux deux librairies ont un fonctionnement extrèmement simple, et sont accessible à des développeurs de tous les niveaux, car elles sont aussi très bien documentées.

Les librairies sont disponibles à l&#8217;adresse : http://www.phpconcept.net/pclzip/
La [...]]]></description>
			<content:encoded><![CDATA[<p>PHP 4 et PHP 5 permettent la création, extraction ou modification d&#8217;archive de type TAR ou ZIP via les librairies PCLZip et PCLTar. Ceux deux librairies ont un fonctionnement extrèmement simple, et sont accessible à des développeurs de tous les niveaux, car elles sont aussi très bien documentées.</p>
<p><span id="more-36"></span></p>
<p>Les librairies sont disponibles à l&#8217;adresse : <a href="http://www.phpconcept.net/pclzip/" target="_blank">http://www.phpconcept.net/pclzip/</a></p>
<p>La documentation complète est disponible sur le site PHPConcept, mais voici quand même un petit exemple d&#8217;utilisation montrant la simplicité du code :</p>

<div class="wp_syntax"><div class="code"><pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// Include de la librairie externe.</span>
<span style="color: #b1b100;">include_once</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'pclzip.lib.php'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// Instancition de l'objet PCL.</span>
<span style="color: #ff0000">$zip</span> <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PclZip<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;test.zip&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// Ouverture de l'archive.</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&lt;</span>img src<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.tellaw.org/wp-admin/$list = $zip-&gt;listContent(&quot;</span> alt<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/&gt;</span> <span style="color: #66cc66;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #000066;">die</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Error : &quot;</span><span style="color: #66cc66;">.</span><span style="color: #ff0000">$zip</span><span style="color: #66cc66;">-&gt;</span><span style="color: #006600;">errorInfo</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// Navigue dans le tableau $list afin de lire les noms de fichiers.</span>
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000">$i</span><span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span> <span style="color: #ff0000">$i</span><span style="color: #66cc66;">&lt;</span>sizeof<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000">$list</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span> <span style="color: #ff0000">$i</span><span style="color: #66cc66;">++</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> 	<span style="color: #000066;">reset</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000">$list</span><span style="color: #66cc66;">&lt;</span>a href<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.tellaw.org/wp-admin/$i&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff0000">$i</span><span style="color: #66cc66;">&lt;/</span>a<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span> 
			<span style="color: #ff0000">$key</span> <span style="color: #66cc66;">=</span> <span style="color: #000066;">key</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000">$list</span><span style="color: #66cc66;">&lt;</span>a href<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.tellaw.org/wp-admin/$i&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff0000">$i</span><span style="color: #66cc66;">&lt;/</span>a<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span> 
			<span style="color: #000066;">next</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000">$list</span><span style="color: #66cc66;">&lt;</span>a href<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.tellaw.org/wp-admin/$i&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff0000">$i</span><span style="color: #66cc66;">&lt;/</span>a<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
		<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">// Lecture des fichiers.</span>
		<span style="color: #000066;">echo</span> <span style="color: #ff0000;">&quot;File $i / &lt;a href=&quot;</span>http<span style="color: #66cc66;">:</span><span style="color: #808080; font-style: italic;">//www.tellaw.org/wp-admin/$key&quot;&gt;$key&lt;/a&gt; = &quot;.$list&lt;a href=&quot;http://www.tellaw.org/wp-admin/$i&quot;&gt;$i&lt;/a&gt;&lt;a href=&quot;http://www.tellaw.org/wp-admin/$key&quot;&gt;$key&lt;/a&gt;.&quot;&lt;br&gt;&quot;;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000066;">echo</span> <span style="color: #ff0000;">&quot;&lt;br&gt;&quot;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Ce script ouvre une archive et liste les fichiers qu&#8217;elle contient.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tellaw.org/2008/04/21/utiliser-des-archives-zip-ou-tar-dans-un-projet-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
