<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>peLmeL.org</title>
	<link>http://pelmel.org/spip/</link>
	<description />
	<language>fr</language>
	<generator>SPIP - www.spip.net</generator>

	<image>
		<title>peLmeL.org</title>
		<url>http://pelmel.org/spip/IMG/siteon0.png</url>
		<link>http://pelmel.org/spip/</link>
		<height>200</height>
		<width>274</width>
	</image>




	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Pelmelorg" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Tellement vrai</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/YwE5L3HBIi0/Tellement-vrai</link>
		<guid isPermaLink="false">http://pelmel.org/spip/Tellement-vrai</guid>
		<dc:date>2009-12-15T19:19:41Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-peLmeL-Blog-">peLmeL Blog</category>


		<description>En ce moment je ne trouve pas le temps de bloguer, ni même de suivre les blogs, la faute à qui ? Réponse en image...

-
&lt;a href="http://pelmel.org/spip/-peLmeL-Blog-" rel="directory"&gt;peLmeL Blog&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">En ce moment je ne trouve pas le temps de bloguer, ni même de suivre les blogs, la faute à qui ? Et bien cette parodie de la chute vous en donnera les clés. J'adore la conclusion tellement vrai :</p>
<div><object width="480" height="275"><param name="movie" value="http://www.dailymotion.com/swf/xbfjlq&related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/xbfjlq&related=0" type="application/x-shockwave-flash" width="480" height="275" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><b><a href="http://www.dailymotion.com/video/xbfjlq_la-dure-vie-des-developpeurs-web_fun">La dure vie des développeurs web</a></b><br /><i>envoyé par <a href="http://www.dailymotion.com/thibaultj27">thibaultj27</a>. - <a href="http://www.dailymotion.com/fr/channel/fun">Gag, sketch et parodie humouristique en video.</a></i></div>
<p class="spip">Et puis plus sympathique, Hug a developer :</p> <object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/1lqxORnQARw&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/1lqxORnQARw&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/ywi_vRlDinjHKsy_3fLj85qNYoM/0/da"><img src="http://feedads.g.doubleclick.net/~a/ywi_vRlDinjHKsy_3fLj85qNYoM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ywi_vRlDinjHKsy_3fLj85qNYoM/1/da"><img src="http://feedads.g.doubleclick.net/~a/ywi_vRlDinjHKsy_3fLj85qNYoM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/YwE5L3HBIi0" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/Tellement-vrai</feedburner:origLink></item>



	<item>
		<title>Translate local, translate global on Drupal</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/d7ixnDHeA6E/Translate-local-translate-global</link>
		<guid isPermaLink="false">http://pelmel.org/spip/Translate-local-translate-global</guid>
		<dc:date>2009-11-25T20:19:11Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-Drupalium-">Drupalium</category>


		<description>J'ai entamé ce billet suite à une conversation avec des stagiaires sur les différents modules de traduction disponible sur Drupal. La partie traduction, internationalisation ou encore localisation d'un site internet est un aspect qu'on voit finalement très peu dans notre beau pays qu'est la France. De façon général, les pays qui bénéficie d'une seule langue officielle et qui est activement parlé dans le monde ne s'en soucie guère, hormis dans le sens langue étrangère vers langue du pays.

-
&lt;a href="http://pelmel.org/spip/-Drupalium-" rel="directory"&gt;Drupalium&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">J'ai entamé ce billet suite à une conversation avec des stagiaires sur les différents modules de traduction disponible sur Drupal. La partie traduction, internationalisation ou encore localisation d'un site internet est un aspect qu'on voit finalement très peu dans notre beau pays qu'est la France. De façon générale, les pays qui bénéficie d'une seule langue officielle et qui est activement parlée dans le monde ne s'en soucie guère, hormis dans le sens langue étrangère vers langue du pays.</p> <p class="spip">Le créateur de Drupal étant flamand, il y'a de forte propabilité que cet aspect soit bien traité dans le système. Globalement c'est le cas a quelques petites bizarreries près.</p> <h3 class="spip">La gestion des langues de l'interface</h3>
<p class="spip">Drupal dispose, dans ses librairies, de la fonction php la plus courte du monde vu qu'elle n'a qu'une lettre : t() ; C'est aussi celle qui est le plus couramment utilisée car elle effectue la traduction des chaines de caractères de l'interface de l'application. En gros chaque fois qu'un module ou une fonction de drupal affiche une ligne de caractère, t l'entoure. Pour faire la liaison entre la chaine d'origine et les chaines traduites, Drupal utilise des fichiers gettext qui sont identifié par l'extension .po. L'avantage d'avoir choisi ce format est qu'il est très répandu notamment pour la gestion des traductions des interfaces des installations Linux. Même si on ne peut pas utiliser les fichiers directement, on peut se servir des applications qui ont été développés comme <a href="http://www.poedit.net/" class="spip_out">poedit</a>.</p> <p class="spip">Par défaut Drupal propose une interface permettant de connaitre le nombre de chaînes utilisées sur votre site et de savoir combien ont été traduites (le lien est admin/build/translate). A partir de ce système la communauté a développé plusieurs modules qui ont été développés pour simplifier la vie d'un traducteur. Celui que je retiendrais en tête est <a href="http://drupal.org/project/l10n_client" class="spip_out">Localization Client</a>.</p> <p class="spip">En ce qui concerne les éléments dynamiques d'un site (termes de menus, termes de taxonomie), vous trouverez toutes une série de module "translation" qui intégrerons ces termes en tant que terme traduisible par les interfaces.</p> <p class="spip">Pour les contenus et les blocks, c'est un peu plus complexes mais possible aussi. Le seul point un peu bizarre est la gestion des titres des blocs. Pour résoudre le problème j'ai eu à recourir à une modification d'un template en ajoutant la fonction t() sur le titre mais je pense qu'il y'a d'autres solution que je n'ai pas exploré.</p> <h3 class="spip">Comment récupérer la traduction d'un module</h3>
<p class="spip">Pour procéder à la traduction des modules, mais aussi récupérer des modules déjà traduit, la communauté Drupal est en train de développer un site spécialisé sur le sujet. Il utilise le pendant de Localization Client, à savoir <a href="http://drupal.org/project/l10n_server" class="spip_out">Localization Server</a>. Ce site es accessible à l'adresse suivante : <a href="http://localize.drupal.org/" class="spip_out">http://localize.drupal.org/</a>. A terme il est destiné a contenir toutes les traductions de tous les modules drupal que l'on trouve sur drupal.org. La<a href="http://localize.drupal.org/translate/languages/fr" class="spip_out"> partie française</a> n'est pas en reste (la création d'un compte est nécessaire pour pouvoir y accéder).</p> <p class="spip">Une fois sur le site, vous pouvez vous rendre sur l'onglet Export pour pouvoir récupérer les fichiers de traduction. Entrez le nom du module que dont vous désirez la traduction dans le champ "Project", comme par exemple Views. Plusieurs options se présentent ensuite à vous comme la version du module que vous utilisez ou les options de packaging. Pour ma part, je choisis le package "All in one file" qui me transmet un fichier .po et laisse les autres options par défaut. En cliquant sur Export vous récupérez le fichier que vous pouvez ensuite importer sur vos site par le biais de l'interface de traduction de l'interface de Drupal. Rien ne vous empêche de rajouter vos propres lignes et traduction puis de les réimporter sur http://localize.drupal.org/. Tout le monde y gagnera.</p> <h3 class="spip">Tous à vos dicos...</h3>
<p class="spip">Voilà, maintenant rien ne vous empêche de participer à l'effort de traduction et de dupliquer vos sites en plusieurs langues. Reste à apprendre les langues ou faire confiance <a href="http://translate.google.fr/?hl=fr&ie=UTF-8&text=&sl=en&tl=fr#" class="spip_out">au nouveau traducteur de Google</a>.</p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/BmPNYac4brUMiVoeLf6nugIr3nQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/BmPNYac4brUMiVoeLf6nugIr3nQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/BmPNYac4brUMiVoeLf6nugIr3nQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/BmPNYac4brUMiVoeLf6nugIr3nQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/d7ixnDHeA6E" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/Translate-local-translate-global</feedburner:origLink></item>



	<item>
		<title>On n'arrête pas le progrès</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/4y5oI0tIHc8/On-arrete-pas-le-progres</link>
		<guid isPermaLink="false">http://pelmel.org/spip/On-arrete-pas-le-progres</guid>
		<dc:date>2009-11-09T19:40:35Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-And-now-something-completely-">And now something completely different...</category>


		<description>Où comment le narrateur découvre que la désocialisation ne passe pas que pars l'internet, mais parfois par le mobile.

