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

<channel>
	<title>Grummfy&#039;s project &#187; web</title>
	<atom:link href="http://grummfy.be/blog/key/web/feed" rel="self" type="application/rss+xml" />
	<link>http://grummfy.be/blog</link>
	<description>Mes projets, mes rêves, mes envies, ...</description>
	<lastBuildDate>Mon, 02 Jan 2012 00:03:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ZF : ACL et ressources multiple</title>
		<link>http://grummfy.be/blog/360#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/360#comments</comments>
		<pubDate>Wed, 13 Oct 2010 21:19:21 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=360</guid>
		<description><![CDATA[Utiliser les ACL dans Zend Framework en ajoutant le support de ressource multiple via '*'.]]></description>
			<content:encoded><![CDATA[<p>Lorsque l&#8217;on utilise des ACL dans Zend Framework, une chose assez embêtante est de devoir tout mettre en place<sup class='footnote'><a href='#fn-360-1' id='fnref-360-1'>1</a></sup>. Pour ma part, j&#8217;ai par facilité voulu ajouté le support de ressource multiple.</p>
<p>Avant de commencer, il convient de contextualisé les choses, les ACL de ZF pouvant être utilisé de bien des manière.</p>
<p>Dans le cas qui nous intéresse, j&#8217;ai simplement défini ceci :</p>
<ul>
<li>les ressources<sup class='footnote'><a href='#fn-360-2' id='fnref-360-2'>2</a></sup> = module.controller</li>
<li>les privilèges<sup class='footnote'><a href='#fn-360-3' id='fnref-360-3'>3</a></sup> = action</li>
</ul>
<p>Ce que je voulait c&#8217;est pouvoir définir une ressource pour tous les contrôleurs. La syntaxe évidente qu&#8217;il m&#8217;est venu est la suivante : module.*</p>
<p>Dans ma classe qui étend Zend_ACL j&#8217;ai simplement fait ceci :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> isAllowed<span style="color: #009900;">&#40;</span><span style="color: #000088;">$role</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$resource</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$privilege</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span> <span style="color: #339933;">===</span> <span style="color: #000088;">$resource</span><span style="color: #009900;">&#41;</span>
    		<span style="color: #b1b100;">return</span> parent<span style="color: #339933;">::</span><span style="color: #004000;">isAllowed</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$role</span><span style="color: #339933;">,</span> <span style="color: #000088;">$resource</span><span style="color: #339933;">,</span> <span style="color: #000088;">$privilege</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    	<span style="color: #000088;">$resources</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getResourcesPossibility<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resource</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resources</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$resource</span><span style="color: #009900;">&#41;</span>
    	<span style="color: #009900;">&#123;</span>
    		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>has<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resource</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> parent<span style="color: #339933;">::</span><span style="color: #004000;">isAllowed</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$role</span><span style="color: #339933;">,</span> <span style="color: #000088;">$resource</span><span style="color: #339933;">,</span> <span style="color: #000088;">$privilege</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    		<span style="color: #009900;">&#123;</span>
    			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    		<span style="color: #009900;">&#125;</span>
    	<span style="color: #009900;">&#125;</span>
    	<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getResourcesPossibility<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resource</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    	<span style="color: #000088;">$ret</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resource</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span> <span style="color: #339933;">!==</span> <span style="color: #000088;">$resource</span><span style="color: #009900;">&#41;</span>
    	<span style="color: #009900;">&#123;</span>
    		<span style="color: #000088;">$resources</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$resource</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    		<span style="color: #000088;">$cptRessources</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resources</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$cptRessources</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;=</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
    		<span style="color: #009900;">&#123;</span>
    			<span style="color: #000088;">$resources</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$cptRessources</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'*'</span><span style="color: #339933;">;</span>
    		<span style="color: #009900;">&#125;</span>
    		<span style="color: #000088;">$ret</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$resources</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<span style="color: #009900;">&#125;</span>
    	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$ret</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Ceci peut bien entendu être enrichi mais permet au moins de profiter de l&#8217;utilisation des ACL dans le menu et sur des aides de vue qui serait éventuellement définie comme expliqué dans la plupart des tutoriaux.</p>
<p>Pour en savoir plus sur les ACL et Zend Framework, je vous renvoi a un très bon <a href="http://julien-pauli.developpez.com/tutoriels/zend-framework/atelier/aclmvc/" target="_blank">article</a>.</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-360-1'>surtout si on utilise l&#8217;aide de vue pour généré un menu (Zend_navigation) <span class='footnotereverse'><a href='#fnref-360-1'>&#8617;</a></span></li>
<li id='fn-360-2'>resource <span class='footnotereverse'><a href='#fnref-360-2'>&#8617;</a></span></li>
<li id='fn-360-3'>privilege <span class='footnotereverse'><a href='#fnref-360-3'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/360/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZF : génération automatique du fichier de navigation et ACL</title>
		<link>http://grummfy.be/blog/333#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/333#comments</comments>
		<pubDate>Mon, 16 Aug 2010 20:47:14 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[délire]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=333</guid>
		<description><![CDATA[Lors de l&#8217;utilisation du mécanisme d&#8217;ACL et de génération de menu dans Zend Framework, il est intéressant de limiter l&#8217;affichage de ce menu en utilisant les ressources et privilèges associer. Pour ma part, j&#8217;utilise un fichier XML pour construire mon menu, mon sitemap, &#8230; 1. Et comme beaucoup je génère mon projet ZF à l&#8217;aide [...]]]></description>
			<content:encoded><![CDATA[<p>Lors de l&#8217;utilisation du mécanisme d&#8217;ACL et de génération de menu dans Zend Framework, il est intéressant de limiter l&#8217;affichage de ce menu en utilisant les ressources et privilèges associer.</p>
<p>Pour ma part, j&#8217;utilise un fichier XML pour construire mon menu, mon sitemap, &#8230; <sup class='footnote'><a href='#fn-333-1' id='fnref-333-1'>1</a></sup>. Et comme beaucoup je génère mon projet ZF à l&#8217;aide de Zend_Tool. Je trouvais donc dommage de devoir réécrire pratiquement la même chose que ce que j&#8217;avais déclaré dans Zend_Tool pour reconstruire mon menu. J&#8217;ai donc décidé de <em>rapidement</em> écrire un petit script qui reprendrait le fichier XML du projet et le transformerait en menu &#8230;</p>
<p>À noter que le script devrait certainement être amélioré, mais que cela permet un gain de temps considérable &#8230;</p>
<p><a href="http://grummfy.com/download/PlusScript/zfProject2Navigation.phps" target="_blank">Téléchargement</a></p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-333-1'>Comme expliquer dans le manuel http://framework.zend.com/manual/fr/zend.navigation.html <span class='footnotereverse'><a href='#fnref-333-1'>&#8617;</a></span></li>
</ol>
</div>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F333&amp;linkname=ZF%20%3A%20g%C3%A9n%C3%A9ration%20automatique%20du%20fichier%20de%20navigation%20et%20ACL" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F333&amp;linkname=ZF%20%3A%20g%C3%A9n%C3%A9ration%20automatique%20du%20fichier%20de%20navigation%20et%20ACL" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F333&amp;linkname=ZF%20%3A%20g%C3%A9n%C3%A9ration%20automatique%20du%20fichier%20de%20navigation%20et%20ACL" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F333&amp;linkname=ZF%20%3A%20g%C3%A9n%C3%A9ration%20automatique%20du%20fichier%20de%20navigation%20et%20ACL" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F333&amp;linkname=ZF%20%3A%20g%C3%A9n%C3%A9ration%20automatique%20du%20fichier%20de%20navigation%20et%20ACL" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F333&amp;linkname=ZF%20%3A%20g%C3%A9n%C3%A9ration%20automatique%20du%20fichier%20de%20navigation%20et%20ACL" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F333&amp;title=ZF%20%3A%20g%C3%A9n%C3%A9ration%20automatique%20du%20fichier%20de%20navigation%20et%20ACL" id="wpa2a_2"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/333/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Réécriture d’URL, alias et plusieurs développeurs sur Apache</title>
		<link>http://grummfy.be/blog/321#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/321#comments</comments>
		<pubDate>Thu, 12 Aug 2010 21:07:55 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[url rewriting]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=321</guid>
		<description><![CDATA[Une solution à la problématique des réécritures d'url sans rewriteBase tout en étant utilisable par plusieurs développeurs]]></description>
			<content:encoded><![CDATA[<p>Lorsque l&#8217;on travaille à plusieurs sur un projet, c&#8217;est toujours intéressant. Malheureusement, cela peut aussi entrainer divers problèmes. Je vais tenter de vous expliquer un ﻿﻿obstacle qui peut vite devenir très chi*nt&#8230;</p>
<p>Pour présenter cette problématique, je vais prendre exemple sur ce que je développe actuellement. Le site en cours de création se base sur zend framework et nécessite une réécriture d&#8217;URL. Il faut savoir qu&#8217;Apache utilise le chemin physique<sup class='footnote'><a href='#fn-321-1' id='fnref-321-1'>1</a></sup> comme base pour calculer le chemin vers le fichier réécrit sauf si on lui précise une directive RewriteBase différente. Le problème survient à cet endroit, plusieurs développeurs entrainent plusieurs machines et donc plusieurs configurations différentes!</p>
<p>La solution de base est que chaque personne utilisant un alias Apache définit un RewriteBase. Cependant, cela veut dire qu’a chaque nouvelle version du fichier .htaccess il faut redéfinir celui-ci.</p>
<p>La réponse la plus simple consiste à utiliser un RewriteCond sur l&#8217;hostname du serveur et bien entendu à l&#8217;utiliser lors de l&#8217;accès aux tests locaux ou non &#8230;</p>
<p>Exemple de configuration :</p>
<ul>
<li> nom du serveur : grummfy</li>
<li>URL appelée : http://grummfy/serveur/dev/projet/example.com/&#8230; (Si vous utilise http://localhost/ la directive HTTP_HOST vaudra localhost)</li>
<li>ALIAS : /serveur/ =&gt; /media/data/serveur/</li>
</ul>
<p>Le fichier .htacccess contiendra ceci :<br />
<code>SetEnv APPLICATION_ENV development<br />
php_value session.auto_start 0<br />
php_flag magic_quotes_gpc off<br />
RewriteEngine On<br />
RewriteCond %{REQUEST_FILENAME} -s [OR]<br />
RewriteCond %{REQUEST_FILENAME} -l [OR]<br />
RewriteCond %{REQUEST_FILENAME} -d<br />
RewriteRule ^.*$ - [NC,L]<br />
RewriteCond %{HTTP_HOST} grummfy<br />
RewriteRule ^.*$ /serveur/dev/projet/example.com/index.php [NC,L]<br />
RewriteRule ^.*$ index.php [NC,L]</code></p>
<p>Le fait d&#8217;utiliser le rewrite flag &laquo;&nbsp;L&nbsp;&raquo; permet de sortir de la réécriture d&#8217;URL. Si le hostname du serveur n&#8217;est pas grummfy il appliquera la règle par défaut, à savoir tenter de trouver index.php dans /media/data/serveur/dev/projet/example.com/ comme si on avait effectuer un appel depuis http://media/data/serveur/dev/projet/example.com/</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-321-1'>physical-directory-path <span class='footnotereverse'><a href='#fnref-321-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/321/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebHook Google Code &#8211; recevoir un mail à chaque commit</title>
		<link>http://grummfy.be/blog/310#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/310#comments</comments>
		<pubDate>Fri, 18 Jun 2010 23:58:59 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=310</guid>
		<description><![CDATA[Google code et webhook : envoyer un email a chaque commit]]></description>
			<content:encoded><![CDATA[<p>Dans Google code il y a la possibilité d&#8217;utiliser un gestionnaire de version tel que subversion (svn) ou mercurial (hg). C&#8217;est bien pratique, mais malheureusement, de base, rien n&#8217;est prévu pour prévenir (excepté par flux RSS) les gens de ces mises à jour. Cependant, Google code permet d&#8217;utiliser un webhook en post commit.</p>
<h2>Qu&#8217;est-ce qu&#8217;un webhook?</h2>
<p>Un webhook c&#8217;est un &laquo;&nbsp;crochet web&nbsp;&raquo;, c&#8217;est-à-dire une URL a appelée après (avant ou pendant) une action X. Dans notre cas, après chaque commit une URL est appelée.</p>
<h2>Utilisation</h2>
<p>Voici un exemple de code que j&#8217;utilise pour plusieurs de mes projets :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// project name</span>
<span style="color: #000088;">$projects</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mon-super-projet'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// google code webhook key</span>
<span style="color: #000088;">$keys</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'b-box'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Top-Secret_key_fourni_par_google-dans-l-adminsitration'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//user agent from google code</span>
<span style="color: #000088;">$useragent</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Google Code Project Hosting (+http://code.google.com/p/support/wiki/PostCommitWebHooks)'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//email of all owner (eg. project chief)</span>
<span style="color: #000088;">$owners</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'vous@example.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//email of all team members except owners</span>
<span style="color: #000088;">$users</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'toi@example.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//sender of email</span>
<span style="color: #000088;">$sender</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'WebHook mailer&lt;webmaster@exemple.com&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//----------------------------------------------------------------------</span>
<span style="color: #000088;">$project</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'p'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'p'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$revision</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:-</span><span style="color: #cc66cc;">99</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'php://input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$digest</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_GOOGLE_CODE_PROJECT_HOSTING_HOOK_HMAC'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_GOOGLE_CODE_PROJECT_HOSTING_HOOK_HMAC'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//----------------------------------------------------------------------</span>
<span style="color: #009933; font-style: italic;">/**
 * Send a mail
 * @param string $from email of the sender : sample@example.com or &quot;name&quot;&lt;sample@example.com&gt;;
 * @param array $to [a] =&gt; list of email [cc], [bcc] (hidden), ...
 * @param string $subject
 * @param string $body
 * @return bool true if success
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> mailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$from</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span> <span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From: '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$from</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bcc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bcc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Bcc: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bcc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Cc: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'MIME-Version: 1.0'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Content-Type: text/plain; charset=&quot;UTF-8&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Content-Transfer-Encoding: 8bit'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'X-Mailer: PHP/'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">phpversion</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'[webhook]'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> failed<span style="color: #009900;">&#40;</span><span style="color: #000088;">$test_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$sender</span><span style="color: #339933;">,</span> <span style="color: #000088;">$owners</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$msg</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>--<span style="color: #000099; font-weight: bold;">\n</span>WebHook mail from the Google code project&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	mailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sender</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bcc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$owners</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'failed test #'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$test_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'KO'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_X_FORWARDED_FOR'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_X_FORWARDED_FOR'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_CLIENT_IP'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_CLIENT_IP'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//----------------------------------------------------------------------</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$useragent</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// failed 1</span>
	failed<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'User agent is bad : '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>From : &quot;</span> <span style="color: #339933;">.</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$project</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$project</span><span style="color: #339933;">,</span> <span style="color: #000088;">$projects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// failed 2</span>
	failed<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'No project set : '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$project</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>From : &quot;</span> <span style="color: #339933;">.</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$hmac</span> <span style="color: #339933;">=</span> <span style="color: #990000;">hash_hmac</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'md5'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <span style="color: #000088;">$keys</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$project</span> <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$digest</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$digest</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$hmac</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// failed 3</span>
		failed<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Bad digest : '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$digest</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' vs '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$hmac</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>From : &quot;</span> <span style="color: #339933;">.</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revision_count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revisions'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// failed 4</span>
		failed<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Bad count : '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revisions'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' vs '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revision_count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>From : &quot;</span> <span style="color: #339933;">.</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revisions'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_revision</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Revision : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revision'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' from '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' at '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d H:i'</span><span style="color: #339933;">,</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'timestamp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Added : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'added'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Modified : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'modified'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Removed : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'removed'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//			$mail_body .= 'URL : ' . &quot;\t\t&quot; . htmlentities($_revision['url']) . &quot;\n\n&quot;;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Message : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//			$_revision['path_count'];</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>--<span style="color: #000099; font-weight: bold;">\n</span>WebHook mail from the Google code project : &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$project</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>http://code.google.com/p/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$project</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		mailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sender</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bcc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$owners</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$users</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$project</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']New revision #'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$revision</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'OK'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

</p>
<p>Plus d&#8217;info : <a href="http://code.google.com/p/support/wiki/PostCommitWebHooks">PostCommitWebHooks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/310/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Espace de nom PHP et chargement automatique</title>
		<link>http://grummfy.be/blog/285#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/285#comments</comments>
		<pubDate>Mon, 07 Jun 2010 08:42:44 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=285</guid>
		<description><![CDATA[PHP 5.3 ajoute une notion intéressante : les espaces de nom. Voyons voir comment créer un chargeur automatique (ou autoloader) comprenant ceux-ci.]]></description>
			<content:encoded><![CDATA[<p><a href="./zend-framework#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">PHP</a> 5.3 ajoute une notion intéressante : les espaces de nom (ou namespace en anglais). Les espaces de nom permettent de séparer différents &#8230; &laquo;&nbsp;<em>espace</em>&laquo;&nbsp;, permettant ainsi d&#8217;avoir deux classe portant le même nom. Idéal pour l&#8217;utilisation de framework mais aussi de &laquo;&nbsp;l&#8217;isolation&nbsp;&raquo; de certains composants. Voyons voir comment créer un chargeur automatique (ou autoloader) comprenant les espaces de nom.</p>
<p>Si vous êtes sous Ms Windows, aucun problème un simple <em>spl_autoload_register();</em> suffit. Malheureusement, sous *nix un <a href="http://bugs.php.net/bug.php?id=51991" target="_blank">bug existe</a> il faudra donc implémenté une solution maison.</p>
<h2>Le code</h2>
<p>Ce code provient du &laquo;&nbsp;<a href="http://groups.google.com/group/php-standards/web/psr-0-final-proposal" class="broken_link">PHP  Standards Working Group</a>&nbsp;&raquo; :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> autoload<span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$className</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ltrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\\'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$fileName</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$namespace</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$lastNsPos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strripos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\\'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$namespace</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lastNsPos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$className</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lastNsPos</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$fileName</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'\\'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span><span style="color: #339933;">,</span> <span style="color: #000088;">$namespace</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$fileName</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span><span style="color: #339933;">,</span> <span style="color: #000088;">$className</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.php'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">require</span> <span style="color: #000088;">$fileName</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

</p>
<p>Pour l&#8217;utiliser, il faut définir deux choses :</p>
<ol>
<li>Ne pas oublier de modifier l&#8217;include path si nécessaire.</li>
<li>Ajouter cette fonction au chargeur de classes présent.</li>
</ol>
<h2>L&#8217;exemple</h2>
<p>Voici un exemple un peu plus complet.<br />
index.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">set_include_path</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">get_include_path</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> PATH_SEPARATOR <span style="color: #339933;">.</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/lib/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//on ajoute le dossier lib dans l'include path</span>
<span style="color: #990000;">spl_autoload_register</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//sur windows ceci devrait suffire .</span>
<span style="color: #666666; font-style: italic;">//le code pour les autres</span>
<span style="color: #666666; font-style: italic;">//----------------------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">function</span> autoload<span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$className</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ltrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\\'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$fileName</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$namespace</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$lastNsPos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strripos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\\'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$namespace</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lastNsPos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$className</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lastNsPos</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$fileName</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'\\'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span><span style="color: #339933;">,</span> <span style="color: #000088;">$namespace</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$fileName</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span><span style="color: #339933;">,</span> <span style="color: #000088;">$className</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.php'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">require</span> <span style="color: #000088;">$fileName</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #990000;">spl_autoload_register</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'autoload'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//----------------------------------------------------------</span>
<span style="color: #666666; font-style: italic;">//fin du code de fix</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> grummfy\test\Test<span style="color: #339933;">;</span>
Test<span style="color: #339933;">::</span><span style="color: #004000;">sayHello</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
\grummfy\std\Test<span style="color: #339933;">::</span><span style="color: #004000;">sayHello</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<p>./lib/grummfy/test/Test.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">namespace</span> grummfy\test<span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//pour rappel ceci doit-être la première instruction php (et on ne doit pas avoir de HTML avant)</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Je suis inclus ('</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">__FILE__</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">')!'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">class</span> Test
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> sayHello<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Bonjour depuis '</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">__CLASS__</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<p>./lib/grummfy/std/Test.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">namespace</span> grummfy\std<span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Je suis inclus ('</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">__FILE__</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">')!'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">class</span> Test
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> sayHello<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Bonjour depuis '</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">__CLASS__</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<p>Le résultat devrait être :<br />
<code><br />
Je suis inclus (/.../lib/grummfy/test/Test.php)!<br />
Bonjour depuis grummfy\test\Test<br />
Je suis inclus (/.../lib/grummfy/std/Test.php)!<br />
Bonjour depuis grummfy\std\Test<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/285/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Réécriture d&#8217;url et erreur interne à Apache</title>
		<link>http://grummfy.be/blog/289#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/289#comments</comments>
		<pubDate>Fri, 04 Jun 2010 13:15:29 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[deboguage]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[url rewriting]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=289</guid>
		<description><![CDATA[Il arrive que lors de l'écriture d'un nombre complexe de règle de réécriture d'URL, des erreurs se produisent. Passons au débogage de celles-ci.]]></description>
			<content:encoded><![CDATA[<p>Il arrive que lors de l&#8217;écriture d&#8217;un nombre complexe de règle de réécriture d&#8217;URL (URL rewriting), des erreurs se produisent sans pour autant être compréhensibles. Je vous propose donc de regarder comment déboguer cela à travers un exemple pratique.</p>
<h2>Exemple</h2>
<p>Prenons une règles qui vérifierait que seul certains type de caractère sont autorisés.<br />
La réécriture quant à elle se fait sur toute URL.<br />
Ajoutons un document 403 personnalisé<br />
<code>RewriteEngine on<br />
#<br />
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/ [NC]<br />
RewriteRule .* - [F,NS,L]<br />
#<br />
#if not a dir or a file<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
#<br />
RewriteRule ^(.*)$ index.php?p=$1 [QSA,L]<br />
ErrorDocument 403 /erreur/403<br />
</code><br />
Testons l&#8217;URL http://localhost/test:s et on obtient un beau :</p>
<blockquote><p>Forbidden</p>
<p>You don&#8217;t have permission to access /test:s on this server.</p>
<p>Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.</p></blockquote>
<p>Les logs d&#8217;erreurs d&#8217;Apache vous diront certainement quelque chose du genre :</p>
<blockquote><p>[error] [client 127.0.0.1] Request exceeded the limit of 10 internal  redirects due to probable configuration error. Use  &#8216;LimitInternalRecursion&#8217; to increase the limit if necessary. Use  &#8216;LogLevel debug&#8217; to get a backtrace.</p></blockquote>
<h2>Passage en mode debug de Apache</h2>
<p>Modifions la règle de log du site courant (soit dans /etc/apache2/sites-available/default soit dans /etc/apache2/apache.conf ou l&#8217;équivalent suivant votre configuration ou OS) et modifions la directive <em>&laquo;&nbsp;LogLevel warn&nbsp;&raquo;</em> en <em>&laquo;&nbsp;LogLevel debug&nbsp;&raquo;</em>. Ceci ne change rien dans notre cas, mais parfois cela s&#8217;avère utile&#8230;</p>
<p>Ajoutons ensuite les log<sup class='footnote'><a href='#fn-289-1' id='fnref-289-1'>1</a></sup> de réécriture d&#8217;url (moi je l&#8217;ai ajouter dans /etc/apache2/mods-available/rewrite.conf puis j&#8217;ai fait un a2enmod rewrite (car le fichier .conf n&#8217;existait pas) et enfin j&#8217;ai relancer Apache) :<br />
<code>&lt;IfModule mod_rewrite.c&gt;<br />
RewriteLog "/var/log/apache2/rewrite.log"<br />
RewriteLogLevel 9<br />
&lt;/IfModule&gt;</code></p>
<p>Maintenant si vous aller voir dans error.log vous aurez :</p>
<blockquote><p>[error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use &#8216;LimitInternalRecursion&#8217; to increase the limit if necessary. Use &#8216;LogLevel debug&#8217; to get a backtrace.<br />
[debug] core.c(3063): [client 127.0.0.1] r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/erreur/403<br />
[debug] core.c(3069): [client 127.0.0.1] redirected from r-&gt;uri = /&#8230;/test:s</p></blockquote>
<p>Donc on voit que la redirection s&#8217;effectue correctement mais qu&#8217;il &laquo;&nbsp;<em>n&#8217;accroche</em>&nbsp;&raquo; pas. Regardons donc les logs de la réécriture d&#8217;URL (rewrite.log) :</p>
<blockquote><p>/initial] (3) [perdir /.../] strip per-dir prefix: /&#8230;/test:s -&gt; test:s<br />
/initial] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;test:s&#8217;<br />
/initial] (4) [perdir /.../] RewriteCond: input=&nbsp;&raquo; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial] (3) [perdir /.../] strip per-dir prefix: /&#8230;/test:s -&gt; test:s<br />
/initial] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;test:s&#8217;<br />
/initial] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/test:s<br />
/initial/redir#1] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#1] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#1] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#1] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#1] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#1] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#1] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#1] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#1] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#2] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#2] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#2] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#2] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#2] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#2] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#2] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#2] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#2] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#3] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#3] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#3] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#3] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#3] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#3] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#3] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#3] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#3] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#4] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#4] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#4] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#4] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#4] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#4] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#4] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#4] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#4] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#5] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#5] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#5] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#5] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#5] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#5] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#5] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#5] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#5] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#6] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#6] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#6] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#6] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#6] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#6] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#6] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#6] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#6] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#7] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#7] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#7] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#7] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#7] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#7] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#7] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#7] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#7] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#8] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#8] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#8] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#8] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#8] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#8] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#8] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#8] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#8] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#9] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#9] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#9] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#9] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#9] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#9] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#9] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#9] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#9] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur<br />
/initial/redir#10] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#10] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#10] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#10] (4) [perdir /.../] RewriteCond: input=&#8217;403&#8242; pattern=&#8217;200&#8242; =&gt; not-matched<br />
/initial/redir#10] (3) [perdir /.../] add path info postfix: /&#8230;/erreur -&gt; /&#8230;/erreur/403<br />
/initial/redir#10] (3) [perdir /.../] strip per-dir prefix: /&#8230;/erreur/403 -&gt; erreur/403<br />
/initial/redir#10] (3) [perdir /.../] applying pattern &#8216;.*&#8217; to uri &#8216;erreur/403&#8242;<br />
/initial/redir#10] (4) [perdir /.../] RewriteCond: input=&#8217;GET /&#8230;/test:s HTTP/1.1&#8242; pattern=&#8217;!^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/&#8217; [NC] =&gt; matched<br />
/initial/redir#10] (2) [perdir /.../] forcing responsecode 403 for /&#8230;/erreur</p></blockquote>
<p>En gros, nous avions une boucle de redirection. Pour l&#8217;éviter ajoutons,d ans le .htaccess, une condition qui dira de ne pas rentrer dans le bloc, s&#8217;il y a une erreur 403 :<br />
<code>RewriteEngine on<br />
#<br />
RewriteCond %{ENV:REDIRECT_STATUS} !403<br />
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&amp;]+\ HTTP/ [NC]<br />
RewriteRule .* - [F,NS,L]<br />
#<br />
#if not a dir or a file<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
#<br />
RewriteRule ^(.*)$ index.php?p=$1 [QSA,L]<br />
ErrorDocument 403 /erreur/403<br />
</code><br />
Maintenant tout fonctionne comme prévu!</p>
<h2>La fin</h2>
<p>Pour finir, ceci montre encore l&#8217;importance des logs lors de la rencontre de problème. S&#8217;il y a moyen penser a les activer, cela simplifie franchement la tâche de débogage que cela soit pour Apache mais aussi pour tout projet informatique.</p>
<p>Un dernier conseil, pensez a désactiver le mode debug de Apache une fois fini!</p>
<p>S&#8217;il y avait un site a conseiller sur ce sujet (en dehors du manuel Apache) je vous renverrait vers <a href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html" target="_blank">askapache</a></p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-289-1'>Si le fichier ne se créer pas tout seul penser à le créer <span class='footnotereverse'><a href='#fnref-289-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/289/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL rewriting et SEO : duplication de contenu</title>
		<link>http://grummfy.be/blog/268#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/268#comments</comments>
		<pubDate>Wed, 02 Jun 2010 20:09:53 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[référencement]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[url rewriting]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=268</guid>
		<description><![CDATA[Article présentant l'URL rewriting et ce qu'est SEO pour arriver à la problématique de la réécriture d'URL : la duplication de contenu et comment l'éviter.]]></description>
			<content:encoded><![CDATA[<p>Cet article présente rapidement l&#8217;<acronym title="Uniform Resource Locators">URL</acronym> rewriting et ce qu&#8217;est SEO pour arriver au cœur du sujet, à savoir, la problématique de la réécriture d&#8217;URL : la duplication de contenu. Pourquoi la duplication de contenu est gênante et surtout comment l&#8217;éviter sont expliqué dans la suite!<span id="more-268"></span></p>
<h2>Mise en bouche</h2>
<p>L&#8217;URL rewriting ou réécriture d&#8217;<acronym title="Uniform Resource Locators">URL</acronym><sup class='footnote'><a href='#fn-268-1' id='fnref-268-1'>1</a></sup> permet de réécrire de manière plus ou moins dynamique des URL (par exemple transformer http://www.example.com/ en http://example.com/ avec une redirection ou encore http://example.com/contact/moi/par/formulaire en http://example.com/contact.php).</p>
<p>SEO ou Search Engine Optimization consiste à optimiser le référencement d&#8217;un site.</p>
<h2>Exemple</h2>
<p>Afin de débuter, il convient de donner un exemple fonctionnel. Reprenons donc un fichier .htaccess de base :<code><br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine on<br />
#si votre fichier se trouve dans /chemin vers votre répertoire de base de votre serveur/test/<br />
RewriteBase /test/<br />
#<br />
#On élimine les fichiers et répertoires qui existent déjà de la réécriture<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
#réécrit l'url<br />
RewriteRule ^(.+)$ index.php?path=$1 [QSA,L]<br />
&lt;/IfModule&gt;<br />
</code><br />
Je suppose que vous tester votre script localement, que vous êtes dans le dossier test et que le fichier php est index.php (qui suit).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">#
</span><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;pre&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_FILENAME'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REDIRECT_QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REDIRECT_URL'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_NAME'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/ pre&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#
</span><span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<p>Si vous testez le script, essayez d&#8217;y accéder par http://localhost/test/ceci-est_un-test?toto=tata puis par http://127.0.0.1/ceci-est_un-test?toto=tata . Dans le deuxième cas, une redirection 301 (fichier bouger de manière permanente) est effectuée. Concernant, l&#8217;explication en détail de la réécriture d&#8217;URL je vous renvoi vers votre moteur de recherche favoris.</p>
<h2>Double accès</h2>
<p>Maintenant, un  problème se pose. En effet, votre site est accessible par plusieurs URL différentes pour un même contenu, les moteurs de recherche interpréteront cela comme du duplicata de contenu <sup class='footnote'><a href='#fn-268-2' id='fnref-268-2'>2</a></sup>! Pour résoudre ce problème, il faut simplement faire en sorte que seule une seule et unique adresse soit accessible.</p>
<p>Premièrement, vérifier que l&#8217;on provient du bon domaine (par exemple : n&#8217;autoriser que example.com et non pas www.example.com ou uniquement localhost et non pas 127.0.0.1), le fichier .htaccess devient :<br />
<code><br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine on<br />
#si votre fichier se trouve dans /chemin vers votre répertoire de base de votre serveur/test/<br />
RewriteBase /test/<br />
#<br />
#test si on est bien sur le domaine localhost et non 127.0.0.1 ou autre chose<br />
RewriteCond %{HTTP_HOST} !^localhost<br />
#QSA pour transmettre le query string<br />
#L pour dire de sortir de la boucle de réécriture<br />
#R pour rediriger avec le code HTTP 301<br />
RewriteRule ^(.*) http://localhost/test/$1 [QSA,L,R=301]<br />
#<br />
#On élimine les fichiers et répertoires qui existent déjà de la réécriture<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
#réécrit l'url<br />
RewriteRule ^(.+)$ index.php?path=$1 [QSA,L]<br />
&lt;/IfModule&gt;<br />
</code></p>
<p>Ensuite, il faut dire aux moteurs de recherche de ne pas indexer les URL du genre index.php?mesparametres. Pour cela, on créé ou modifie le fichier robots.txt<sup class='footnote'><a href='#fn-268-3' id='fnref-268-3'>3</a></sup> :<br />
<code>User-agent: *<br />
Disallow: /test/index.php<br />
Allow: /test/</code></p>
<p>Maintenant, si vous testez le script, que cela soit par  http://localhost/test/ceci-est_un-test?toto=tata ou par  http://127.0.0.1/ceci-est_un-test?toto=tata seul localhost est accessible, l&#8217;autre effectue une redirection HTTP 301.</p>
<h2>Le mot de la fin</h2>
<p>Dans le cadre de la réécriture d&#8217;URL, il faut se méfier des possibilités d&#8217;inversion de paramètre. En effet, avec <a href="http://grummfy.be/blog/zend-framework">ZF</a> par exemple, une URL telle que http://example.com/test/controller/action/param1/var1/param2/var2 est équivalente à http://example.com/test/controller/action/param2/var2/param1/var1 mais les moteurs de recherche marqueront le contenu comme dupliqué. Dans ce cas-là, ce n&#8217;est plus du côté d’apache qu&#8217;il faut regarder mais bien du côté du moteur de votre site &#8230;</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-268-1'>On devrait dire <acronym title="Uniform Resource Identifiers">URI</acronym> selon la RFC 3986 mais <acronym title="Tout Le Monde S'En Fout">TLMSF</acronym> <span class='footnotereverse'><a href='#fnref-268-1'>&#8617;</a></span></li>
<li id='fn-268-2'>au pire vous serez blacklinker, au mieux votre référencement en pâtira <span class='footnotereverse'><a href='#fnref-268-2'>&#8617;</a></span></li>
<li id='fn-268-3'>Pour rappel, ce fichier se place à la base de votre URL, soit pour que dans notre exemple (http://www.example.com/test/) le fichier soit accessible via http://www.example.com/robots.txt <span class='footnotereverse'><a href='#fnref-268-3'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/268/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wampserver : quick switch xdebug menu</title>
		<link>http://grummfy.be/blog/250#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/250#comments</comments>
		<pubDate>Wed, 24 Mar 2010 22:22:42 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[deboguage]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[XDebug]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=250</guid>
		<description><![CDATA[Activer et désactiver XDebug sur Wampserver à souhait! Ceci via un menu supplémentaire.]]></description>
			<content:encoded><![CDATA[<p>Pour une fois, un article sous Ms Windows. Stage oblige, je passe du temps sous celui-ci (XP <img src='http://grummfy.be/blog/wp/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ). Afin d&#8217;optimiser son travail, il y a parfois des petites choses bien pratiques, telles que ce que je vais vous présenter.</p>
<p>XDebug est un outil merveilleux, parfois capricieux, certes, mais très utile. Il permet, notamment<sup class='footnote'><a href='#fn-250-1' id='fnref-250-1'>1</a></sup> :</p>
<ul>
<li>Affichage de tracé d&#8217;erreur</li>
<li>Meilleures lectures des exceptions</li>
<li>Débogage pas-à-pas</li>
<li>Profiling d&#8217;application</li>
<li>&#8230;</li>
</ul>
<p>Bref, des choses essentielles en développement. Et, contrairement à ce que certains IDE<sup class='footnote'><a href='#fn-250-2' id='fnref-250-2'>2</a></sup> font, il permet surtout de le faire sur un serveur &laquo;&nbsp;réel&nbsp;&raquo;, donc avec une utilisation &laquo;&nbsp;réel&nbsp;&raquo;.</p>
<p>Le but de ce billet n&#8217;est pas de présenter XDebug, d&#8217;autres le font mieux que moi <sup class='footnote'><a href='#fn-250-3' id='fnref-250-3'>3</a></sup>, mais bien de vous présenter un petit script vous permettant d&#8217;activer et désactiver XDebug sur wampserver.</p>
<h2>Installation</h2>
<ol>
<li>Téléchargez le fichier <sup class='footnote'><a href='#fn-250-4' id='fnref-250-4'>4</a></sup> et décompressez-le.</li>
<li>Suivez les instructions d&#8217;installation décrite dans le fichier installe. Il y a seulement 1 fichier à modifier + 1 fichier par version de PHP installée.</li>
<li>Relancer wampserver et tester!</li>
</ol>
<p>Si vous avez des questions, n&#8217;hésitez pas.</p>
<h2>Plus d&#8217;informations</h2>
<ul>
<li><a href="http://blog.pascal-martin.fr/post/xdebug-installation-premiers-pas" target="_blank">Xdebug : Installation et premier pas</a></li>
<li><a href="http://blog.wampserver.com/index.php/2009/08/28/debugger-avec-wampserver-xdebug-et-pdt/" target="_self" class="broken_link">Débugger avec WampServer, Xdebug et PDT</a></li>
<li><a href="http://evoilliot.u7n.org/2010/02/installer-xdebug-avec-xampp/" target="_blank" class="broken_link">Installer Xdebug avec XAMPP</a></li>
<li><a href="http://www.wampserver.com" target="_blank">Wampserver</a></li>
<li><a href="http://xdebug.com/" target="_blank">XDebug</a></li>
<li>Pièce jointe : <a href="http://grummfy.be/blog/250/xdebug-tar">XDebug quick switch menu for wampserver</a></li>
</ul>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-250-1'>On parle de serveur web avec PHP &#8230; <span class='footnotereverse'><a href='#fnref-250-1'>&#8617;</a></span></li>
<li id='fn-250-2'>Par exemple, Zend Studio permet un débogage pas à pas mais en interne donc réduit &#8230;  <span class='footnotereverse'><a href='#fnref-250-2'>&#8617;</a></span></li>
<li id='fn-250-3'>cf. plus d&#8217;informations <span class='footnotereverse'><a href='#fnref-250-3'>&#8617;</a></span></li>
<li id='fn-250-4'><a href="http://grummfy.be/blog/250/xdebug-tar">XDebug quick switch menu for wampserver</a> <span class='footnotereverse'><a href='#fnref-250-4'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/250/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vitesse et référencement</title>
		<link>http://grummfy.be/blog/243#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/243#comments</comments>
		<pubDate>Tue, 23 Mar 2010 09:34:38 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Réflexion du jour]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[optimisation]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[référencement]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web sémantique]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=243</guid>
		<description><![CDATA[La vitesse d&#8217;affichage d&#8217;une page web est actuellement, et ce depuis un certain temps, devenu importante. Surtout en ce qui concerne l&#8217;optimisation et par conséquent le référencement. Afin de gagner ces quelques millisecondes qui feront la différence, il existe plusieurs méthodes et techniques. En voici quelques-unes, avec des exemples. Diminuer le nombre de requêtes HTTP [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 		A:link { so-language: zxx } --></p>
<p>La vitesse d&#8217;affichage d&#8217;une page web est actuellement, et ce depuis un certain temps, devenu importante. Surtout en ce qui concerne l&#8217;optimisation et par conséquent le référencement. Afin de gagner ces quelques millisecondes qui feront la différence, il existe plusieurs méthodes et techniques. En voici quelques-unes, avec des exemples.</p>
<h2>Diminuer le nombre de requêtes HTTP</h2>
<p>Chaque requête HTTP au sein du fichier prend un certain temps, mais surtout bloque le chargement global de la page web. En effet, HTTP et HTML chargent les ressources au fur et à mesure que la page le demande.</p>
<p><span id="more-243"></span></p>
<p>Restreindre le nombre de fichiers, par exemple, en regroupant les css et javascript est une bonne solution. Une autre possibilité est aussi de charger l&#8217;essentiel de la page et à la fin de celle-ci, exécuter du code javascript qui sera chargé de téléverser du javascript ou encore des css.</p>
<h2>Diminuer le nombre de requêtes DNS</h2>
<p>Que dire, si ce n&#8217;est l&#8217;essentiel, une requête DNS prend du temps, et le temps est pris sur le chargement de votre page.</p>
<h2>Se rapprocher du visiteur</h2>
<p>La distance entre un serveur et un visiteur peut faire varier énormément le temps d&#8217;affichage. En effet, une information située sur un serveur a un point X du globe peut parfois faire plusieurs fois le tour de celui-ci avant d&#8217;arriver chez le visiteur Y. Tout dépends des accords entre les gestionnaires des différents réseaux, le chemin le plus économique est celui qui sera choisi<sup class='footnote'><a href='#fn-243-1' id='fnref-243-1'>1</a></sup>!!!!! En résumé, plus vous êtes proches, plus cela arrive vite.</p>
<p>Une solution peut venir de l&#8217;utilisation de <a title="Content Delivery Network" href="http://fr.wikipedia.org/wiki/Content_Delivery_Network" target="_blank">CDN</a> qui suivant la provenance de l&#8217;IP oriente le visiteur vers le serveur le plus proche.</p>
<h2>Diminuer la quantité de données envoyées</h2>
<p>Cela peut paraître bête, mais moins il y a de données, moins il faut attendre pour recevoir celle-ci. Le but n&#8217;est pas de supprimer du contenu, mais bien de faire une diète, par exemple, en optimisant le code (X)HTML, CSS, javascript, &#8230; Ceci en enlevant les espaces superflus et en compressant les données envoyées. On peut notamment citer <a href="http://javascript.crockford.com/jsmin.html" target="_blank">jsmin</a> et <a href="http://yuilibrary.com/downloads/#yuicompressor" target="_blank">YUI Compressor</a></p>
<p>Mais aussi utiliser le mode deflate et gzip de votre serveur web (Apache par exemple). Ceci fera prochainement l&#8217;objet d&#8217;un article.</p>
<h2>Utiliser le cache des navigateurs</h2>
<p>HTTP prévois un mécanisme de cache, pensez à l&#8217;utiliser. Envoyer une bonne entête HTTP sur vos fichiers afin que seul le contenu qui ai changé soit chargé par le visiteur qui revient sur votre site.</p>
<p>Parallèlement à cela, si vous utilisez des librairies ou des framework css ou javascript vous pouvez très bien utiliser un CDN tel que celui que <a href="http://code.google.com/apis/ajaxlibs/documentation/" target="_blank">Google met à votre disposition</a>. Le cache sera le même pour tous les sites qui utiliseront ce CDN et donc le gain « risque » d&#8217;être présent même si le visiteur visite votre site pour la première fois!</p>
<h2>Pour finir</h2>
<p>Et il existe au moins des dizaines d&#8217;autres techniques, c&#8217;est dire si le sujet et étendu et intéressant. Certaines, sont réalisable à l&#8217;échelle de l&#8217;individu tandis que d&#8217;autres nécessitent un investissement, parfois conséquent.</p>
<p>Le but de cet article était d&#8217;intriguer et de vous pousser à aller plus loin. Un web plus rapide est l&#8217;affaire de tous et est bénéfique pour tous : le visiteur, le webmaster, le référencement du site, les FAI (qui paierons moins de bande passante), les hébergeurs, la planète (ben oui, un web optimiser = un web qui consomme moins!), &#8230;</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-243-1'>L&#8217;écologie au niveau d&#8217;internet ce n&#8217;est donc pas ça! Imaginez la consommation de tous ces routeurs et switchs. <span class='footnotereverse'><a href='#fnref-243-1'>&#8617;</a></span></li>
</ol>
</div>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F243&amp;linkname=Vitesse%20et%20r%C3%A9f%C3%A9rencement" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F243&amp;linkname=Vitesse%20et%20r%C3%A9f%C3%A9rencement" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F243&amp;linkname=Vitesse%20et%20r%C3%A9f%C3%A9rencement" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F243&amp;linkname=Vitesse%20et%20r%C3%A9f%C3%A9rencement" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F243&amp;linkname=Vitesse%20et%20r%C3%A9f%C3%A9rencement" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F243&amp;linkname=Vitesse%20et%20r%C3%A9f%C3%A9rencement" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F243&amp;title=Vitesse%20et%20r%C3%A9f%C3%A9rencement" id="wpa2a_4"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/243/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Planet Zend Framework</title>
		<link>http://grummfy.be/blog/229#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/229#comments</comments>
		<pubDate>Thu, 21 Jan 2010 21:48:38 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Projet]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=229</guid>
		<description><![CDATA[Un planet sur Zend Framework, pour les francophones est née! Tout d&#8217;abord qu&#8217;est-ce qu&#8217;un planet? Un planet est un agrégateur de flux rss concernant un même sujet. Le but est de promouvoir mais surtout de concentrer les articles publié sur le sujet. Pour ceux qui désirerait y goûter, je vous renvoi vers le site : [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Un planet sur Zend Framework, pour les francophones est née!</p>
<p style="text-align: justify;">Tout d&#8217;abord qu&#8217;est-ce qu&#8217;un planet?<br />
Un planet est un agrégateur de flux rss concernant un même sujet. Le but est de promouvoir mais surtout de concentrer les articles publié sur le sujet.</p>
<p style="text-align: justify;">Pour ceux qui désirerait y goûter, je vous renvoi vers le site : <a title="ZF Planet" href="http://zf-planet.net/fr/" target="_blank">zf planet</a></p>
<p style="text-align: justify;">N&#8217;hésitez pas à demander a en faire partie.</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F229&amp;linkname=Planet%20Zend%20Framework" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F229&amp;linkname=Planet%20Zend%20Framework" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F229&amp;linkname=Planet%20Zend%20Framework" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F229&amp;linkname=Planet%20Zend%20Framework" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F229&amp;linkname=Planet%20Zend%20Framework" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F229&amp;linkname=Planet%20Zend%20Framework" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F229&amp;title=Planet%20Zend%20Framework" id="wpa2a_6"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/229/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[note]Zend Framework et dojo : auto-complétion</title>
		<link>http://grummfy.be/blog/216#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/216#comments</comments>
		<pubDate>Sat, 02 Jan 2010 15:32:29 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=216</guid>
		<description><![CDATA[Ceci est une note rapide ... j'espère produire un article plus intéressant une autre fois ...
Nous allons regarder les bases de l'auto-complétion  avec ZF et Dojo. Dojo simplement parce qu'il est le mieux intégré des frameworks javascript. Sachant que pour l'instant seul jQuery et Dojo sont intégré...]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Ceci est une note rapide &#8230; j&#8217;espère produire un article plus intéressant une autre fois &#8230;</p>
<p style="text-align: justify;">Nous allons regarder les bases de l&#8217;auto-complétion  avec <a href="./?tag=zf#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">ZF</a> et Dojo. Dojo simplement parce qu&#8217;il est le mieux intégré des frameworks javascript. Sachant que pour l&#8217;instant seul jQuery et Dojo sont intégré</p>
<h2>Le code</h2>
<p><em>application/views/scripts/test/index.phtml</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//activation de dojo</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comboBox</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'toto'</span><span style="color: #339933;">,</span>	<span style="color: #666666; font-style: italic;">//id html de l'élément</span>
	<span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>	<span style="color: #666666; font-style: italic;">//valeur par défaut</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'autocomplete'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>								<span style="color: #666666; font-style: italic;">//activation de l'auto-complétion</span>
		<span style="color: #0000ff;">'store'</span>		<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'stateStore'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'storeType'</span>		<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dojo.data.ItemFileReadStore'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'storeParams'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">baseUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/test/records'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>	<span style="color: #666666; font-style: italic;">//url où les données JSON sont récupérée</span>
		<span style="color: #0000ff;">'searchAttr'</span>		<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'title'</span><span style="color: #339933;">,</span>								<span style="color: #666666; font-style: italic;">//donnée recherchée pour remplir le combobox</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><em>application/layoutes/scripts/layout.phtml</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// ...</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isEnabled</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>	<span style="color: #666666; font-style: italic;">//Évite les chargement inutile ....</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDjConfigOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'isDebug'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>APPLICATION_ENV <span style="color: #339933;">==</span> <span style="color: #0000ff;">'development'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//affiche une console de deboguage si on est en mode dev</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDjConfigOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'usePlainJson'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>						<span style="color: #666666; font-style: italic;">//utilise du json texte</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLocalPath</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">baseUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/themes/js/dojo/dojo/dojo.js'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			<span style="color: #666666; font-style: italic;">//chemin vers les fichier dojo</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addStyleSheetModule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dijit.themes.tundra'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>					<span style="color: #666666; font-style: italic;">//thème à chargé</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>												<span style="color: #666666; font-style: italic;">//affichage du tout ...</span>
		<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// viennent ensuite nos jabvascript, css, etc</span>
<span style="color: #666666; font-style: italic;">//...</span>
<span style="color: #666666; font-style: italic;">//&lt;/head&gt;</span>
<span style="color: #666666; font-style: italic;">// ne pas oublier la class tundra dans le body</span>
<span style="color: #339933;">&lt;</span>body <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tundra&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #666666; font-style: italic;">//...</span></pre></div></div>

<p><em>application/Bootstrap.php</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//...</span>
<span style="color: #666666; font-style: italic;">//dans _initView()</span>
		<span style="color: #666666; font-style: italic;">//dojo</span>
		Zend_Dojo<span style="color: #339933;">::</span><span style="color: #004000;">enableView</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$view</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//...</span></pre></div></div>

<p><em>application/controllers/TestController.php</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> TestController <span style="color: #000000; font-weight: bold;">extends</span> Zend_Controller_Action
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> indexAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> recordsAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// on désactive l'affichage</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_helper<span style="color: #339933;">-&gt;</span><span style="color: #004000;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">disableLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//on va cherchée les données et les met dans un objet Zend_Dojo_Data</span>
		<span style="color: #000088;">$book</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Default_Model_DbTable_Book<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$dojo</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Dojo_Data<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$book</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$dojo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">toJson</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// on sort ... c'est pas joli mais en attendant cela fonctionne!</span>
		<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<h2>Choses à <span style="text-decoration: line-through;">retenir</span> comprendre</h2>
<p>Les choses à retenir :</p>
<ul>
<li><em>storeParams</em> est l&#8217;url où les donnée au format JSON seront prise</li>
<li><em>searchAttr</em> est l&#8217;élément qui va servir pour recherchée les données dans la masse de donnée JSON</li>
<li>ne pas oublier de mettre la class css &#8216;tundra&#8217;</li>
<li>Dojo peut, via ses styles css modifier votre rendu &#8230;</li>
</ul>
<h2>Remarque</h2>
<p>Version de ZF : 1.9.6</p>
<p>Version de Dojo (fourni avec zf dans extras) : 1.3</p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/216/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework aide de vue partialLoop et cycle</title>
		<link>http://grummfy.be/blog/199#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/199#comments</comments>
		<pubDate>Wed, 30 Dec 2009 14:16:39 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=199</guid>
		<description><![CDATA[Il y a des moment où l&#8217;on se dit que la doc est vraiment incomplète &#8230; Voici un exemple assez tordu&#8230; Rappel L&#8217;aide de vue (view helper)  cycle permet d&#8217;alterner des valeurs dans la vue, L&#8217;aide de vue partialLoop permet de faire une boucle sur une vue (fichier) afin de l&#8217;incorporer dans un autre fichier&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Il y a des moment où l&#8217;on se dit que la doc est vraiment incomplète &#8230; Voici un exemple assez tordu&#8230;</p>
<h2>Rappel</h2>
<ul>
<li>L&#8217;aide de vue (view helper)  <a href="http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.cycle">cycle</a> permet d&#8217;alterner des valeurs dans la vue,</li>
<li>L&#8217;aide de vue <a href="http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.partial">partialLoop</a> permet de faire une boucle sur une vue (fichier) afin de l&#8217;incorporer dans un autre fichier&#8230;</li>
</ul>
<h2>Utilisation</h2>
<p style="text-align: justify;">Pour utiliser les deux ensembles, par exemple dans le cas d&#8217;un listing dont la sortie serait dans un tableau, il vous suffit de définir les valeurs assigner au cycle <strong><em>avant</em></strong> de faire le partialLoop.<br />
Exemple :<br />
Vue <em>views/scripts/membres/listing.phtml</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;table class=&quot;table&quot;&gt;
	&lt;thead&gt;
		&lt;tr&gt;
			&lt;th&gt;Nom&lt;/th&gt;
			&lt;th&gt;Prénom&lt;/th&gt;
			&lt;th&gt;Adresse&lt;/th&gt;
			&lt;th&gt;Code postal&lt;/th&gt;
			&lt;th&gt;Ville&lt;/th&gt;
			&lt;th&gt;Pays&lt;/th&gt;
			&lt;th&gt;Téléphone&lt;/th&gt;
		&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cycle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tr_1'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tr_2'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tr_3'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'_user_listing'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">partialLoop</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'utilisateurs/_user_list_listing.phtml'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">entries</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/tbody&gt;
&lt;/table&gt;</pre></div></div>

<p>Vue <em>views/scripts/utilisateurs/_user_list_listing.phtml</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;tr class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cycle</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'_user_listing'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
	&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">escape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
	&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">escape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">firstName</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
	&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">escape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Addrese</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
	&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">postCode</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
	&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">escape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cityName</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
	&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">escape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">countryName</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
	&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tel_prefix</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
&lt;/tr&gt;</pre></div></div>
</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F199&amp;linkname=Zend%20Framework%20aide%20de%20vue%20partialLoop%20et%20cycle" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F199&amp;linkname=Zend%20Framework%20aide%20de%20vue%20partialLoop%20et%20cycle" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F199&amp;linkname=Zend%20Framework%20aide%20de%20vue%20partialLoop%20et%20cycle" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F199&amp;linkname=Zend%20Framework%20aide%20de%20vue%20partialLoop%20et%20cycle" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F199&amp;linkname=Zend%20Framework%20aide%20de%20vue%20partialLoop%20et%20cycle" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F199&amp;linkname=Zend%20Framework%20aide%20de%20vue%20partialLoop%20et%20cycle" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F199&amp;title=Zend%20Framework%20aide%20de%20vue%20partialLoop%20et%20cycle" id="wpa2a_8"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/199/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utilisation de FlashMessenger via un view helper dans Zend Framework</title>
		<link>http://grummfy.be/blog/191#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/191#comments</comments>
		<pubDate>Sun, 27 Dec 2009 18:21:56 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projet]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=191</guid>
		<description><![CDATA[FlashMessanger est à la base un action helper, donc confiné au contrôleur. Cependant, c'est tellement pratique qu'il est dommage de ne pas pouvoir l'utiliser a travers les vue (view)... Je vous propose donc de l'utiliser via un view helper!]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a title="Manuel Zend Framework sur FlashMessenger" href="http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.flashmessenger">FlashMessanger</a> est à la base un action helper, donc confiné au contrôleur. Celui-ci permet de passer un message d&#8217;une page à l&#8217;autre via le mécanisme des sessions . Après un formulaire on doit souvent ajouter un message de confirmation, on peux par exemple utilisé le FlashMessenger pour le faire et ainsi au ré-affichage suivant  afficher ce message!  C&#8217;est tellement pratique qu&#8217;il est dommage de ne pas pouvoir l&#8217;utiliser a travers les vue (view) de manière automatique&#8230;</p>
<p>Je vous propose donc de l&#8217;utiliser via un view helper!</p>
<p><span id="more-191"></span></p>
<h2>L&#8217;aide de vue</h2>
<p style="text-align: justify;">Voici l&#8217;aide de vue (view helper) FlashMessenger (du même nom que l&#8217;action helper). Il est à placer dans application/views/helpers/FlashMessenger.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * @see Zend_Controller_Action_Helper_FlashMessenger
 */</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/Controller/Action/Helper/FlashMessenger.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * @author grummfy
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> Zend_View_Helper_FlashMessenger <span style="color: #000000; font-weight: bold;">extends</span> Zend_View_Helper_Abstract implements IteratorAggregate<span style="color: #339933;">,</span> Countable
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_fm</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_fm <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Controller_Action_Helper_FlashMessenger<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> flashMessenger<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cur</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$cur</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">else</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessages</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Return currents FlashMessegenr object
	 * @return Zend_Controller_Action_Helper_FlashMessenger
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getFlasMessenger<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_fm<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Return previous emmited messages
	 * @return array
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getMessages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_fm<span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessages</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Renvoi le nombre de messages passé
	 * @return int
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> hasMessages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_fm<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getIterator<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_fm<span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIterator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_fm<span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

</p>
<h2>Utilisation</h2>
<p style="text-align: justify;">
Pour l&#8217;utiliser rien de plus simple, par exemple dans le layout :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">&lt;?php</span>
		<span style="color: #666666; font-style: italic;">// flashmessage</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">flashMessenger</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hasMessages</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;div id=&quot;flashMessengers&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span>
			<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">flashMessenger</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;flashMessenger&quot;&gt;'</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
					<span style="color: #b1b100;">echo</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">else</span>
					<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$msg</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/div&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span>
		<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// fin flashmessage</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Ceci peut très bien être utilisé dans votre vue (view) avec exactement le même code!</p>
<p style="text-align: justify;">Pour envoyer le message il vous suffit de simplement faire, dans votre contrôleur :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_helper<span style="color: #339933;">-&gt;</span><span style="color: #004000;">flashMessenger</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mise à jour du truc effectuées avec succès!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</p>
<p></p>
<p style="text-align: justify;">
Et c&#8217;est tout!</p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/191/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Créer et ajouter un validateur de session dans Zend Framework</title>
		<link>http://grummfy.be/blog/186#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/186#comments</comments>
		<pubDate>Sat, 19 Dec 2009 16:30:17 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projet]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=186</guid>
		<description><![CDATA[Zend Framework possède divers mécanismes de sécurisation, parmi ceux-ci l&#8217;on trouvent les validateurs. Ces validateurs vérifie que la ou les données à validées sont valide et par là même sécurise celle-ci. Dans notre cas nous allons nous intéresser aux sessions et plus particulièrement à la validation de celle-ci au moment de sont démarrage, ceci afin [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: justify;">
<p>Zend Framework possède divers mécanismes de sécurisation, parmi ceux-ci l&#8217;on trouvent les validateurs. Ces validateurs vérifie que la ou les données à validées sont valide et par là même sécurise celle-ci.</p>
<p>Dans notre cas nous allons nous intéresser aux sessions et plus particulièrement à la validation de celle-ci au moment de sont démarrage, ceci afin de, par exemple, <span style="text-decoration: line-through;">empêcher le</span> diminuer les possibilités de vol de celle-ci. Nous allons créer un validateur d&#8217;ip &#8230; (oui je sais y a moyen de passer outre, si on derrière un proxy gnagnagna &#8230;. mais ici c&#8217;est un exemple!).</p>
<p><span id="more-186"></span></p>
<h2>Rermarque</h2>
<p>Nous utiliserons Zend Framework en version 1.9.<br />
De plus, nous allons créer notre librairie qui se nomera &laquo;&nbsp;Biblio&nbsp;&raquo;. Donc, il faudra penser à créer dasn votre répertoire library le dossier Biblio!</p>
<h2>Les sessions</h2>
<p>Tout d&#8217;abord mettons en place le mécanisme de session. Dans le Bootstrap nous ajoutons la méthode suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _initSession<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	Zend_Session<span style="color: #339933;">::</span><span style="color: #004000;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Le validateur</h2>
<p>Passons à la création proporement dite, créons le fichier /library/Biblio/Session/Validator/Ip.php, dont le contenu sera</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">setValidData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>? <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Validate() - this method will determine if the ip matches the
	 * ip we stored when we initialized this variable.
	 *
	 * @return bool
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> validate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getValidData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<p>Ensuite, il nous faut ajouter ce validateur à la session. Donc, on réédite le Bootstrap et on modifie la méthode _initSession() :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _initSession<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Biblio/Session/Validator/Ip.php'</span><span style="color: #339933;">;</span>
	Zend_Session<span style="color: #339933;">::</span><span style="color: #004000;">registerValidator</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Biblio_Session_Validator_Ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Zend_Session<span style="color: #339933;">::</span><span style="color: #004000;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>conclusion</h2>
<p>Encore une fois Zend nous montre sa puissance et sa facilité d&#8217;ajout de fonctionnalité. A noter qu&#8217;il existe déjà un validateur pour els session qui contrôle l&#8217;user agent (Zend_Session_Validator_HttpUserAgent()).<br />
N&#8217;hésitez pas a en ajouter!</p>
</div>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F186&amp;linkname=Cr%C3%A9er%20et%20ajouter%20un%20validateur%20de%20session%20dans%20Zend%20Framework" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F186&amp;linkname=Cr%C3%A9er%20et%20ajouter%20un%20validateur%20de%20session%20dans%20Zend%20Framework" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F186&amp;linkname=Cr%C3%A9er%20et%20ajouter%20un%20validateur%20de%20session%20dans%20Zend%20Framework" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F186&amp;linkname=Cr%C3%A9er%20et%20ajouter%20un%20validateur%20de%20session%20dans%20Zend%20Framework" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F186&amp;linkname=Cr%C3%A9er%20et%20ajouter%20un%20validateur%20de%20session%20dans%20Zend%20Framework" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F186&amp;linkname=Cr%C3%A9er%20et%20ajouter%20un%20validateur%20de%20session%20dans%20Zend%20Framework" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F186&amp;title=Cr%C3%A9er%20et%20ajouter%20un%20validateur%20de%20session%20dans%20Zend%20Framework" id="wpa2a_10"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/186/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Questionnaire &#8211; sondage en ligne</title>
		<link>http://grummfy.be/blog/125#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/125#comments</comments>
		<pubDate>Wed, 26 Aug 2009 22:13:35 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Grummfy grrrrumf, ou comment raller]]></category>
		<category><![CDATA[Logiciel]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=125</guid>
		<description><![CDATA[J'en ai vu passé des questionnaires de fin de thèse ou des sondage pour tel ou tel société mais jamais je n'avais songé prendre note des références des logiciel ou des sociétés utilisé pour créer ces sondages-enquêtes! Du coup, en ayant eu besoin j'ai du chercher...]]></description>
			<content:encoded><![CDATA[<p>J&#8217;en ai vu passé des questionnaires de fin de thèse ou des sondage pour tel ou tel société mais jamais je n&#8217;avais songé prendre note des références des logiciel ou des sociétés utilisé pour créer ces sondages-enquêtes! Du coup, en ayant eu besoin j&#8217;ai du chercher&#8230;</p>
<p>Et là cela se complique, on se rend vite compte que beaucoup de société propose des service payant et là ou pour n&#8217;importe quel script on trouve facilement des réponses à droite et à gauche, ici rien! Bien embêté me voila sur le chemin de la recherche.</p>
<p>Bref après quelques recherche et élimination je trouve deux sites proposant des services gratuits et qui semble correcte :<br />
<a href="http://www.paxonta.com">http://www.paxonta.com</a> et <a href="http://www.sondageonline.com">http://www.sondageonline.com</a></p>
<p>Cependant, je me dit qu&#8217;il y avait certainement un projet open-source qui se devait d&#8217;exister et que si ce n&#8217;est pas le cas, alors le moment de hurler et de se lancer dans la bataille en faisant son William Walace devait arriver. Mais heureusement, pas besoin de tête tranchée le script fut trouvé :  <a href="http://www.limesurvey.org">LimeSurvey</a></p>
<p>Je ne suis pas déçu et ils propose même un service en ligne : <a href="http://www.limeservice.com">http://www.limeservice.com</a><br />
Par contre, il m&#8217;a fallu un peu de temps pour comprendre &#8230;. En gros, toujours cliquer sur l&#8217;icône à droite (l&#8217;espèce de feuille &#8230;.) et voila!</p>
<p>Perso je trouve que c&#8217;est encore fort compliqué &#8230; mais bon on peux pas tout avoir &#8230;.</p>
<p>J&#8217;en profite pour vous le faire tester en répondant a ce magnifique <a href="http://forum.limequery.net/index.php?sid=24955&amp;lang=fr" target="_blank">questionnaire sur les forums</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/125/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gmail ou comment l&#8217;avoir dans le cul pour les fonctionnalités jabber</title>
		<link>http://grummfy.be/blog/107#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/107#comments</comments>
		<pubDate>Sat, 14 Jun 2008 02:18:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Grummfy grrrrumf, ou comment raller]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[im]]></category>
		<category><![CDATA[libre]]></category>
		<category><![CDATA[pétage de câble]]></category>
		<category><![CDATA[sbé]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=107</guid>
		<description><![CDATA[Récemment, j&#8217;ai découvert divers fonctionnalité jabber, notamment le chat dans un salon de cuir de discutions. C&#8217;est génial, je dirait même très intéressant, seul hic, avec un compte gmail, on est plus vraiment du jabber mais bien un dérivé de XMPP[1] [2] de ce fait certaine fonctionnalité ne sont plus présente ou incompatible! Exemple&#160;: Transfert [...]]]></description>
			<content:encoded><![CDATA[<p>Récemment, j&#8217;ai découvert divers fonctionnalité jabber, notamment le <a href="http://xbright.codingteam.net/dotclear/index.php/post/2008/06/13/Pourquoi-les-salons-Jabber-sont-ils-si-peu-populaires" hreflang="fr">chat dans un salon</a> <del>de cuir</del> de discutions.</p>
<p>C&#8217;est génial, je dirait même très intéressant, seul hic, avec un compte gmail, on est plus vraiment du jabber mais bien un dérivé de XMPP<sup>[<a href="#pnote-111-1#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" id="rev-pnote-111-1">1</a>]</sup> <sup>[<a href="#pnote-111-2#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" id="rev-pnote-111-2">2</a>]</sup> de ce fait certaine fonctionnalité ne sont plus présente ou incompatible!</p>
<p>Exemple&nbsp;:</p>
<ul>
<li>Transfert de fichier</li>
<li>Marque page des salons de discussions intéressant</li>
<li>Contacter une personne en privé ou prendre sont adresse dans un salon de discussion</li>
<li>&#8230;</li>
</ul>
<p>Bref fait chier!</p>
<div class="footnotes">
<h4>Notes</h4>
<p>[<a href="#rev-pnote-111-1#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" id="pnote-111-1">1</a>] sur lequel jabber est basé</p>
<p>[<a href="#rev-pnote-111-2#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" id="pnote-111-2">2</a>] si je retrouve le lien je vous le met!</p>
</div>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F107&amp;linkname=Gmail%20ou%20comment%20l%26%238217%3Bavoir%20dans%20le%20cul%20pour%20les%20fonctionnalit%C3%A9s%20jabber" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F107&amp;linkname=Gmail%20ou%20comment%20l%26%238217%3Bavoir%20dans%20le%20cul%20pour%20les%20fonctionnalit%C3%A9s%20jabber" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F107&amp;linkname=Gmail%20ou%20comment%20l%26%238217%3Bavoir%20dans%20le%20cul%20pour%20les%20fonctionnalit%C3%A9s%20jabber" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F107&amp;linkname=Gmail%20ou%20comment%20l%26%238217%3Bavoir%20dans%20le%20cul%20pour%20les%20fonctionnalit%C3%A9s%20jabber" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F107&amp;linkname=Gmail%20ou%20comment%20l%26%238217%3Bavoir%20dans%20le%20cul%20pour%20les%20fonctionnalit%C3%A9s%20jabber" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F107&amp;linkname=Gmail%20ou%20comment%20l%26%238217%3Bavoir%20dans%20le%20cul%20pour%20les%20fonctionnalit%C3%A9s%20jabber" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F107&amp;title=Gmail%20ou%20comment%20l%26%238217%3Bavoir%20dans%20le%20cul%20pour%20les%20fonctionnalit%C3%A9s%20jabber" id="wpa2a_12"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/107/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>E-Mail ou Courriel de masses, ces chaînes que nous aimons &#8230;</title>
		<link>http://grummfy.be/blog/105#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/105#comments</comments>
		<pubDate>Sat, 07 Jun 2008 23:46:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Grummfy grrrrumf, ou comment raller]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[vie]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=105</guid>
		<description><![CDATA[<p>Régulièrement, et ce de plus en plus souvent, des chaînes de mail se forment. On vous inclut dans un publipostage sans demander votre avis tout comme à la cinquantaine autres personnes qui, comme vous, subissent cela!!!!!</p>]]></description>
			<content:encoded><![CDATA[<p>Régulièrement, et ce de plus en plus souvent, des chaînes de mail se forment. On vous inclut dans un publipostage sans demander votre avis tout comme à la cinquantaine autres personnes qui, comme vous, subissent cela!!!!!</p>
<p><span id="more-105"></span></p>
<p>Bien entendu on envoi l&#8217;email directement par &laquo;&nbsp;réponse à tous&nbsp;&raquo; tout en incluant les nouvelles adresses e-mail! Bien souvent, on ne connais pas vraiment le contenu de cette liste <del>de merde</del> car comme 95% des gens le but de l&#8217;objet (ou sujet) de l&#8217;e-mail est quelques chose d&#8217;inconnu!</p>
<p><q>Oui, mais <em>moi</em> je trouve que cette infos peut intéresser Riri, Fifi et Loulou ainsi que l&#8217;oncle picsou&#8230;</q></p>
<p>Bien, cela les intéressera peut-être, mais alors demander leur!</p>
<ul>
<li>Un petit mail avant, leur expliquant ce dont il retourne</li>
<li>Attendre la réponse positive</li>
<li>Répondre sur la liste d&#8217;e-mail en incluant les nouveaux email.</li>
</ul>
<h2>Pourquoi demander?</h2>
<p>Simplement parce que chacun à un droit de regard sur ces informations personnelles, or une adresse e-mail est une information personnelle! Par la diffusion à tous, vous faites en sortes que vos contact soit plus susceptible de recevoir de la pub(spam) ou d&#8217;être inclut dans d&#8217;autre chaîne e-mail de masse. Mais ce n&#8217;est pas la seule raison, il y va aussi du confort dans la quantité et la qualité des e-mail que l&#8217;on reçoit. Et bien plus encore&#8230;</p>
<p>Après, il existe 99% de chance que l&#8217;information que vous désirez envoyez, n&#8217;est simplement <ins>qu&#8217;une</ins> information à faire circuler et ne demandant pas de réponse à tous vos contacts! Dans ce cas, il est important, que dis-je primordiale, d&#8217;utiliser l&#8217;option &laquo;&nbsp;copie cachée&nbsp;&raquo; (bcc ou bcci suivant les webmails et &laquo;&nbsp;copie cachée&nbsp;&raquo; dans les programmes en langue française). Cette option magique, magnifique, inoubliable, permet d&#8217;éviter la diffusion des adresses de vos contacts aux restes du monde. Vous pouvez toujours ajouter un petit message disant que ce courriel est un message de masse et n&#8217;est donc pas personnel.</p>
<p>ps&nbsp;: pensez à <a href="http://chm.duquesne.free.fr/blog/?p=47" hreflang="fr">utiliser pgp pour signer vos e-mail</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/105/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sortie importante&#8230;</title>
		<link>http://grummfy.be/blog/97#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/97#comments</comments>
		<pubDate>Thu, 22 Nov 2007 11:51:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[sortie]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=97</guid>
		<description><![CDATA[Hello, dernièrement deux logiciel important, pour peux que vous en ayez besoin , sont sorti! J&#8217;ai nomé&#160;: Wampserver JDOM Wampserver Wampserver est un gestionnaire de serveur tel easyphp (mais en bien mieux, à mon goût en tout cas!), qui permet d&#8217;utiliser apache, php4 ou 5, &#8230; la version 1 était déjà excellent, la v2 s&#8217;annonce [...]]]></description>
			<content:encoded><![CDATA[<p>Hello, dernièrement deux logiciel important, pour peux que vous en ayez besoin <img src='http://grummfy.be/blog/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  , sont sorti!</p>
<p>J&#8217;ai nomé&nbsp;:</p>
<ul>
<li>Wampserver</li>
<li>JDOM</li>
</ul>
<h4>Wampserver</h4>
<p>Wampserver est un gestionnaire de serveur tel easyphp (mais en bien mieux, à mon goût en tout cas!), qui permet d&#8217;utiliser apache, php4 ou 5, &#8230; la version 1 était déjà excellent, la v2 s&#8217;annonce délicieuse!</p>
<p>Le <a href="http://www.wampserver.com/download.php" class="broken_link">[télécharger</a>]</p>
<p>Pour ceux qui connaissent le logiciel, vous remarquerez que tout à été revu de font en comble&nbsp;: design, logo, &#8230;</p>
<p><a href="http://www.wampserver.com/presentation.php">[Présentation du logiciel</a>]</p>
<h4>JDOM</h4>
<p>JDOM est une libraire java permetant de manipuler un arbre dom. Le version 1.1 est sortie</p>
<p>Découvrez cette librairie sur le <a href="http://jdom.org/">[site officiel de JDOM</a>]</p>
<p><a href="http://jdom.org/dist/binary/">[Téléchargement</a>]</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F97&amp;linkname=Sortie%20importante%26%238230%3B" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F97&amp;linkname=Sortie%20importante%26%238230%3B" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F97&amp;linkname=Sortie%20importante%26%238230%3B" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F97&amp;linkname=Sortie%20importante%26%238230%3B" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F97&amp;linkname=Sortie%20importante%26%238230%3B" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F97&amp;linkname=Sortie%20importante%26%238230%3B" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F97&amp;title=Sortie%20importante%26%238230%3B" id="wpa2a_14"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/97/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AnySurfer ou l&#8217;accessibilité belge!</title>
		<link>http://grummfy.be/blog/95#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/95#comments</comments>
		<pubDate>Fri, 02 Nov 2007 19:11:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[accessibilité]]></category>
		<category><![CDATA[belge]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=95</guid>
		<description><![CDATA[Je vient de découvrir ce site&#160;: http://www.anysurfer.be via le module de payement en ligne de ma banque Dexia. Je trouve cette idée vraiment génial, de plus, pour une fois, les explications et conseils donnée sont clairs! Bref allez-y&#160;: Le site de AnySurfer Les pages conseils]]></description>
			<content:encoded><![CDATA[<p>Je vient de découvrir ce site&nbsp;: <a href="http://www.anysurfer.be" title="http://www.anysurfer.be">http://www.anysurfer.be</a> via le module de payement en ligne de ma banque <a href="http://www.dexia.be">Dexia</a>.</p>
<p>Je trouve cette idée vraiment génial, de plus, pour une fois, les explications et conseils donnée sont clairs!</p>
<h4>Bref allez-y&nbsp;:</h4>
<p>Le site de <a href="http://www.anysurfer.be">AnySurfer</a><br />
Les <a href="http://www.anysurfer.be/fr/directives/">pages conseils</a></p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F95&amp;linkname=AnySurfer%20ou%20l%26%238217%3Baccessibilit%C3%A9%20belge%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F95&amp;linkname=AnySurfer%20ou%20l%26%238217%3Baccessibilit%C3%A9%20belge%21" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F95&amp;linkname=AnySurfer%20ou%20l%26%238217%3Baccessibilit%C3%A9%20belge%21" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F95&amp;linkname=AnySurfer%20ou%20l%26%238217%3Baccessibilit%C3%A9%20belge%21" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F95&amp;linkname=AnySurfer%20ou%20l%26%238217%3Baccessibilit%C3%A9%20belge%21" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F95&amp;linkname=AnySurfer%20ou%20l%26%238217%3Baccessibilit%C3%A9%20belge%21" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F95&amp;title=AnySurfer%20ou%20l%26%238217%3Baccessibilit%C3%A9%20belge%21" id="wpa2a_16"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/95/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nouveau service en route</title>
		<link>http://grummfy.be/blog/93#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/93#comments</comments>
		<pubDate>Tue, 30 Oct 2007 11:55:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[del.icio.us]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=93</guid>
		<description><![CDATA[VOila, ça y est, je vient enfin de m&#8217;enregistrer sur del.iciou.us &#8230; désormais vous aurez accès a certain lien (qui ne sont pas repris dans mes flux rss (voir en bas à droite du blog)) mon compte&#160;: http://del.icio.us/Grummfy]]></description>
			<content:encoded><![CDATA[<p>VOila, ça y est,</p>
<p>je vient enfin de m&#8217;enregistrer sur del.iciou.us &#8230;</p>
<p>désormais vous aurez accès a certain lien (qui ne sont pas repris dans mes flux rss (voir en bas à droite du blog))</p>
<p>mon compte&nbsp;: <a href="http://del.icio.us/Grummfy" title="http://del.icio.us/Grummfy" class="broken_link">http://del.icio.us/Grummfy</a></p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F93&amp;linkname=Nouveau%20service%20en%20route" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F93&amp;linkname=Nouveau%20service%20en%20route" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F93&amp;linkname=Nouveau%20service%20en%20route" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F93&amp;linkname=Nouveau%20service%20en%20route" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F93&amp;linkname=Nouveau%20service%20en%20route" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F93&amp;linkname=Nouveau%20service%20en%20route" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F93&amp;title=Nouveau%20service%20en%20route" id="wpa2a_18"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/93/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 3.409 seconds -->

