cvs: peardoc /fr/package/fileformats/file-archive cache.xml

From: Date: Thu, 17 Apr 2008 06:48:50 +0000
Subject: cvs: peardoc /fr/package/fileformats/file-archive cache.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-10691@lists.php.net to get a copy of this message
moosh Thu Apr 17 06:48:50 2008 UTC Modified files: /peardoc/fr/package/fileformats/file-archive cache.xml Log: complete translation http://cvs.php.net/viewvc.cgi/peardoc/fr/package/fileformats/file-archive/cache.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/fr/package/fileformats/file-archive/cache.xml diff -u peardoc/fr/package/fileformats/file-archive/cache.xml:1.1 peardoc/fr/package/fileformats/file-archive/cache.xml:1.2 --- peardoc/fr/package/fileformats/file-archive/cache.xml:1.1 Tue Apr 15 15:58:54 2008 +++ peardoc/fr/package/fileformats/file-archive/cache.xml Thu Apr 17 06:48:50 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Id: cache.xml,v 1.1 2008/04/15 15:58:54 moosh Exp $ --> -<!-- $Revision: 1.1 $ --> +<!-- $Id: cache.xml,v 1.2 2008/04/17 06:48:50 moosh Exp $ --> +<!-- $Revision: 1.2 $ --> <!-- EN-Revision: 1.1 Maintainer: moosh Status: started --> <refentry id="package.fileformats.file-archive.cache"> <refnamediv> @@ -20,13 +20,13 @@ <para> A zip file is made of compressed files, one after the others. - So if you generate an archive that contains files A, B and C and then - another archive that contains A and C, you will compress twice the files - A and C. - - The use of the cache will allow to save the compressed version of - files A, B and C on the first compression, - to use them again in the second compression. + Ainsi, si vous générez une archive qui contient les fichiers A, B et C + et un autre qui aura A et C, vous devez compresser deux fois les fichiers + A et C. + + Pour utiliser le le cache vous permet de sauvegarder une version compressée des + fichiers A,B et C lors de la première compression, + et de les réutiliser à nouveau pour la seconde compression. </para> </refsect1> @@ -36,58 +36,68 @@ <para> The cache can be (and should be) used if you dynamically create some zip archive that contains frequently the same files. - For example, you may want to allow the user to select some images, videos or - other files from your gallery and allow them to download a compressed zip - archive that contains these files. + + Par exemple, vous pouvez proposer aux utilisateurs de choisir des photos, vidéo ou + autres fichiers dans une gallerie + et de les récuperer dans un zip contenant la sélection </para> <para> - If you do so without cache, your server will answer very slowly if a lot of - users ask the files. With the cache, the files will be compressed only once. + Si vous le faites sans cache, + votre server répondra plus lentement si un nombre important d'utilisateurs + demandes les fichiers. + + Avec un cache les fichiers ne seront demandés qu'une seule fois. </para> <para> - On my machine (a thinkpad T42P with default factory equipment), generating a - 200MB zip archive takes around 30s of CPU without the cache, 32s of CPU with - an empty cache and 2s of CPU if all the files to compress are already in - cache. + Sur ma machine + (un thinkpad T42P avec l'équipement par défaut d'usine), + génerer une archive zip de 200 Mo prend en environ + 30s de CPU sans le cache, + 32s de CPU avec un cache vide + 2s de CPU si tous les fichiers à compresser sont déjà dans le cache. </para> </refsect1> <refsect1 id="package.fileformats.file-archive.cache.howtouse"> - <title>How to use the cache</title> + <title>Comment utiliser le cache</title> <para> - The cache is a Cache_Lite object. - So you must have installed the package. - Then all you have to do is use the - <function>File_Archive::setOption</function> function with the - <varname>cache</varname> parameter. + Le cache est un objet Cache_Lite. + + Vous devez donc avoir installé le paquet. + + Vous devrez alors utiliser la fonction + <function>File_Archive::setOption</function> + avec le paramètre + <varname>cache</varname> . </para> <example> - <title>Set up the cache</title> + <title>Mettre en place le cache</title> <programlisting role="php"><![CDATA[ <?php require_once "File/Archive.php"; require_once "Cache/Lite.php"; -//Create the cache object +//On crée l'objet cache $cache = new Cache_Lite( array( - //See the doc of Cache_Lite for its constructor parameters + // regardez la doc de Cache_Lite + // pour le détail des paramètre du constructeurfor its constructor parameters ) ); -//Ask File_Archive to use the cache object we just created +//Demandes à File_Archive d'utiliser l'objet cache que vous venz de créer File_Archive::setOption('cache', $cache); -//And then create your archives as usual -//Generate a file called archive.zip in the working folder +//Et alors creez vos archives comme habituellement +//Generons un fichier appelé archive.zip dans le dossier de travail File_Archive::extract( 'folderToCompress', 'archive.zip' ); -//Send an archive to the user +//Envoyons l'archive à un utilisateur File_Archive::extract( 'folderToCompress', File_Archive::toArchive(

« previous php.pear.doc (#10691) next »