-
&lt;a href="http://pelmel.org/spip/-And-now-something-completely-" rel="directory"&gt;And now something completely different...&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">En consultant le maigre mode d'emploi du téléphone de ma dulcinée (un charmant portable griffé "Hello Kitty", seul téléphone "simple" dispo chez Bouygues en ce moment, c'est ça ou Betty Boop) j'ai découvert une fonction insolite.</p> <p class="spip">Cette fonction, appelée "Appels Simulés" permet dixit l'application de <i class="spip">"simuler des appels entrants lorsque vous désirez quitter une réunion ou interrompre une conversation embarrassante"</i>. Il est également possible de faire semblant de parler au téléphone en pré enregistrant un message.</p> <p class="spip">Donc après le filtrage d'appel, voilà le zappage de personne. On arrête pas le progrès.</p> <p class="spip">PS : En cherchant à l'aide de mon ami google, des informations sur ce sujet, je suis tombé sur un <a href="http://yannickrumpala.wordpress.com/2009/11/01/une-autre-tendance-pathogene-du-telephone-portable/" class="spip_out">billet sociologique</a> très intéressant.</p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/PB5_xNrKxW0zzfK42amZ98sCxZw/0/da"><img src="http://feedads.g.doubleclick.net/~a/PB5_xNrKxW0zzfK42amZ98sCxZw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/PB5_xNrKxW0zzfK42amZ98sCxZw/1/da"><img src="http://feedads.g.doubleclick.net/~a/PB5_xNrKxW0zzfK42amZ98sCxZw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/4y5oI0tIHc8" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/On-arrete-pas-le-progres</feedburner:origLink></item>



	<item>
		<title>CCK : Quels champs installer ?</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/f1l4e0IBiVM/CCK-Quels-champs-installer</link>
		<guid isPermaLink="false">http://pelmel.org/spip/CCK-Quels-champs-installer</guid>
		<dc:date>2009-10-25T10:55:56Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-Drupalium-">Drupalium</category>


		<description>Ce petit billet est un post pense bête pour lister les modules fournissant des champs à associer à CCK. Il sera compléter au fur et à mesure de l'avancement des différents projets.

-
&lt;a href="http://pelmel.org/spip/-Drupalium-" rel="directory"&gt;Drupalium&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">Ce petit blog est un post pense bête pour lister les modules fournissant des champs à associer à CCK. Il sera compléter au fur et à mesure de l'avancement des différents projets.</p> <p class="spip">Edit : Sur <a href="http://www.ineation.com/" class="spip_out">Ineation</a> Alexandre a également écris (mais je ne l'avais pas vu) <a href="http://www.ineation.com/7-champs-supplementaires-qui-vont-booster-le-module-cck-pour-drupal-6" class="spip_out">un très bon billet</a> à ce sujet.</p> <p class="spip"><strong class="spip">Date</strong></p> <p class="spip">Lien : <a href="http://drupal.org/project/date" class="spip_out">http://drupal.org/project/date</a></p> <p class="spip">Ce module permet, entre autre, d'ajouter des champs de type Date à vos contenus. Les champs disposent de plusieurs paramètre : format de la date, possibilité de mettre en place une date de début et date de fin, indiquer les éléments (jour, mois, année, heure, seconde) à renseigner. A noter que le champ CCK ne propose pas de widget calendar. Celui-ci est par contre disponible en installant le module Date Popup.<i class="spip"> (Merci Raoul pour la remarque).</i></p> <p class="spip"><strong class="spip">EmailField</strong></p> <p class="spip">Lien : <a href="http://drupal.org/project/email" class="spip_out">http://drupal.org/project/email</a></p> <p class="spip">Un petit module qui ne paie pas de mine mais qui permet d'ajouter des champs email, les valider et les protéger par un Antispam. A noter, dans la même idée, le champ phone : http://drupal.org/project/phone</p> <p class="spip"><strong class="spip">FileField</strong></p> <p class="spip">Lien : <a href="http://drupal.org/project/filefield" class="spip_out">http://drupal.org/project/filefield</a></p> <p class="spip">Ce module permet d'ajouter des champs de types fichiers aux types de contenus. Il fournit un widget d'upload. A noter qu'il est possible de lier des fichiers à des noeuds par l'intermédiaire du module Upload. Il peut-être complété par le module <a href="http://drupal.org/project/imagefield" class="spip_out">ImageField</a> pour la gestion des images.</p> <p class="spip">Edit : Pour les images, j'ai aussi regardé le champ <a href="http://drupal.org/project/imceimage" class="spip_out">IMCE CCK Image</a> qui permet d'associer le champ avec IMCE et, ainsi, permettre la réutilisation de celle ci à travers les différents contenus de votre site. Une solution pratique mais qui manque encore de fonctionnalités (pas de contrôle lors de la suppression d'une image ou difficultés pour créer des répertoires, pas de possibilité immédiate de réutilisation des images dans des galeries). En clair, il reste encore pas mal de travail pour arriver à quelque chose de satisfaisant.</p> <p class="spip"><strong class="spip">Link</strong></p> <p class="spip">Lien : <a href="http://drupal.org/project/link" class="spip_out">http://drupal.org/project/link</a></p> <p class="spip">Ce module permettant d'ajouter des liens à vos types de contenus. Il permet de gérer les liens externes et internes.</p> <p class="spip"><strong class="spip">Location</strong></p> <p class="spip">Lien : <a href="http://drupal.org/project/location" class="spip_out">http://drupal.org/project/location</a></p> <p class="spip">Ce module permet, entre autres fonctionnalités, un champ de type gélocalisation à ajouter aux types de contenus.</p> <p class="spip">To be continued...</p> <p class="spip">PS : Vous pouvez aussi vous référez au projet <a href="http://drupalistic.net/" class="spip_out">drupalistic</a> (en béta) pour rechercher vos modules.</p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/8UNvKUQxVRU_yxJdpN4R3XJjiyk/0/da"><img src="http://feedads.g.doubleclick.net/~a/8UNvKUQxVRU_yxJdpN4R3XJjiyk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8UNvKUQxVRU_yxJdpN4R3XJjiyk/1/da"><img src="http://feedads.g.doubleclick.net/~a/8UNvKUQxVRU_yxJdpN4R3XJjiyk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/f1l4e0IBiVM" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/CCK-Quels-champs-installer</feedburner:origLink></item>



	<item>
		<title>Premiers rides sur la Google Wave</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/nTlZew-xI40/Premiers-rides-sur-la-Google-Wave</link>
		<guid isPermaLink="false">http://pelmel.org/spip/Premiers-rides-sur-la-Google-Wave</guid>
		<dc:date>2009-10-14T19:08:16Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-peLmeL-Blog-">peLmeL Blog</category>


		<description>Aujourd'hui quand google annonce ou distribue un nouveau produit, aussitôt une folie s'empare de la planète geek pour en savoir plus. Le dernier modèle du genre s'appelle Wave. Ce nouveau concept qui rassemble réseaux sociaux, outils collaboratifs et plateforme innovante a été dévoilé à la fin du mois de mai. Quelques mois plus tard, une première vague d'invitation a été lancée, vague qui s'en est suivi par une nouvelle vague où les premiers arrivés ont pu lancer leurs propres invitations qui devraient par la suite envoyer leurs propres invitation. On retrouve là l'effet qui avait fait parler de gmail, et, en même temps, un effet logique de propagation quand on propose une application "sociale".

-
&lt;a href="http://pelmel.org/spip/-peLmeL-Blog-" rel="directory"&gt;peLmeL Blog&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">Aujourd'hui quand google annonce ou distribue un nouveau produit, aussitôt une folie s'empare de la planète geek pour en savoir plus. Le dernier modèle du genre s'appelle Wave. Ce nouveau concept qui rassemble réseaux sociaux, outils collaboratifs et plateforme innovante a été dévoilé à la fin du mois de mai. Quelques mois plus tard, une première vague d'invitation a été lancée, vague qui s'en est suivi par une nouvelle vague où les premiers arrivés ont pu lancer leurs propres invitations qui devraient par la suite envoyer leurs propres invitation. On retrouve là l'effet qui avait fait parler de gmail, et, en même temps, un effet logique de propagation quand on propose une application "sociale".</p> <p class="spip">Grâce à <a href="http://www.roard.com/" class="spip_out">Nicolas</a>, j'ai reçu mon invitation courant de la semaine dernière et je me suis donc rué dessus pour me faire une idée sur le sujet.</p> <h3 class="spip">Première approche...</h3>
<p class="spip">Au cours de ces derniers mois, je n'ai pas eu le temps de regarder la vidéo de présentation de Google, donc je m'aventurais en terrain complément vierge. Au premier abord, l'utilisateur fait face à une sorte d'application webmail avec quelques contacts. C'est avec eux que nous allons interragir ou plutôt échanger des vagues.</p> <p class="spip">Une vague késaco ? Pour l'instant le terme est assez vague justement. En clair, une vague se partage entre les utilisateurs. Elle contient un certains nombres d'éléments plus ou moins complexes : Textes, images, vidéos, liens, gadget google. Ces gadgets sont des extensions qui peuvent être développer par des tiers. Le site en propose quelques unes : un block oui/non/peut-être, une application de Sudoku. Il est très probable qu'à l'instar des applications facebook, on voit arriver des applications en tout genre d'ici les prochains mois.</p> <p class="spip">Ces vagues s'échangent avec des contacts. Chacun peut modifier la vague et les modifications se voient instantanément, comme ce que l'on peut déjà faire dans un google docs. J'imagine d'ailleurs de multiple applications pratiques rien qu'avec du texte et des images :
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Brainstorming.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Critique et présentation de photos, design.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Portes documents avec rédaction en directe de certaines parties.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Préparation d'un évènement avec mise en place d'un plan, d'un parcours.
Les prochaines réunions entre geek vont être funky. Dommage que pour l'instant les application d'intégration de google docs n'aient pas été réalisés (mais en cherchant un peu on doit trouver ça).</p> <p class="spip">Un fait à noter, on peut ajouter à ses contacts des robots. Par exemple, si on se sent un peu seul sur la vague, on peut échanger une conversation avec Elisa, ou jouer au Chi-fou-mi. Cela parait sans doute un peu gadget à première vue, mais des robots intelligents pourrons servir dans des vagues pour répondre à des questions en allant chercher sur wikipedia, ou bien encore propulser le contenu d'une vague sur un blog.</p> <h3 class="spip">Ergonomie et technique</h3>
<p class="spip">D'un point de vue ergonomique, on est chez google, donc c'est relativement pratique. En clair l'interface est belle, pratique mais le souci est que google doit avoir switché en masse car le clic droit n'est pas pris en compte. Dommage, j'aurais aimer avoir un petit menu contextuel pour éditer les messages. Le double clic qui ouvre un menu me semble un peu anti ergonomique. Pour le reste, voici quelques raccourcis clavier bien pratique : <br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> shift+entrée pour valider un message en cours d'édition.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> ctrl+entrée pour répondre à un message quand on édite un message.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> ctrl+e pour éditer un message sur lequel on est positionné.</p> <p class="spip">Je n'ai pas trouvé sur le net une liste exhaustive, mais ça devrais être rapidement le cas.</p> <p class="spip">Autre nouveauté sympathique, il est possible, avec Chrome et Gears, d'uploader des fichiers directement depuis son bureau vers le navigateur. Un vrai plus qui, je l'espère, démocratisera rapidement cette technique bien pratique sur d'autres applications (genre Drupal par exemple).</p> <h3 class="spip">Et la suite...</h3>
<p class="spip">Pour le moment, je n'en suis qu'à la découverte des fonctions. Je commence à avoir quelques contacts mais pas encore d'invitations à donner. C'est un peu le hic, car je pense que pour profiter pleinement des fonctionnalités et du potentiel de Google Wave, il faut le tester dans des conditions de travail. Je vois plusieurs applications très pertinente :</p> <p class="spip"><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> La rédaction partagée d'article avec un export ODT pour finir.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Un support de réunion téléphonique ou même en visu.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Un porte document pour des projets.</p> <p class="spip">On peut même réver et imaginer, pourquoi pas, une extension qui irait taper dans un SVN pour une édition conjointe du code.</p> <p class="spip">Autrement il y'a bien quelques bugs et erreurs de temps en temps, des applications ou bots pas encore bien développés, mais pour une béta on a, comme d'habitude avec google, une application qui est nettement plus abouti que d'autre applications dites stables.</p> <p class="spip">Mais quand même parfois ça frise un peu le bordel : <span class='spip_document_34 spip_documents spip_documents_left' style='float:left; width:520px;' >
<img src='http://pelmel.org/spip/IMG/jpg/Brice_4_-_Google_Wave_14102009_211238.jpg' width='520' height='356' alt="" style='height:356px;width:520px;' class='' /></span></p> <h3 class="spip">Pour finir quelques liens</h3>
<p class="spip">Pour la liste des extensions et des robots, reportez vous à la <a href="http://sites.google.com/site/gwaveextensions/extensions-list" class="spip_out">page suivante</a> ou <a href="http://wavety.com/google-wave/robots/" class="spip_out">cet annuaire</a>.</p> <p class="spip">Si vous voulez en savoir plus sur la construction d'un robot, référez vous <a href="http://code.google.com/intl/fr-FR/apis/wave/extensions/robots/" class="spip_out">à la doc google</a>.</p> <p class="spip">Vous voulez twitter avecf Wave c'est <a href="http://blog.brasseo.net/2009/10/13/ajouter-twitter-a-google-wave/" class="spip_out">ce lien ci</a> qui vous indiquera comment faire.</p> <p class="spip">Bonnes vagues.</p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/hyyry08k8d9XhTm1bH9HQz5LAF4/0/da"><img src="http://feedads.g.doubleclick.net/~a/hyyry08k8d9XhTm1bH9HQz5LAF4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/hyyry08k8d9XhTm1bH9HQz5LAF4/1/da"><img src="http://feedads.g.doubleclick.net/~a/hyyry08k8d9XhTm1bH9HQz5LAF4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/nTlZew-xI40" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/Premiers-rides-sur-la-Google-Wave</feedburner:origLink></item>



	<item>
		<title>Rendez vous Drupal en marge des JDLL</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/UxLm2xVtEU4/Rendez-vous-Drupal-en-marge-des</link>
		<guid isPermaLink="false">http://pelmel.org/spip/Rendez-vous-Drupal-en-marge-des</guid>
		<dc:date>2009-10-08T06:11:44Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-Drupalium-">Drupalium</category>


		<description>Le 15, 16 et 17 octobre prochain aura lieu les JDLL à Lyon. Pour la 11ème année consécutives, les geeks du monde entier sont invités. Le programme est alléchant une fois de plus, dommage qu'on ne puisse se cloner.

-
&lt;a href="http://pelmel.org/spip/-Drupalium-" rel="directory"&gt;Drupalium&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">Le 15, 16 et 17 octobre prochain aura lieu les <a href="http://jdll.org/" class="spip_out">JDLL</a> à Lyon. Pour la 11ème année consécutives, les geeks du monde entier sont invités. Le programme est alléchant une fois de plus, dommage qu'on ne puisse se cloner.</p> <p class="spip">Pour ma part, je ne sais pas encore si j'aurais le temps de passer à plusieurs reprises. Toutefois, en marge des journées, un <a href="http://groups.drupal.org/node/27736#comment-96626" class="spip_out">rendez vous Drupal</a> est organisé le vendredi 16 octobre à 12h30. Ce sera l'occasion d'échanger autour de ce CMS quelques mois après le DrupalCamp.</p> <p class="spip">Donc si vous êtes intéressés, rendez vous vendredi, devant CPE et allez vers les gars à la goutte.</p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/z5I1cwKiTpWSQdiCdeu0WlZ-MOo/0/da"><img src="http://feedads.g.doubleclick.net/~a/z5I1cwKiTpWSQdiCdeu0WlZ-MOo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/z5I1cwKiTpWSQdiCdeu0WlZ-MOo/1/da"><img src="http://feedads.g.doubleclick.net/~a/z5I1cwKiTpWSQdiCdeu0WlZ-MOo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/UxLm2xVtEU4" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/Rendez-vous-Drupal-en-marge-des</feedburner:origLink></item>



	<item>
		<title>Mise en place d'un site de photo avec Drupal</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/HX4TPpgvOxY/Mise-en-place-d-un-site-de-photo</link>
		<guid isPermaLink="false">http://pelmel.org/spip/Mise-en-place-d-un-site-de-photo</guid>
		<dc:date>2009-10-04T10:32:55Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-Drupalium-">Drupalium</category>


		<description>Celà fait un moment que je travaille avec Drupal, et pour mes besoins personnels et disposer ainsi d'un espace qui me permettrais de présenter mes photos de manière un peu différentes de flickr tout en conservant la possibilité de puisser dans ce système les clichés que j'y mettrais.

-
&lt;a href="http://pelmel.org/spip/-Drupalium-" rel="directory"&gt;Drupalium&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">Celà fait un moment que je travaille avec Drupal, et pour mes besoins personnels et disposer ainsi d'un espace qui me permettrais de présenter mes photos de manière un peu différentes de flickr tout en conservant la possibilité de puisser dans ce système les clichés que j'y mettrais.</p> <p class="spip">Drupal s'est rapidement imposé comme le CMS à utiliser. Outre l'expérience que je pourrais retirer à déployer entièrement un site en Drupal et l'administrer au quotidien, il y'a plusieurs avantages d'utiliser Drupal :</p> <p class="spip"><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> La présence de nombreux modules permettant de faciliter le référencement et de statistiques.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> La possibilité de gérer plusieurs formats d'image et de mettre en place des caches.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> La gestion des vues permettant de construire des galeries sous différents formats.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> La gestion du cache et la compilation des css/js.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> L'intégration directe de <a href="http://drupal.org/project/lightbox2" class="spip_out">lightbox</a>.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Une facilité à créer les thèmes.
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Un système multilingue performant (on en reparlera).
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> Divers petits trucs : comptes utilisateurs, agrégateurs de flux, gestion de blocs HTML.</p> <p class="spip">Le premier problème avant de monter le site est de choisir ce que l'on va utiliser. Au départ j'étais parti sur l'idée de créer un type de contenu image que je manipulerais ensuite pour créer mes galeries. Le problème est que l'intégration à l'intérieur des articles s'avère peu évident. En gros difficile de réutiliser une image déjà en place à moins de passer par l'intégration d'un file manager comme <a href="http://drupal.org/project/webfm" class="spip_out">WebFM</a> et ou <a href="http://drupal.org/project/imce" class="spip_out">IMCE</a>. Au final j'ai préféré Image Assist qui créé un noeud image et s'intègre facilement dans les articles avec un redimensionnement à la volée. Cerise sur le gateau, il existe un plugin pour tinyMCE (même si au final je préfère écrire mes articles en bon HTML manuel). La construction des galeries se base sur la taxonomie comme on peut le voir sur l'exemple <a href="http://camera.obscura.fr/fr/category/image-galleries/vues-de-ma-cit%C3%A9" class="spip_out">"Vue(s) de ma cité"</a>.</p> <p class="spip">Pour le reste <a href="http://drupal.org/project/lightbox2" class="spip_out">lightbox2</a> m'a fourni les moyens d'améliorer la galerie en permettant au visiteur de visiteur d'afficher les images en grand. J'ai aussi intégrer <a href="http://drupal.org/project/google_analytics" class="spip_out">google analytics</a>, <a href="http://drupal.org/project/site_map" class="spip_out">sitemap</a>, <a href="http://drupal.org/project/xmlsitemap" class="spip_out">XML sitemap</a>. <a href="http://drupal.org/project/nodewords" class="spip_out">Nodewords</a> devrait suivre bientôt. Je vous conseille toutefois de limité le nombre de modules. La facilité de mise en place de ceux ci cache parfois des incompatibilités (surtout en javascript) majeur. Testez donc les bien individuellement avant de choisir la quinzaine de modules pour animer votre site. A ce niveau là, je pense que <a href="http://drupal.org/project/features" class="spip_out">features</a> va rendre de nombreux service pour la mise en place de site Drupal.</p> <p class="spip">Le thème a été créé à partir d'une maquette HTML et de quelques récupérations d'images et de styles. Je ne suis pas doué pour ce genre de chose mais la mise en place d'un style assez sobre et simple a été plutôt rapide et simple. L'intégration d'une maquette HTML ne m'a jamais semblé si simple.</p> <p class="spip">Dans les faites ça donne <a href="http://camera.obscura.fr/" class="spip_out">http://camera.obscura.fr/</a>. Je vous souhaite une bonne visite et j'espère que vous apprécierez les photos présentes sur ce nouveau site.</p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/TdhR8wp5WpZV2XNmymTdD-HHa4s/0/da"><img src="http://feedads.g.doubleclick.net/~a/TdhR8wp5WpZV2XNmymTdD-HHa4s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/TdhR8wp5WpZV2XNmymTdD-HHa4s/1/da"><img src="http://feedads.g.doubleclick.net/~a/TdhR8wp5WpZV2XNmymTdD-HHa4s/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/HX4TPpgvOxY" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/Mise-en-place-d-un-site-de-photo</feedburner:origLink></item>



	<item>
		<title>Exploration de Zend Application : Diverses recherches</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/ctxYWqMi-Rg/Exploration-de-Zend-Application</link>
		<guid isPermaLink="false">http://pelmel.org/spip/Exploration-de-Zend-Application</guid>
		<dc:date>2009-09-11T15:51:51Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-PHP-Applications-et-Framework-">PHP, Applications et Framework</category>


		<description>&lt;p class="spip"&gt;Avant de prendre quelques semaines de repos bien mérités, j'ai commencé à étudier &lt;a href="http://pelmel.org/spip/Zend-Tool-Installation-et" class="spip_out"&gt;Zend Tool et Zend Application&lt;/a&gt;. Entre temps une nouvelle version de Zend Framework est sortie et j'ai pu investiguer d'avantage et me retrouver confronter à plusieurs questions d'architecture :&lt;/p&gt; &lt;p class="spip"&gt;&lt;img src="http://pelmel.org/spip/squelettes/puce.gif" width="8" height="11" alt="-" /&gt; La mise en place de modules
&lt;br /&gt;&lt;img src="http://pelmel.org/spip/squelettes/puce.gif" width="8" height="11" alt="-" /&gt; L'intégration de l'ORM Doctrine
&lt;br /&gt;&lt;img src="http://pelmel.org/spip/squelettes/puce.gif" width="8" height="11" alt="-" /&gt; L'utilisation d'un répertoire de librairies propres à l'application&lt;/p&gt;

-
&lt;a href="http://pelmel.org/spip/-PHP-Applications-et-Framework-" rel="directory"&gt;PHP, Applications et Framework&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">Avant de prendre quelques semaines de repos bien mérités, j'ai commencé à étudier <a href="http://pelmel.org/spip/Zend-Tool-Installation-et" class="spip_out">Zend Tool et Zend Application</a>. Entre temps une nouvelle version de Zend Framework est sortie et j'ai pu investiguer d'avantage et me retrouver confronter à plusieurs questions d'architecture :</p> <p class="spip"><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> La mise en place de modules
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> L'intégration de l'ORM Doctrine
<br /><img src="http://pelmel.org/spip/local/cache-vignettes/L8xH11/puce-b95cf.gif" width='8' height='11' alt="-" style='height:11px;width:8px;' class='' /> L'utilisation d'un répertoire de librairies propres à l'application</p> <h3 class="spip">Idée de départ</h3>
<p class="spip">Premier constat, la documentation autour de Zend Application est encore assez faible. Effectivement, on voit dans le Quick Start des références à ce composant, mais il s'avère très léger (normal finalement pour un quickie).</p> <p class="spip">En consultant rapidement l'aide de de la fonction zf.sh, je constate la présence d'une fonction permettant de créer des modules que j'execute aussitôt.</p> <div class="coloration_code"><div style="text-align: $spip_lang_left;" class="spip_cadre shell"><div style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">zf.sh create module monmodule</div></li></ol></div></div><div class='cadre_download' style='text-align: right;'><a href='http://pelmel.org/spip/local/cache-code/ac11a38cab9a6571a6370053ae2c38b6.txt' style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>Télécharger</a></div></div>
<p class="spip">Par la suite, et pour étoffer mon module, je créé un controlleur Index à l'aide de la commande <strong class="spip">zf.sh create controller name index-action-included module</strong> où <strong class="spip">name</strong> est le nom du contrôleur, <strong class="spip">index-action-included</strong> une variable permettant d'indiquer si l'on génère une action index pour le contrôleur (avec son templae) et enfin <strong class="spip">module</strong> est le nom du module. En ligne de commande ça donne ça :</p>
<div class="coloration_code"><div style="text-align: $spip_lang_left;" class="spip_cadre shell"><div style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">zf.sh create controller index 1 monmodule</div></li></ol></div></div><div class='cadre_download' style='text-align: right;'><a href='http://pelmel.org/spip/local/cache-code/d4a5037985d5c83b1040d89d03df8c96.txt' style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>Télécharger</a></div></div>
<p class="spip">Petit problème, l'adresse suivante http://localhost/monmodule/ affiche le message suivant : <strong class="spip">Message : Invalid controller specified (monmodule)</strong>. L'application ne trouve pas le module. Qu'à celà ne tienne, nous allons ajouter, dans application.ini, l'emplacement des modules :</p> <div class="coloration_code"><div style="text-align: $spip_lang_left;" class="spip_cadre ini"><div class="ini" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.frontController.<span style="color: #000099;">moduleDirectory </span>=<span style="color: #660066;"> APPLICATION_PATH </span><span style="color: #933;">"/modules"</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.modules<span style="">&#91;</span><span style="">&#93;</span> = <span style="color: #933;">""</span></div></li></ol></div></div><div class='cadre_download' style='text-align: right;'><a href='http://pelmel.org/spip/local/cache-code/b80c61713b89a3adbfaad1db520a3463.txt' style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>Télécharger</a></div></div>
<p class="spip">Deuxième petit problème, nous avons maintenant le message suivant :
<strong class="spip">Message : Invalid controller class ("Monmodule_IndexController")</strong>. Le problème se situe maintenant dans le contrôleur lui-même, en effet la classe IndexController n'est pas préfixé du namespace MonModule en renommant, dans le fichier monmodule/controllers/IndexController.php IndexController par MonModule_IndexController on obtient la page d'accueil du projet.</p> <p class="spip">Et voilà, désormais nous pouvons créer nos modules en faisant attention à bien indiquer les namespaces. En hackant le provider de Zend Framework, je suis sur qu'on peut s'économiser encore un peu de temps.</p> <h3 class="spip">Pour aller un peu plus loin</h3>
<p class="spip">J'ai pu remarquer que Zend_Application, par l'intermédiaire des ressources permet de grandement se simplifier la vie en ajoutant des paramètres resources dans application.ini pour créer un Zend_DB comme on peut le voir dans le <a href="http://framework.zend.com/docs/quickstart/create-a-model-and-database-table" class="spip_out">QuickStart</a>.</p> <p class="spip">Exemple :</p> <p class="spip">Mise en place dans application.ini</p> <div class="coloration_code"><div style="text-align: $spip_lang_left;" class="spip_cadre ini"><div class="ini" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.db.<span style="color: #000099;">adapter </span>= <span style="color: #933;">"pdo_mysql"</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.db.params.<span style="color: #000099;">host </span>= <span style="color: #933;">"localhost"</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.db.params.<span style="color: #000099;">username </span>= <span style="color: #933;">"user"</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.db.params.<span style="color: #000099;">password </span>= <span style="color: #933;">"pass"</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.db.params.<span style="color: #000099;">dbname </span>= <span style="color: #933;">"mydb"</span></div></li></ol></div></div><div class='cadre_download' style='text-align: right;'><a href='http://pelmel.org/spip/local/cache-code/1baed4711093b878b999493e663ecc1b.txt' style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>Télécharger</a></div></div>
<p class="spip">Modification du bootstrap pour récupérer l'adaptateur</p> <div class="coloration_code"><div style="text-align: $spip_lang_left;" class="spip_cadre PHP"><div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Récupération de l'adaptateur </span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$bootstrap</span> = <span style="color: #0000ff;">$application</span>-&gt; <span style="color: #006600;">getBootstrap</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$resource</span> = <span style="color: #0000ff;">$bootstrap</span>-&gt; <span style="color: #006600;">getPluginResource</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'db'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$db</span> = <span style="color: #0000ff;">$resource</span>-&gt;<span style="color: #006600;">getDbAdapter</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li></ol></div></div><div class='cadre_download' style='text-align: right;'><a href='http://pelmel.org/spip/local/cache-code/4f2560d6a5f3bd3a1305e0eddfc0dc7a.txt' style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>Télécharger</a></div></div>
<p class="spip">Dans mon application, j'ai décidé d'utiliser, pour diverses raisons, l'ORM Doctrine. Pour celà j'ai suivi le très célèbre tutorial : <a href="http://ruben.savanne.be/articles/integrating-zend-framework-and-doctrine" class="spip_out">Integrating Zend Framework and Doctrine</a> mais il date maintenant un peu et ne prends pas en compte les dernières nouveautés de Zend Framework.</p> <p class="spip">Celui ci par contre <a href="http://www.danceric.net/2009/06/06/doctrine-orm-and-zend-framework/" class="spip_out">http://www.danceric.net/2009/06/06/doctrine-orm-and-zend-framework/</a> propose une solution complémentaire qui comprends Zend Application. Au final c'est celle que j'ai appliquée.</p> <p class="spip">Petit Bonus : Qui dit Doctrine, dit édition de fichierr yaml. Pour vous faciliter la tâche, sous eclipse, voici un plugin fort utile : <a href="http://www.symfony.pl/yamleditor/" class="spip_out">YAML Editor</a>.</p> <p class="spip">teasing : Pour faciliter l'intégration Zend_Form, Doctrine, j'ai utilisé cette librairie http://github.com/Vladev/zend-form-doctrine/tree/master. Je vous ferais un retour quand j'aurais des premiers retours.</p> <h3 class="spip">Enregistrer un namespace</h3>
<p class="spip">Le projet impliquait aussi de développer des nouvelles librairies permettant d'étendre les fonctionnalités de Zend Framework. J'ai donc créer un répertoire MyLib dans le répertoire library de mon projet Zend Application. L'enregistrement du namespace se fait ensuite dans le fichier de bootstrap en rajoutant la fonction _initAutoload :</p>
<div class="coloration_code"><div style="text-align: $spip_lang_left;" class="spip_cadre php"><div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">protected <span style="color: #000000; font-weight: bold;">function</span> _initAutoload<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">require_once</span> <span style="color: #ff0000;">"Zend/Loader/Autoloader.php"</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$autoloader</span> = Zend_Loader_Autoloader::<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$autoloader</span>-&gt;<span style="color: #006600;">registerNamespace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'MyLib_'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$autoloader</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div></li></ol></div></div><div class='cadre_download' style='text-align: right;'><a href='http://pelmel.org/spip/local/cache-code/07d99a3d47a44ec18d7b0f0548eb85e4.txt' style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>Télécharger</a></div></div>
<p class="spip">Et voilà, désormais quand je fais un new MyLib_Class() ; , Zend Framework va rechercher le fichier Class.php dans le répertoire MyLib et instancier la classe MyLib_Class.</p> <h3 class="spip">Conclusion</h3>
<p class="spip">Je n'ai sans doute pas eu une utilisation très conventionnelle de Zend Application et les commentaires sont les bienvenus. Ce que j'en ressort, c'est que la recherche d'informations est assez difficile sur Zend Framework. C'est un peu pour ça que j'ai voulu synthétiser dans un billet le résultat des mes explorations. C'est un peu touffu mais j'espère avoir l'occasion de rassembler plus tard la documentation par grand thème ou bien sous la forme d'un jeu dont vous êtes le héros ("je veux faire ça alors je me rends ici ou là").</p> <p class="spip">La documentation officielle est exhaustive et traduite, dans sa plus grande partie, en français. Toutefois il manque des exemples concrets permettant d'aller plus loin. Heureusement nombre d'utilisateurs publient des tutoriaux. Un conseil toutefois, vérifiez bien la date de publication. Zend Framework ayant énormément évolués ces dernières années (et mois) que le code peut parfois être erroné ou incomplet.</p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/KnpPhTHIWInbYOTrHmIJ8tx1yjQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/KnpPhTHIWInbYOTrHmIJ8tx1yjQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KnpPhTHIWInbYOTrHmIJ8tx1yjQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/KnpPhTHIWInbYOTrHmIJ8tx1yjQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/ctxYWqMi-Rg" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/Exploration-de-Zend-Application</feedburner:origLink></item>



	<item>
		<title>Class SSH2/SFTP en PHP</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/FirJKgXZ3PM/Class-SSH2-SFTP-en-PHP</link>
		<guid isPermaLink="false">http://pelmel.org/spip/Class-SSH2-SFTP-en-PHP</guid>
		<dc:date>2009-09-07T20:34:26Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-Bouts-de-code-">Bouts de code</category>


		<description>Dans le cadre d'un projet, j'ai eu la charge de la réalisation d'un gestionnaire automatique de transfert SFTP. Le langage étant libre, j'ai choisi de le réaliser en PHP. Pour ce faire, j'ai tout d'abord du procéder à l'installation de la librairie SSH2 pour PHP puis développer une classe.

-
&lt;a href="http://pelmel.org/spip/-Bouts-de-code-" rel="directory"&gt;Bouts de code&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">Dans le cadre d'un projet, j'ai eu la charge de la réalisation d'un gestionnaire automatique de transfert SFTP. Le langage étant libre, j'ai choisi de le réaliser en PHP. Pour ce faire, j'ai tout d'abord du procéder à l'installation de la librairie SSH2 pour PHP puis développer une classe.</p> <h3 class="spip">Installation des librairies</h3>
<p class="spip">Pour pouvoir utiliser SFTP (à ne pas confondre avec FTPS), il convient d'ajouter une librairie supplémentaire. Sous Windows, pas de soucis, ça a déjà été compilé pour vous. Il vous suffira de télécharger la dll de la placer dans les répertoires de vos librairies, puis de déclarer php_ssh2.dll dans php.ini.</p> <p class="spip">Du coté de Linux, vous pouvez utiliser la commande pecl pour compiler la librairie :</p>
<div class="coloration_code"><div style="text-align: $spip_lang_left;" class="spip_cadre shell"><div style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pecl install ssh2</div></li></ol></div></div><div class='cadre_download' style='text-align: right;'><a href='http://pelmel.org/spip/local/cache-code/8728756abb1b9f7e8ff15bbcd8ee58a3.txt' style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>Télécharger</a></div></div>
<p class="spip">A noter qu'il est possible de se passer de pecl en téléchargeant l'archive et la compilant. Quelque soit la méthode, il faudra ensuite de déplacer la librairie ssh2.so dans le répertoire des librairies et ensuites de modifier le fichier php.ini.</p> <p class="spip">Attention à ce que votre système contienne la librairie SSH2.</p> <h3 class="spip">Classe de transfert SFTP</h3>
<p class="spip">Pour la classe de transfert, j'ai pris le partir de construira la connexion dès l'instanciation de l'objet. Les méthodes de la classe permettent de récupérer un répertoire entier ou bien un fichier individuel et envoyer une série de fichier, ainsi qu'un fichier individuel.</p>
<div class="coloration_code"><div style="text-align: $spip_lang_left;" class="spip_cadre php"><div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">class</span> Transfert_sftp </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * Information de connection</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @var resource</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #0000ff;">$_connection</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * Information de flux</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @var resource</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #0000ff;">$_stream</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$host</span>, <span style="color: #0000ff;">$port</span>, <span style="color: #0000ff;">$login</span>, <span style="color: #0000ff;">$password</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$this</span>-&gt;_connection = ssh2_connect<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$host</span>, <span style="color: #0000ff;">$port</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!<span style="color: #0000ff;">$this</span>-&gt;_connection<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">// Logguer une erreur de connexion</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw newException<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Erreur de connexion'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>! ssh2_auth_password<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&gt;_connection, <span style="color: #0000ff;">$login</span>, <span style="color: #0000ff;">$password</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Erreur d<span style="color: #000099; font-weight: bold;">\'</span>authentification avec '</span>.<span style="color: #0000ff;">$login</span> .<span style="color: #ff0000;">' et '</span> . <span style="color: #0000ff;">$password</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$this</span>-&gt;_stream = ssh2_sftp<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&gt;_connection<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>! <span style="color: #0000ff;">$this</span>-&gt;_stream<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Impossible d<span style="color: #000099; font-weight: bold;">\'</span>initialiser la connection SFTP'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $remoteDir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $localDir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $params</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @return unknown_type</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getDir <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$remoteDir</span>, <span style="color: #0000ff;">$localDir</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$streamDir</span> = <span style="color: #ff0000;">'ssh2.sftp://'</span>.<span style="color: #0000ff;">$this</span>-&gt;_stream.<span style="color: #0000ff;">$remoteDir</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$handle</span> = <a href="http://www.php.net/opendir"><span style="color: #000066;">opendir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$streamDir</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$handle</span> === <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Impossible de se placer sur le répertoire '</span>.<span style="color: #0000ff;">$remoteDir</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span> !== <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span> = <a href="http://www.php.net/readdir"><span style="color: #000066;">readdir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$handle</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&gt;_allowedFile<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span>, <span style="color: #0000ff;">$params</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">getFile</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$remoteDir</span>, <span style="color: #0000ff;">$file</span>, <span style="color: #0000ff;">$localDir</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $localDir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $remoteDir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @return unknown_type</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> putDir <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$localDir</span>, <span style="color: #0000ff;">$remoteDir</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$handle</span> = <a href="http://www.php.net/opendir"><span style="color: #000066;">opendir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$localDir</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span> !== <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span> = <a href="http://www.php.net/readdir"><span style="color: #000066;">readdir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$handle</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&gt;_allowedFile<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">putFile</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$localDir</span>, <span style="color: #0000ff;">$file</span>, <span style="color: #0000ff;">$remoteDir</span>, <span style="color: #0000ff;">$params</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $remoteDir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $remoteFile</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $localDir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getFile <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$remoteDir</span>, <span style="color: #0000ff;">$nameFile</span>, <span style="color: #0000ff;">$localDir</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$streamFile</span> = <span style="color: #ff0000;">'ssh2.sftp://'</span>.<span style="color: #0000ff;">$this</span>-&gt;_stream.<span style="color: #0000ff;">$remoteDir</span>.<span style="color: #ff0000;">'/'</span>.<span style="color: #0000ff;">$nameFile</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$localFile</span> = <span style="color: #0000ff;">$localDir</span>.<span style="color: #ff0000;">'/'</span>.<span style="color: #0000ff;">$nameFile</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #000066;">file_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$streamFile</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$contents</span> = <a href="http://www.php.net/file_get_contents"><span style="color: #000066;">file_get_contents</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$streamFile</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$contents</span> === <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Impossible de récupérer '</span>.<span style="color: #0000ff;">$remoteFile</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$return</span> = file_put_contents<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$localFile</span>, <span style="color: #0000ff;">$contents</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$return</span> === <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Impossible de d<span style="color: #000099; font-weight: bold;">\'</span>écrire '</span>.<span style="color: #0000ff;">$localFile</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Fichier '</span>.<span style="color: #0000ff;">$remoteFile</span>.<span style="color: #ff0000;">' inexistant'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $localDir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $localFile</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $remoteDir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> putFile <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$localDir</span>, <span style="color: #0000ff;">$nameFile</span>, <span style="color: #0000ff;">$remoteDir</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$streamFile</span> = <span style="color: #ff0000;">'ssh2.sftp://'</span>.<span style="color: #0000ff;">$this</span>-&gt;_stream.<span style="color: #0000ff;">$remoteDir</span>.<span style="color: #ff0000;">'/'</span>.<span style="color: #0000ff;">$nameFile</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$localFile</span> = <span style="color: #0000ff;">$localDir</span>.<span style="color: #ff0000;">'/'</span>.<span style="color: #0000ff;">$localFile</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #000066;">file_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$localFile</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$contents</span> = <a href="http://www.php.net/file_get_contents"><span style="color: #000066;">file_get_contents</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$localFile</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$contents</span> === <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Impossible d<span style="color: #000099; font-weight: bold;">\'</span>envoyer '</span>.<span style="color: #0000ff;">$nameFile</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$return</span> = file_put_contents<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$streamFile</span>, <span style="color: #0000ff;">$contents</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$return</span> === <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Impossible de d<span style="color: #000099; font-weight: bold;">\'</span>écrire '</span>.<span style="color: #0000ff;">$streamFile</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Fichier '</span>.<span style="color: #0000ff;">$localFile</span>.<span style="color: #ff0000;">' inexistant'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $file</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @param $params</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @return boolean</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _allowedFile <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span>, <span style="color: #0000ff;">$params</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/is_dir"><span style="color: #000066;">is_dir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span><span style="color: #66cc66;">&#41;</span> || <a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"$file"</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">"."</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">{</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div></li></ol></div></div><div class='cadre_download' style='text-align: right;'><a href='http://pelmel.org/spip/local/cache-code/81794f93f7614965c7d52a2f6554a455.txt' style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>Télécharger</a></div></div>
<p class="spip">La classe est perfectible, n'hésitez pas à me faire vos remarques, vos retours pour améliorer . Pour ma part je l'ai insérer dans un ensemble plus grand avec une factory pour gérer également les connections FTP. Je l'ai également intégrer dans Zend Framework avec une très grande facilité.</p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/sSWlO9LItwuxAuQK7R4xcfSdGE4/0/da"><img src="http://feedads.g.doubleclick.net/~a/sSWlO9LItwuxAuQK7R4xcfSdGE4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/sSWlO9LItwuxAuQK7R4xcfSdGE4/1/da"><img src="http://feedads.g.doubleclick.net/~a/sSWlO9LItwuxAuQK7R4xcfSdGE4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/FirJKgXZ3PM" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/Class-SSH2-SFTP-en-PHP</feedburner:origLink></item>



	<item>
		<title>Ca sent le cartable neuf...</title>
		<link>http://feedproxy.google.com/~r/Pelmelorg/~3/XEWo3tuofeM/Ca-sent-le-cartable-neuf</link>
		<guid isPermaLink="false">http://pelmel.org/spip/Ca-sent-le-cartable-neuf</guid>
		<dc:date>2009-08-21T09:01:13Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Brice Favre</dc:creator>

<category domain="http://pelmel.org/spip/-peLmeL-Blog-">peLmeL Blog</category>


		<description>Rien de tel que trois semaines de vacances pour se requinquer, surtout après une année particulièrement chaotique.

-
&lt;a href="http://pelmel.org/spip/-peLmeL-Blog-" rel="directory"&gt;peLmeL Blog&lt;/a&gt;


		</description>


 <content:encoded><![CDATA[<div class='rss_texte'><p class="spip">Rien de tel que trois semaines de <a href="http://www.flickr.com/photos/bricef/tags/vacances/" class="spip_out">vacances</a> pour se requinquer, surtout après une année particulièrement chaotique.</p> <p class="spip">Comme chaque rentrée voilà l'heure des nouvelles résolutions et projets avec un regain de motivation. Reste à savoir s'il seront réalisés ?</p> <p class="spip">Dans un immédiat très proche, je compte migrer pelmel.org sur un novueau compte afin de me permettre plus de liberté et créer de nouveaux sites. LE site sera donc peut-être en maintenance quelques temps.</p> <p class="spip">Autrement, j'ai décidé cette année d'utiliser d'avantage twitter pour détailler et échanger sur mon travail. Contrairement à <a href="http://twitter.com/bricef" class="spip_out">mon compte personnel</a>, les tweets seront public et, la plupart du temps, en anglais. N'hésitez pas à me suivre si vous êtes intéressés par PHP en général et plus particulièrement Copix, Drupal, Zend Framework et Symfony : <a href="http://twitter.com/briceatwork" class="spip_out">http://twitter.com/briceatwork</a></p> <p class="spip">Bonne rentrée !</p> <p class="spip"><a href="http://www.flickr.com/photos/bricef/3836052259/" title="Eclats de soleil by Brice F., on Flickr"><img src="http://pelmel.org/spip/local/cache-vignettes/L500xH334/3836052259_0c6a5-f4622.jpg" width='500' height='334' alt="Eclats de soleil" style='height:334px;width:500px;' class='' /></a></p></div>
		
		
<p><a href="http://feedads.g.doubleclick.net/~a/9G-biXcRWwJZh7LEoZxHydtAPDc/0/da"><img src="http://feedads.g.doubleclick.net/~a/9G-biXcRWwJZh7LEoZxHydtAPDc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/9G-biXcRWwJZh7LEoZxHydtAPDc/1/da"><img src="http://feedads.g.doubleclick.net/~a/9G-biXcRWwJZh7LEoZxHydtAPDc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Pelmelorg/~4/XEWo3tuofeM" height="1" width="1"/>]]></content:encoded>


		

	<feedburner:origLink>http://pelmel.org/spip/Ca-sent-le-cartable-neuf</feedburner:origLink></item>





</channel>

</rss>
